Skip to content

Commit

Permalink
feat: add new read functions to Superfluid plugin (#315)
Browse files Browse the repository at this point in the history
* feat: add new read functions to Superfluid plugin

* Fix PR

---------

Co-authored-by: Agustin Armellini Fischer <[email protected]>
  • Loading branch information
Dayitva and 0xaguspunk authored Feb 19, 2025
1 parent f68960d commit 82a035e
Show file tree
Hide file tree
Showing 4 changed files with 493 additions and 4 deletions.
5 changes: 5 additions & 0 deletions typescript/.changeset/polite-otters-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@goat-sdk/plugin-superfluid": patch
---

Add new read functions
293 changes: 293 additions & 0 deletions typescript/packages/plugins/superfluid/src/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,299 @@ export const CFA_FORWARDER_ABI = [
},
] as const;

export const GDA_FORWARDER_ABI = [
{
inputs: [
{
internalType: "contract ISuperfluid",
name: "host",
type: "address",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "address", name: "memberAddress", type: "address" },
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "claimAll",
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "connectPool",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "admin", type: "address" },
{
components: [
{
internalType: "bool",
name: "transferabilityForUnitsOwner",
type: "bool",
},
{
internalType: "bool",
name: "distributionFromAnyAddress",
type: "bool",
},
],
internalType: "struct PoolConfig",
name: "config",
type: "tuple",
},
],
name: "createPool",
outputs: [
{ internalType: "bool", name: "success", type: "bool" },
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "disconnectPool",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "from", type: "address" },
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{
internalType: "uint256",
name: "requestedAmount",
type: "uint256",
},
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "distribute",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "from", type: "address" },
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "int96", name: "requestedFlowRate", type: "int96" },
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "distributeFlow",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "from", type: "address" },
{
internalType: "contract ISuperfluidPool",
name: "to",
type: "address",
},
{
internalType: "uint256",
name: "requestedAmount",
type: "uint256",
},
],
name: "estimateDistributionActualAmount",
outputs: [{ internalType: "uint256", name: "actualAmount", type: "uint256" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "from", type: "address" },
{
internalType: "contract ISuperfluidPool",
name: "to",
type: "address",
},
{ internalType: "int96", name: "requestedFlowRate", type: "int96" },
],
name: "estimateFlowDistributionActualFlowRate",
outputs: [
{ internalType: "int96", name: "actualFlowRate", type: "int96" },
{
internalType: "int96",
name: "totalDistributionFlowRate",
type: "int96",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "from", type: "address" },
{
internalType: "contract ISuperfluidPool",
name: "to",
type: "address",
},
],
name: "getFlowDistributionFlowRate",
outputs: [{ internalType: "int96", name: "", type: "int96" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "account", type: "address" },
],
name: "getNetFlow",
outputs: [{ internalType: "int96", name: "", type: "int96" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
],
name: "getPoolAdjustmentFlowInfo",
outputs: [
{ internalType: "address", name: "", type: "address" },
{ internalType: "bytes32", name: "", type: "bytes32" },
{ internalType: "int96", name: "", type: "int96" },
],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "address", name: "pool", type: "address" }],
name: "getPoolAdjustmentFlowRate",
outputs: [{ internalType: "int96", name: "", type: "int96" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "address", name: "member", type: "address" },
],
name: "isMemberConnected",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidToken",
name: "token",
type: "address",
},
{ internalType: "address", name: "account", type: "address" },
],
name: "isPool",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ISuperfluidPool",
name: "pool",
type: "address",
},
{ internalType: "address", name: "memberAddress", type: "address" },
{ internalType: "uint128", name: "newUnits", type: "uint128" },
{ internalType: "bytes", name: "userData", type: "bytes" },
],
name: "updateMemberUnits",
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
] as const;

export const POOL_ABI = [
{
inputs: [],
Expand Down
7 changes: 7 additions & 0 deletions typescript/packages/plugins/superfluid/src/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ export class DeploySuperTokenWrapperParameters extends createToolParameters(
symbol: z.string().describe("The symbol of the Super Token Wrapper"),
}),
) {}

export class GetNetFlowRateParameters extends createToolParameters(
z.object({
token: z.string().describe("The address of the Super Token to get the flow of"),
memberAddr: z.string().describe("The address of the member to get flow rate for"),
}),
) {}
Loading

0 comments on commit 82a035e

Please sign in to comment.