Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new read functions to Superfluid plugin #315

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 297 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,303 @@ 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