@superfluid-finance/sdk-core 0.3.3-dev.a92870f.0 → 0.3.3-dev.bd59c6c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/README.md +2 -0
- package/dist/index.umd.js +6034 -2012
- package/dist/main/BatchCall.d.ts +6 -6
- package/dist/main/BatchCall.js +8 -8
- package/dist/main/BatchCall.js.map +1 -1
- package/dist/main/ConstantFlowAgreementV1.d.ts +106 -17
- package/dist/main/ConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/main/ConstantFlowAgreementV1.js +238 -50
- package/dist/main/ConstantFlowAgreementV1.js.map +1 -1
- package/dist/main/{Token.d.ts → ERC20Token.d.ts} +17 -14
- package/dist/main/ERC20Token.d.ts.map +1 -0
- package/dist/main/{Token.js → ERC20Token.js} +29 -33
- package/dist/main/ERC20Token.js.map +1 -0
- package/dist/main/Framework.d.ts +34 -7
- package/dist/main/Framework.d.ts.map +1 -1
- package/dist/main/Framework.js +88 -15
- package/dist/main/Framework.js.map +1 -1
- package/dist/main/Governance.d.ts +40 -0
- package/dist/main/Governance.d.ts.map +1 -0
- package/dist/main/Governance.js +82 -0
- package/dist/main/Governance.js.map +1 -0
- package/dist/main/Host.d.ts +3 -3
- package/dist/main/Host.d.ts.map +1 -1
- package/dist/main/Host.js +4 -4
- package/dist/main/Host.js.map +1 -1
- package/dist/main/InstantDistributionAgreementV1.d.ts +25 -22
- package/dist/main/InstantDistributionAgreementV1.d.ts.map +1 -1
- package/dist/main/InstantDistributionAgreementV1.js +69 -71
- package/dist/main/InstantDistributionAgreementV1.js.map +1 -1
- package/dist/main/Operation.d.ts +5 -5
- package/dist/main/Operation.js +5 -5
- package/dist/main/Query.d.ts +6 -6
- package/dist/main/Query.d.ts.map +1 -1
- package/dist/main/Query.js +18 -16
- package/dist/main/Query.js.map +1 -1
- package/dist/main/SFError.d.ts +1 -1
- package/dist/main/SFError.d.ts.map +1 -1
- package/dist/main/SFError.js +2 -0
- package/dist/main/SFError.js.map +1 -1
- package/dist/main/SuperToken.d.ts +226 -67
- package/dist/main/SuperToken.d.ts.map +1 -1
- package/dist/main/SuperToken.js +318 -132
- package/dist/main/SuperToken.js.map +1 -1
- package/dist/main/abi/IConstantFlowAgreementV1.json +335 -2
- package/dist/main/abi/ISETH.json +1604 -0
- package/dist/main/abi/SuperfluidGovernanceII.json +921 -0
- package/dist/main/constants.d.ts +4 -0
- package/dist/main/constants.d.ts.map +1 -1
- package/dist/main/constants.js +36 -13
- package/dist/main/constants.js.map +1 -1
- package/dist/main/defaultSubgraphReleaseTag.json +3 -0
- package/dist/main/events.d.ts +14 -2
- package/dist/main/events.d.ts.map +1 -1
- package/dist/main/frameworkHelpers.d.ts +2 -2
- package/dist/main/frameworkHelpers.js +2 -2
- package/dist/main/index.d.ts +16 -5
- package/dist/main/index.d.ts.map +1 -1
- package/dist/main/index.js +12 -1
- package/dist/main/index.js.map +1 -1
- package/dist/main/interfaces.d.ts +81 -8
- package/dist/main/interfaces.d.ts.map +1 -1
- package/dist/main/mapGetAllEventsQueryEvents.d.ts.map +1 -1
- package/dist/main/mapGetAllEventsQueryEvents.js +22 -1
- package/dist/main/mapGetAllEventsQueryEvents.js.map +1 -1
- package/dist/main/pagination.d.ts +42 -4
- package/dist/main/pagination.d.ts.map +1 -1
- package/dist/main/pagination.js +36 -5
- package/dist/main/pagination.js.map +1 -1
- package/dist/main/subgraph/SubgraphClient.d.ts +2 -2
- package/dist/main/subgraph/SubgraphClient.d.ts.map +1 -1
- package/dist/main/subgraph/SubgraphClient.js +0 -12
- package/dist/main/subgraph/SubgraphClient.js.map +1 -1
- package/dist/main/subgraph/entities/account/account.d.ts +1 -0
- package/dist/main/subgraph/entities/account/account.d.ts.map +1 -1
- package/dist/main/subgraph/entities/account/accounts.generated.d.ts +2 -0
- package/dist/main/subgraph/entities/account/accounts.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/account/accounts.generated.js +1 -1
- package/dist/main/subgraph/entities/account/accounts.generated.js.map +1 -1
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts +2 -0
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts.map +1 -1
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js +1 -0
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js.map +1 -1
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts +3 -0
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js +1 -1
- package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js.map +1 -1
- package/dist/main/subgraph/entities/index/index.d.ts +2 -0
- package/dist/main/subgraph/entities/index/index.d.ts.map +1 -1
- package/dist/main/subgraph/entities/index/index.js +1 -0
- package/dist/main/subgraph/entities/index/index.js.map +1 -1
- package/dist/main/subgraph/entities/index/indexes.generated.d.ts +3 -0
- package/dist/main/subgraph/entities/index/indexes.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/index/indexes.generated.js +1 -1
- package/dist/main/subgraph/entities/index/indexes.generated.js.map +1 -1
- package/dist/main/subgraph/entities/indexSubscription/indexSubscription.d.ts +2 -0
- package/dist/main/subgraph/entities/indexSubscription/indexSubscription.d.ts.map +1 -1
- package/dist/main/subgraph/entities/indexSubscription/indexSubscription.js +1 -0
- package/dist/main/subgraph/entities/indexSubscription/indexSubscription.js.map +1 -1
- package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts +3 -0
- package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.js +1 -1
- package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.js.map +1 -1
- package/dist/main/subgraph/entities/stream/stream.d.ts +2 -0
- package/dist/main/subgraph/entities/stream/stream.d.ts.map +1 -1
- package/dist/main/subgraph/entities/stream/stream.js +1 -0
- package/dist/main/subgraph/entities/stream/stream.js.map +1 -1
- package/dist/main/subgraph/entities/stream/streams.generated.d.ts +3 -0
- package/dist/main/subgraph/entities/stream/streams.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/stream/streams.generated.js +1 -1
- package/dist/main/subgraph/entities/stream/streams.generated.js.map +1 -1
- package/dist/main/subgraph/entities/streamPeriod/streamPeriod.d.ts +2 -0
- package/dist/main/subgraph/entities/streamPeriod/streamPeriod.d.ts.map +1 -1
- package/dist/main/subgraph/entities/streamPeriod/streamPeriod.js +1 -0
- package/dist/main/subgraph/entities/streamPeriod/streamPeriod.js.map +1 -1
- package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts +3 -0
- package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.js +1 -1
- package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.js.map +1 -1
- package/dist/main/subgraph/entities/token/token.d.ts +1 -0
- package/dist/main/subgraph/entities/token/token.d.ts.map +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.d.ts +2 -0
- package/dist/main/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.js +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.js.map +1 -1
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistic.d.ts +1 -0
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistic.d.ts.map +1 -1
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts +2 -0
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.js +1 -1
- package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.js.map +1 -1
- package/dist/main/subgraph/events/events.d.ts +1 -0
- package/dist/main/subgraph/events/events.d.ts.map +1 -1
- package/dist/main/subgraph/events/events.generated.d.ts +118 -3
- package/dist/main/subgraph/events/events.generated.d.ts.map +1 -1
- package/dist/main/subgraph/events/events.generated.js +38 -37
- package/dist/main/subgraph/events/events.generated.js.map +1 -1
- package/dist/main/subgraph/events/flowUpdatedEvent.d.ts +1 -0
- package/dist/main/subgraph/events/flowUpdatedEvent.d.ts.map +1 -1
- package/dist/main/subgraph/events/indexUpdatedEvent.d.ts +1 -0
- package/dist/main/subgraph/events/indexUpdatedEvent.d.ts.map +1 -1
- package/dist/main/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts +1 -0
- package/dist/main/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts.map +1 -1
- package/dist/main/subgraph/meta/meta.d.ts +15 -0
- package/dist/main/subgraph/meta/meta.d.ts.map +1 -0
- package/dist/main/subgraph/meta/meta.generated.d.ts +19 -0
- package/dist/main/subgraph/meta/meta.generated.d.ts.map +1 -0
- package/dist/main/subgraph/meta/meta.generated.js +5 -0
- package/dist/main/subgraph/meta/meta.generated.js.map +1 -0
- package/dist/main/subgraph/meta/meta.js +20 -0
- package/dist/main/subgraph/meta/meta.js.map +1 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.d.ts +12 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getAllEvents.generated.js +1 -1
- package/dist/main/subgraph/queries/getAllEvents.generated.js.map +1 -1
- package/dist/main/subgraph/schema.generated.d.ts +817 -5
- package/dist/main/subgraph/schema.generated.d.ts.map +1 -1
- package/dist/main/subgraph/subgraphQueryHandler.d.ts +6 -3
- package/dist/main/subgraph/subgraphQueryHandler.d.ts.map +1 -1
- package/dist/main/subgraph/subgraphQueryHandler.js +30 -16
- package/dist/main/subgraph/subgraphQueryHandler.js.map +1 -1
- package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +187 -5
- package/dist/main/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/main/typechain/ISETH.d.ts +1068 -0
- package/dist/main/typechain/ISETH.d.ts.map +1 -0
- package/dist/main/typechain/ISETH.js +3 -0
- package/dist/main/typechain/ISETH.js.map +1 -0
- package/dist/main/typechain/SuperfluidGovernanceII.d.ts +617 -0
- package/dist/main/typechain/SuperfluidGovernanceII.d.ts.map +1 -0
- package/dist/main/typechain/SuperfluidGovernanceII.js +3 -0
- package/dist/main/typechain/SuperfluidGovernanceII.js.map +1 -0
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js +335 -2
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
- package/dist/main/typechain/factories/ISETH__factory.d.ts +36 -0
- package/dist/main/typechain/factories/ISETH__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/ISETH__factory.js +1622 -0
- package/dist/main/typechain/factories/ISETH__factory.js.map +1 -0
- package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts +36 -0
- package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js +939 -0
- package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
- package/dist/main/typechain/index.d.ts +4 -0
- package/dist/main/typechain/index.d.ts.map +1 -1
- package/dist/main/typechain/index.js +5 -1
- package/dist/main/typechain/index.js.map +1 -1
- package/dist/main/utils.d.ts +15 -13
- package/dist/main/utils.d.ts.map +1 -1
- package/dist/main/utils.js +29 -15
- package/dist/main/utils.js.map +1 -1
- package/dist/module/BatchCall.d.ts +6 -6
- package/dist/module/BatchCall.js +8 -8
- package/dist/module/BatchCall.js.map +1 -1
- package/dist/module/ConstantFlowAgreementV1.d.ts +106 -17
- package/dist/module/ConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/module/ConstantFlowAgreementV1.js +239 -51
- package/dist/module/ConstantFlowAgreementV1.js.map +1 -1
- package/dist/module/{Token.d.ts → ERC20Token.d.ts} +17 -14
- package/dist/module/ERC20Token.d.ts.map +1 -0
- package/dist/module/{Token.js → ERC20Token.js} +28 -32
- package/dist/module/ERC20Token.js.map +1 -0
- package/dist/module/Framework.d.ts +34 -7
- package/dist/module/Framework.d.ts.map +1 -1
- package/dist/module/Framework.js +88 -15
- package/dist/module/Framework.js.map +1 -1
- package/dist/module/Governance.d.ts +40 -0
- package/dist/module/Governance.d.ts.map +1 -0
- package/dist/module/Governance.js +76 -0
- package/dist/module/Governance.js.map +1 -0
- package/dist/module/Host.d.ts +3 -3
- package/dist/module/Host.d.ts.map +1 -1
- package/dist/module/Host.js +4 -4
- package/dist/module/Host.js.map +1 -1
- package/dist/module/InstantDistributionAgreementV1.d.ts +25 -22
- package/dist/module/InstantDistributionAgreementV1.d.ts.map +1 -1
- package/dist/module/InstantDistributionAgreementV1.js +69 -71
- package/dist/module/InstantDistributionAgreementV1.js.map +1 -1
- package/dist/module/Operation.d.ts +5 -5
- package/dist/module/Operation.js +5 -5
- package/dist/module/Query.d.ts +6 -6
- package/dist/module/Query.d.ts.map +1 -1
- package/dist/module/Query.js +16 -16
- package/dist/module/Query.js.map +1 -1
- package/dist/module/SFError.d.ts +1 -1
- package/dist/module/SFError.d.ts.map +1 -1
- package/dist/module/SFError.js +2 -0
- package/dist/module/SFError.js.map +1 -1
- package/dist/module/SuperToken.d.ts +226 -67
- package/dist/module/SuperToken.d.ts.map +1 -1
- package/dist/module/SuperToken.js +315 -133
- package/dist/module/SuperToken.js.map +1 -1
- package/dist/module/abi/IConstantFlowAgreementV1.json +335 -2
- package/dist/module/abi/ISETH.json +1604 -0
- package/dist/module/abi/SuperfluidGovernanceII.json +921 -0
- package/dist/module/constants.d.ts +4 -0
- package/dist/module/constants.d.ts.map +1 -1
- package/dist/module/constants.js +32 -12
- package/dist/module/constants.js.map +1 -1
- package/dist/module/defaultSubgraphReleaseTag.json +3 -0
- package/dist/module/events.d.ts +14 -2
- package/dist/module/events.d.ts.map +1 -1
- package/dist/module/frameworkHelpers.d.ts +2 -2
- package/dist/module/frameworkHelpers.js +2 -2
- package/dist/module/index.d.ts +16 -5
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +16 -5
- package/dist/module/index.js.map +1 -1
- package/dist/module/interfaces.d.ts +81 -8
- package/dist/module/interfaces.d.ts.map +1 -1
- package/dist/module/mapGetAllEventsQueryEvents.d.ts.map +1 -1
- package/dist/module/mapGetAllEventsQueryEvents.js +22 -1
- package/dist/module/mapGetAllEventsQueryEvents.js.map +1 -1
- package/dist/module/pagination.d.ts +42 -4
- package/dist/module/pagination.d.ts.map +1 -1
- package/dist/module/pagination.js +30 -5
- package/dist/module/pagination.js.map +1 -1
- package/dist/module/subgraph/SubgraphClient.d.ts +2 -2
- package/dist/module/subgraph/SubgraphClient.d.ts.map +1 -1
- package/dist/module/subgraph/SubgraphClient.js +1 -13
- package/dist/module/subgraph/SubgraphClient.js.map +1 -1
- package/dist/module/subgraph/entities/account/account.d.ts +1 -0
- package/dist/module/subgraph/entities/account/account.d.ts.map +1 -1
- package/dist/module/subgraph/entities/account/accounts.generated.d.ts +2 -0
- package/dist/module/subgraph/entities/account/accounts.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/account/accounts.generated.js +1 -1
- package/dist/module/subgraph/entities/account/accounts.generated.js.map +1 -1
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts +2 -0
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts.map +1 -1
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js +1 -0
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js.map +1 -1
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts +3 -0
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js +1 -1
- package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js.map +1 -1
- package/dist/module/subgraph/entities/index/index.d.ts +2 -0
- package/dist/module/subgraph/entities/index/index.d.ts.map +1 -1
- package/dist/module/subgraph/entities/index/index.js +1 -0
- package/dist/module/subgraph/entities/index/index.js.map +1 -1
- package/dist/module/subgraph/entities/index/indexes.generated.d.ts +3 -0
- package/dist/module/subgraph/entities/index/indexes.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/index/indexes.generated.js +1 -1
- package/dist/module/subgraph/entities/index/indexes.generated.js.map +1 -1
- package/dist/module/subgraph/entities/indexSubscription/indexSubscription.d.ts +2 -0
- package/dist/module/subgraph/entities/indexSubscription/indexSubscription.d.ts.map +1 -1
- package/dist/module/subgraph/entities/indexSubscription/indexSubscription.js +1 -0
- package/dist/module/subgraph/entities/indexSubscription/indexSubscription.js.map +1 -1
- package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts +3 -0
- package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.js +1 -1
- package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.js.map +1 -1
- package/dist/module/subgraph/entities/stream/stream.d.ts +2 -0
- package/dist/module/subgraph/entities/stream/stream.d.ts.map +1 -1
- package/dist/module/subgraph/entities/stream/stream.js +1 -0
- package/dist/module/subgraph/entities/stream/stream.js.map +1 -1
- package/dist/module/subgraph/entities/stream/streams.generated.d.ts +3 -0
- package/dist/module/subgraph/entities/stream/streams.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/stream/streams.generated.js +1 -1
- package/dist/module/subgraph/entities/stream/streams.generated.js.map +1 -1
- package/dist/module/subgraph/entities/streamPeriod/streamPeriod.d.ts +2 -0
- package/dist/module/subgraph/entities/streamPeriod/streamPeriod.d.ts.map +1 -1
- package/dist/module/subgraph/entities/streamPeriod/streamPeriod.js +1 -0
- package/dist/module/subgraph/entities/streamPeriod/streamPeriod.js.map +1 -1
- package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts +3 -0
- package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.js +1 -1
- package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.js.map +1 -1
- package/dist/module/subgraph/entities/token/token.d.ts +1 -0
- package/dist/module/subgraph/entities/token/token.d.ts.map +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.d.ts +2 -0
- package/dist/module/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.js +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.js.map +1 -1
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistic.d.ts +1 -0
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistic.d.ts.map +1 -1
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts +2 -0
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.js +1 -1
- package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.js.map +1 -1
- package/dist/module/subgraph/events/events.d.ts +1 -0
- package/dist/module/subgraph/events/events.d.ts.map +1 -1
- package/dist/module/subgraph/events/events.generated.d.ts +118 -3
- package/dist/module/subgraph/events/events.generated.d.ts.map +1 -1
- package/dist/module/subgraph/events/events.generated.js +37 -36
- package/dist/module/subgraph/events/events.generated.js.map +1 -1
- package/dist/module/subgraph/events/flowUpdatedEvent.d.ts +1 -0
- package/dist/module/subgraph/events/flowUpdatedEvent.d.ts.map +1 -1
- package/dist/module/subgraph/events/indexUpdatedEvent.d.ts +1 -0
- package/dist/module/subgraph/events/indexUpdatedEvent.d.ts.map +1 -1
- package/dist/module/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts +1 -0
- package/dist/module/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts.map +1 -1
- package/dist/module/subgraph/meta/meta.d.ts +15 -0
- package/dist/module/subgraph/meta/meta.d.ts.map +1 -0
- package/dist/module/subgraph/meta/meta.generated.d.ts +19 -0
- package/dist/module/subgraph/meta/meta.generated.d.ts.map +1 -0
- package/dist/module/subgraph/meta/meta.generated.js +2 -0
- package/dist/module/subgraph/meta/meta.generated.js.map +1 -0
- package/dist/module/subgraph/meta/meta.js +16 -0
- package/dist/module/subgraph/meta/meta.js.map +1 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.d.ts +12 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getAllEvents.generated.js +1 -1
- package/dist/module/subgraph/queries/getAllEvents.generated.js.map +1 -1
- package/dist/module/subgraph/schema.generated.d.ts +817 -5
- package/dist/module/subgraph/schema.generated.d.ts.map +1 -1
- package/dist/module/subgraph/subgraphQueryHandler.d.ts +6 -3
- package/dist/module/subgraph/subgraphQueryHandler.d.ts.map +1 -1
- package/dist/module/subgraph/subgraphQueryHandler.js +31 -17
- package/dist/module/subgraph/subgraphQueryHandler.js.map +1 -1
- package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +187 -5
- package/dist/module/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/module/typechain/ISETH.d.ts +1068 -0
- package/dist/module/typechain/ISETH.d.ts.map +1 -0
- package/dist/module/typechain/ISETH.js +2 -0
- package/dist/module/typechain/ISETH.js.map +1 -0
- package/dist/module/typechain/SuperfluidGovernanceII.d.ts +617 -0
- package/dist/module/typechain/SuperfluidGovernanceII.d.ts.map +1 -0
- package/dist/module/typechain/SuperfluidGovernanceII.js +2 -0
- package/dist/module/typechain/SuperfluidGovernanceII.js.map +1 -0
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js +335 -2
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
- package/dist/module/typechain/factories/ISETH__factory.d.ts +36 -0
- package/dist/module/typechain/factories/ISETH__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/ISETH__factory.js +1618 -0
- package/dist/module/typechain/factories/ISETH__factory.js.map +1 -0
- package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts +36 -0
- package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js +935 -0
- package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
- package/dist/module/typechain/index.d.ts +4 -0
- package/dist/module/typechain/index.d.ts.map +1 -1
- package/dist/module/typechain/index.js +2 -0
- package/dist/module/typechain/index.js.map +1 -1
- package/dist/module/utils.d.ts +15 -13
- package/dist/module/utils.d.ts.map +1 -1
- package/dist/module/utils.js +27 -15
- package/dist/module/utils.js.map +1 -1
- package/package.json +11 -41
- package/dist/main/Token.d.ts.map +0 -1
- package/dist/main/Token.js.map +0 -1
- package/dist/module/Token.d.ts.map +0 -1
- package/dist/module/Token.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
2
|
import Operation from "./Operation";
|
|
3
3
|
import { IBaseSuperTokenParams, ITransferFromParams } from "./interfaces";
|
|
4
|
-
|
|
4
|
+
import { ERC20WithTokenInfo } from "./typechain/ERC20WithTokenInfo";
|
|
5
|
+
export default class ERC20Token {
|
|
5
6
|
readonly address: string;
|
|
7
|
+
readonly contract: ERC20WithTokenInfo;
|
|
6
8
|
constructor(address: string);
|
|
7
|
-
|
|
9
|
+
/** ### ERC20 Token Contract Read Functions ### */
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* Returns the allowance the `owner` has granted the `spender`.
|
|
10
12
|
* @param owner the owner who has allotted the allowance
|
|
11
13
|
* @param spender the spender who has received the allowance
|
|
12
14
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
@@ -18,7 +20,7 @@ export default class Token {
|
|
|
18
20
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
19
21
|
}) => Promise<string>;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
|
|
22
24
|
* @param account the account you would like to query
|
|
23
25
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
24
26
|
* @returns {Promise<string>} the token balance of `account`
|
|
@@ -28,7 +30,7 @@ export default class Token {
|
|
|
28
30
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
29
31
|
}) => Promise<string>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Returns the token name
|
|
32
34
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
33
35
|
* @returns {string} the token name
|
|
34
36
|
*/
|
|
@@ -36,7 +38,7 @@ export default class Token {
|
|
|
36
38
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
37
39
|
}) => Promise<string>;
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
41
|
+
* Returns the token symbol
|
|
40
42
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
41
43
|
* @returns {string} the token symbol
|
|
42
44
|
*/
|
|
@@ -44,37 +46,38 @@ export default class Token {
|
|
|
44
46
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
45
47
|
}) => Promise<string>;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
49
|
+
* Returns the total supply of the token.
|
|
48
50
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
49
51
|
* @returns {Promise<string>} the total supply of the token
|
|
50
52
|
*/
|
|
51
53
|
totalSupply: ({ providerOrSigner, }: {
|
|
52
54
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
53
55
|
}) => Promise<string>;
|
|
56
|
+
/** ### ERC20 Token Contract Write Functions ### */
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
58
|
+
* Approve `receiver` to spend `amount` tokens.
|
|
56
59
|
* @param receiver The receiver approved.
|
|
57
60
|
* @param amount The amount approved.
|
|
58
61
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
59
62
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
60
63
|
*/
|
|
61
|
-
approve: (
|
|
64
|
+
approve: (params: IBaseSuperTokenParams) => Operation;
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
66
|
+
* Transfer `receiver` `amount` tokens.
|
|
64
67
|
* @param receiver The receiver of the transfer.
|
|
65
68
|
* @param amount The amount to be transferred.
|
|
66
69
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
67
70
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
68
71
|
*/
|
|
69
|
-
transfer: (
|
|
72
|
+
transfer: (params: IBaseSuperTokenParams) => Operation;
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Transfer from `sender` to `receiver` `amount` tokens.
|
|
72
75
|
* @param sender The sender of the transfer.
|
|
73
76
|
* @param receiver The receiver of the transfer.
|
|
74
77
|
* @param amount The amount to be transferred.
|
|
75
78
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
76
79
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
77
80
|
*/
|
|
78
|
-
transferFrom: (
|
|
81
|
+
transferFrom: (params: ITransferFromParams) => Operation;
|
|
79
82
|
}
|
|
80
|
-
//# sourceMappingURL=
|
|
83
|
+
//# sourceMappingURL=ERC20Token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20Token.d.ts","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MA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|
|
4
4
|
import ERC20WithTokenInfoABI from "./abi/ERC20WithTokenInfo.json";
|
|
5
5
|
import { normalizeAddress } from "./utils";
|
|
6
|
-
export default class
|
|
6
|
+
export default class ERC20Token {
|
|
7
7
|
constructor(address) {
|
|
8
|
-
|
|
8
|
+
/** ### ERC20 Token Contract Read Functions ### */
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Returns the allowance the `owner` has granted the `spender`.
|
|
11
11
|
* @param owner the owner who has allotted the allowance
|
|
12
12
|
* @param spender the spender who has received the allowance
|
|
13
13
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
@@ -17,7 +17,7 @@ export default class Token {
|
|
|
17
17
|
const normalizedOwner = normalizeAddress(owner);
|
|
18
18
|
const normalizedSpender = normalizeAddress(spender);
|
|
19
19
|
try {
|
|
20
|
-
const allowance = await this.
|
|
20
|
+
const allowance = await this.contract
|
|
21
21
|
.connect(providerOrSigner)
|
|
22
22
|
.allowance(normalizedOwner, normalizedSpender);
|
|
23
23
|
return allowance.toString();
|
|
@@ -31,7 +31,7 @@ export default class Token {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
|
|
35
35
|
* @param account the account you would like to query
|
|
36
36
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
37
37
|
* @returns {Promise<string>} the token balance of `account`
|
|
@@ -39,7 +39,7 @@ export default class Token {
|
|
|
39
39
|
this.balanceOf = async ({ account, providerOrSigner, }) => {
|
|
40
40
|
try {
|
|
41
41
|
const normalizedAccount = normalizeAddress(account);
|
|
42
|
-
const balanceOf = await this.
|
|
42
|
+
const balanceOf = await this.contract
|
|
43
43
|
.connect(providerOrSigner)
|
|
44
44
|
.balanceOf(normalizedAccount);
|
|
45
45
|
return balanceOf.toString();
|
|
@@ -53,15 +53,13 @@ export default class Token {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Returns the token name
|
|
57
57
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
58
58
|
* @returns {string} the token name
|
|
59
59
|
*/
|
|
60
60
|
this.name = async ({ providerOrSigner, }) => {
|
|
61
61
|
try {
|
|
62
|
-
const name = await this.
|
|
63
|
-
.connect(providerOrSigner)
|
|
64
|
-
.name();
|
|
62
|
+
const name = await this.contract.connect(providerOrSigner).name();
|
|
65
63
|
return name;
|
|
66
64
|
}
|
|
67
65
|
catch (err) {
|
|
@@ -73,13 +71,13 @@ export default class Token {
|
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
73
|
/**
|
|
76
|
-
*
|
|
74
|
+
* Returns the token symbol
|
|
77
75
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
78
76
|
* @returns {string} the token symbol
|
|
79
77
|
*/
|
|
80
78
|
this.symbol = async ({ providerOrSigner, }) => {
|
|
81
79
|
try {
|
|
82
|
-
const symbol = await this.
|
|
80
|
+
const symbol = await this.contract
|
|
83
81
|
.connect(providerOrSigner)
|
|
84
82
|
.symbol();
|
|
85
83
|
return symbol;
|
|
@@ -93,13 +91,13 @@ export default class Token {
|
|
|
93
91
|
}
|
|
94
92
|
};
|
|
95
93
|
/**
|
|
96
|
-
*
|
|
94
|
+
* Returns the total supply of the token.
|
|
97
95
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
98
96
|
* @returns {Promise<string>} the total supply of the token
|
|
99
97
|
*/
|
|
100
98
|
this.totalSupply = async ({ providerOrSigner, }) => {
|
|
101
99
|
try {
|
|
102
|
-
const totalSupply = await this.
|
|
100
|
+
const totalSupply = await this.contract
|
|
103
101
|
.connect(providerOrSigner)
|
|
104
102
|
.totalSupply();
|
|
105
103
|
return totalSupply.toString();
|
|
@@ -112,49 +110,47 @@ export default class Token {
|
|
|
112
110
|
});
|
|
113
111
|
}
|
|
114
112
|
};
|
|
115
|
-
|
|
113
|
+
/** ### ERC20 Token Contract Write Functions ### */
|
|
116
114
|
/**
|
|
117
|
-
*
|
|
115
|
+
* Approve `receiver` to spend `amount` tokens.
|
|
118
116
|
* @param receiver The receiver approved.
|
|
119
117
|
* @param amount The amount approved.
|
|
120
118
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
121
119
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
122
120
|
*/
|
|
123
|
-
this.approve = (
|
|
124
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
125
|
-
const txn = this.
|
|
121
|
+
this.approve = (params) => {
|
|
122
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
123
|
+
const txn = this.contract.populateTransaction.approve(normalizedReceiver, params.amount, params.overrides || {});
|
|
126
124
|
return new Operation(txn, "ERC20_APPROVE");
|
|
127
125
|
};
|
|
128
126
|
/**
|
|
129
|
-
*
|
|
127
|
+
* Transfer `receiver` `amount` tokens.
|
|
130
128
|
* @param receiver The receiver of the transfer.
|
|
131
129
|
* @param amount The amount to be transferred.
|
|
132
130
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
133
131
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
134
132
|
*/
|
|
135
|
-
this.transfer = (
|
|
136
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
137
|
-
const txn = this.
|
|
133
|
+
this.transfer = (params) => {
|
|
134
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
135
|
+
const txn = this.contract.populateTransaction.transfer(normalizedReceiver, params.amount, params.overrides || {});
|
|
138
136
|
return new Operation(txn, "UNSUPPORTED");
|
|
139
137
|
};
|
|
140
138
|
/**
|
|
141
|
-
*
|
|
139
|
+
* Transfer from `sender` to `receiver` `amount` tokens.
|
|
142
140
|
* @param sender The sender of the transfer.
|
|
143
141
|
* @param receiver The receiver of the transfer.
|
|
144
142
|
* @param amount The amount to be transferred.
|
|
145
143
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
146
144
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
147
145
|
*/
|
|
148
|
-
this.transferFrom = (
|
|
149
|
-
const normalizedSender = normalizeAddress(sender);
|
|
150
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
151
|
-
const txn = this.
|
|
146
|
+
this.transferFrom = (params) => {
|
|
147
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
148
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
149
|
+
const txn = this.contract.populateTransaction.transferFrom(normalizedSender, normalizedReceiver, params.amount, params.overrides || {});
|
|
152
150
|
return new Operation(txn, "ERC20_TRANSFER_FROM");
|
|
153
151
|
};
|
|
154
152
|
this.address = address;
|
|
155
|
-
|
|
156
|
-
get tokenContract() {
|
|
157
|
-
return new ethers.Contract(this.address, ERC20WithTokenInfoABI.abi);
|
|
153
|
+
this.contract = new ethers.Contract(this.address, ERC20WithTokenInfoABI.abi);
|
|
158
154
|
}
|
|
159
155
|
}
|
|
160
|
-
//# sourceMappingURL=
|
|
156
|
+
//# sourceMappingURL=ERC20Token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20Token.js","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,YAAY,OAAe;QAQ3B,kDAAkD;QAElD;;;;;;WAMG;QACH,cAAS,GAAG,KAAK,EAAE,EACf,KAAK,EACL,OAAO,EACP,gBAAgB,GAKnB,EAAmB,EAAE;YAClB,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAChD,MAAM,iBAAi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1";
|
|
7
|
+
import Governance from "./Governance";
|
|
7
8
|
import Host from "./Host";
|
|
8
9
|
import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
|
|
9
10
|
import Operation from "./Operation";
|
|
10
11
|
import Query from "./Query";
|
|
11
|
-
import SuperToken from "./SuperToken";
|
|
12
|
-
import { IConfig, ISignerConstructorOptions } from "./interfaces";
|
|
12
|
+
import SuperToken, { NativeAssetSuperToken, PureSuperToken, WrapperSuperToken } from "./SuperToken";
|
|
13
|
+
import { IConfig, IContracts, ISignerConstructorOptions } from "./interfaces";
|
|
13
14
|
import { DataMode } from "./types";
|
|
14
15
|
declare type SupportedProvider = ethers.providers.Provider | (typeof ethers & HardhatEthersHelpers) | Web3;
|
|
15
16
|
export interface IFrameworkOptions {
|
|
@@ -31,19 +32,21 @@ export interface IFrameworkSettings {
|
|
|
31
32
|
config: IConfig;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Superfluid Framework Class
|
|
35
36
|
* @description The entrypoint for the SDK-core, `create` an instance of this for full functionality.
|
|
36
37
|
*/
|
|
37
38
|
export default class Framework {
|
|
38
39
|
readonly userInputOptions: IFrameworkOptions;
|
|
39
40
|
settings: IFrameworkSettings;
|
|
41
|
+
contracts: IContracts;
|
|
40
42
|
cfaV1: ConstantFlowAgreementV1;
|
|
43
|
+
governance: Governance;
|
|
41
44
|
host: Host;
|
|
42
45
|
idaV1: InstantDistributionAgreementV1;
|
|
43
46
|
query: Query;
|
|
44
47
|
private constructor();
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Creates the Framework object based on user provided `options`.
|
|
47
50
|
* @param options.chainId the chainId of your desired network (e.g. 137 = matic)
|
|
48
51
|
* @param options.customSubgraphQueriesEndpoint your custom subgraph endpoint
|
|
49
52
|
* @param options.dataMode the data mode you'd like the framework to use (SUBGRAPH_ONLY, SUBGRAPH_WEB3, WEB3_ONLY)
|
|
@@ -55,7 +58,7 @@ export default class Framework {
|
|
|
55
58
|
*/
|
|
56
59
|
static create: (options: IFrameworkOptions) => Promise<Framework>;
|
|
57
60
|
/**
|
|
58
|
-
*
|
|
61
|
+
* Create a signer which can be used to sign transactions.
|
|
59
62
|
* @param options.web3Provider a Web3Provider object (e.g. client side - metamask, web3modal)
|
|
60
63
|
* @param options.provider an ethers Provider object (e.g. via Hardhat ethers)
|
|
61
64
|
* @param options.privateKey a test account private key
|
|
@@ -64,17 +67,41 @@ export default class Framework {
|
|
|
64
67
|
*/
|
|
65
68
|
createSigner: (options: ISignerConstructorOptions) => Signer;
|
|
66
69
|
/**
|
|
67
|
-
*
|
|
70
|
+
* Create a `BatchCall` class from the `Framework`.
|
|
68
71
|
* @param operations the list of operations to execute
|
|
69
72
|
* @returns `BatchCall` class
|
|
70
73
|
*/
|
|
71
74
|
batchCall: (operations: Operation[]) => BatchCall;
|
|
72
75
|
/**
|
|
73
|
-
*
|
|
76
|
+
* Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
|
|
77
|
+
* @param tokenAddressOrSymbol
|
|
78
|
+
* @returns `NativeAssetSuperToken` class
|
|
79
|
+
*/
|
|
80
|
+
loadNativeAssetSuperToken: (tokenAddressOrSymbol: string) => Promise<NativeAssetSuperToken>;
|
|
81
|
+
/**
|
|
82
|
+
* Loads `PureSuperToken` class from the `Framework`. Will throw if token is not PureSuperToken.
|
|
83
|
+
* @param tokenAddressOrSymbol
|
|
84
|
+
* @returns `PureSuperToken` class
|
|
85
|
+
*/
|
|
86
|
+
loadPureSuperToken: (tokenAddressOrSymbol: string) => Promise<PureSuperToken>;
|
|
87
|
+
/**
|
|
88
|
+
* Loads `WrapperSuperToken` class from the `Framework`. Will throw if token is not WrapperSuperToken.
|
|
89
|
+
* @param tokenAddressOrSymbol
|
|
90
|
+
* @returns `WrapperSuperToken` class
|
|
91
|
+
*/
|
|
92
|
+
loadWrapperSuperToken: (tokenAddressOrSymbol: string) => Promise<WrapperSuperToken>;
|
|
93
|
+
/**
|
|
94
|
+
* Loads `SuperToken` class from the `Framework`. Use this when you're unsure of the token type.
|
|
74
95
|
* @param tokenAddressOrSymbol the `SuperToken` address or symbol (if symbol, it must be on the resolver)
|
|
75
96
|
* @returns `SuperToken` class
|
|
76
97
|
*/
|
|
77
98
|
loadSuperToken: (tokenAddressOrSymbol: string) => Promise<SuperToken>;
|
|
99
|
+
/**
|
|
100
|
+
* Try to get the token address given an address (returns if valid) or the token symbol via the resolver.
|
|
101
|
+
* @param tokenAddressOrSymbol
|
|
102
|
+
* @returns token address
|
|
103
|
+
*/
|
|
104
|
+
private _tryGetTokenAddress;
|
|
78
105
|
}
|
|
79
106
|
export {};
|
|
80
107
|
//# sourceMappingURL=Framework.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Framework.d.ts","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,UAAU,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Framework.d.ts","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM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;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAC7C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,UAAU,CAAC;IAEtB,KAAK,EAAE,uBAAuB,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,8BAA8B,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;IAEb,OAAO;IAiCP;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,YAAmB,iBAAiB,wBAwG/C;IAEF;;;;;;;OAOG;IACH,YAAY,YAAa,yBAAyB,KAAG,MAAM,CAqCzD;IAEF;;;;OAIG;IACH,SAAS,eAAgB,SAAS,EAAE,eAKlC;IAEF;;;;OAIG;IACH,yBAAyB,yBACC,MAAM,KAC7B,QAAQ,qBAAqB,CAAC,CAa/B;IAEF;;;;OAIG;IACH,kBAAkB,yBACQ,MAAM,KAC7B,QAAQ,cAAc,CAAC,CAaxB;IAEF;;;;OAIG;IACH,qBAAqB,yBACK,MAAM,KAC7B,QAAQ,iBAAiB,CAAC,CAY3B;IAEF;;;;OAIG;IACH,cAAc,yBACY,MAAM,KAC7B,QAAQ,UAAU,CAAC,CAMpB;IAEF;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAiCzB;CACL"}
|
package/dist/module/Framework.js
CHANGED
|
@@ -2,6 +2,7 @@ var _a;
|
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
3
|
import BatchCall from "./BatchCall";
|
|
4
4
|
import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
|
|
5
|
+
import Governance from "./Governance";
|
|
5
6
|
import Host from "./Host";
|
|
6
7
|
import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
|
|
7
8
|
import Query from "./Query";
|
|
@@ -13,13 +14,13 @@ import { chainIdToResolverDataMap, networkNameToChainIdMap } from "./constants";
|
|
|
13
14
|
import { getNetworkName, getSubgraphQueriesEndpoint, validateFrameworkConstructorOptions, } from "./frameworkHelpers";
|
|
14
15
|
import { isEthersProvider, isInjectedWeb3 } from "./utils";
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Superfluid Framework Class
|
|
17
18
|
* @description The entrypoint for the SDK-core, `create` an instance of this for full functionality.
|
|
18
19
|
*/
|
|
19
20
|
export default class Framework {
|
|
20
21
|
constructor(options, settings) {
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* Create a signer which can be used to sign transactions.
|
|
23
24
|
* @param options.web3Provider a Web3Provider object (e.g. client side - metamask, web3modal)
|
|
24
25
|
* @param options.provider an ethers Provider object (e.g. via Hardhat ethers)
|
|
25
26
|
* @param options.privateKey a test account private key
|
|
@@ -60,7 +61,7 @@ export default class Framework {
|
|
|
60
61
|
});
|
|
61
62
|
};
|
|
62
63
|
/**
|
|
63
|
-
*
|
|
64
|
+
* Create a `BatchCall` class from the `Framework`.
|
|
64
65
|
* @param operations the list of operations to execute
|
|
65
66
|
* @returns `BatchCall` class
|
|
66
67
|
*/
|
|
@@ -71,15 +72,78 @@ export default class Framework {
|
|
|
71
72
|
});
|
|
72
73
|
};
|
|
73
74
|
/**
|
|
74
|
-
*
|
|
75
|
+
* Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
|
|
76
|
+
* @param tokenAddressOrSymbol
|
|
77
|
+
* @returns `NativeAssetSuperToken` class
|
|
78
|
+
*/
|
|
79
|
+
this.loadNativeAssetSuperToken = async (tokenAddressOrSymbol) => {
|
|
80
|
+
const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
|
|
81
|
+
// The NativeAssetSuperToken class should have the nativeTokenSymbol property
|
|
82
|
+
const isNativeAssetSuperToken = !!superToken.nativeTokenSymbol;
|
|
83
|
+
if (!isNativeAssetSuperToken) {
|
|
84
|
+
throw new SFError({
|
|
85
|
+
type: "SUPERTOKEN_INITIALIZATION",
|
|
86
|
+
customMessage: "The token is not a native asset supertoken.",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return superToken;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Loads `PureSuperToken` class from the `Framework`. Will throw if token is not PureSuperToken.
|
|
93
|
+
* @param tokenAddressOrSymbol
|
|
94
|
+
* @returns `PureSuperToken` class
|
|
95
|
+
*/
|
|
96
|
+
this.loadPureSuperToken = async (tokenAddressOrSymbol) => {
|
|
97
|
+
const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
|
|
98
|
+
// The PureSuperToken class should not have the downgrade (and upgrade) function
|
|
99
|
+
// we can just check if downgrade doesn't exist
|
|
100
|
+
const isPureSuperToken = !!superToken.downgrade === false;
|
|
101
|
+
if (!isPureSuperToken) {
|
|
102
|
+
throw new SFError({
|
|
103
|
+
type: "SUPERTOKEN_INITIALIZATION",
|
|
104
|
+
customMessage: "The token is not a pure supertoken.",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return superToken;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Loads `WrapperSuperToken` class from the `Framework`. Will throw if token is not WrapperSuperToken.
|
|
111
|
+
* @param tokenAddressOrSymbol
|
|
112
|
+
* @returns `WrapperSuperToken` class
|
|
113
|
+
*/
|
|
114
|
+
this.loadWrapperSuperToken = async (tokenAddressOrSymbol) => {
|
|
115
|
+
const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
|
|
116
|
+
// The WrapperSuperToken class should have the underlyingToken property
|
|
117
|
+
const isWrapperSuperToken = !!superToken.underlyingToken;
|
|
118
|
+
if (!isWrapperSuperToken) {
|
|
119
|
+
throw new SFError({
|
|
120
|
+
type: "SUPERTOKEN_INITIALIZATION",
|
|
121
|
+
customMessage: "The token is not a wrapper supertoken.",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return superToken;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Loads `SuperToken` class from the `Framework`. Use this when you're unsure of the token type.
|
|
75
128
|
* @param tokenAddressOrSymbol the `SuperToken` address or symbol (if symbol, it must be on the resolver)
|
|
76
129
|
* @returns `SuperToken` class
|
|
77
130
|
*/
|
|
78
131
|
this.loadSuperToken = async (tokenAddressOrSymbol) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
address
|
|
132
|
+
const address = await this._tryGetTokenAddress(tokenAddressOrSymbol);
|
|
133
|
+
return await SuperToken.create({
|
|
134
|
+
...this.settings,
|
|
135
|
+
address,
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Try to get the token address given an address (returns if valid) or the token symbol via the resolver.
|
|
140
|
+
* @param tokenAddressOrSymbol
|
|
141
|
+
* @returns token address
|
|
142
|
+
*/
|
|
143
|
+
this._tryGetTokenAddress = async (tokenAddressOrSymbol) => {
|
|
144
|
+
const isInputValidAddress = ethers.utils.isAddress(tokenAddressOrSymbol);
|
|
145
|
+
if (isInputValidAddress) {
|
|
146
|
+
return tokenAddressOrSymbol;
|
|
83
147
|
}
|
|
84
148
|
else {
|
|
85
149
|
try {
|
|
@@ -88,8 +152,7 @@ export default class Framework {
|
|
|
88
152
|
"." +
|
|
89
153
|
tokenAddressOrSymbol;
|
|
90
154
|
const resolver = new ethers.Contract(this.settings.config.resolverAddress, IResolverABI.abi, this.settings.provider);
|
|
91
|
-
|
|
92
|
-
address = tokenAddress;
|
|
155
|
+
return await resolver.get(superTokenKey);
|
|
93
156
|
}
|
|
94
157
|
catch (err) {
|
|
95
158
|
throw new SFError({
|
|
@@ -101,26 +164,31 @@ export default class Framework {
|
|
|
101
164
|
});
|
|
102
165
|
}
|
|
103
166
|
}
|
|
104
|
-
return await SuperToken.create({
|
|
105
|
-
...this.settings,
|
|
106
|
-
address,
|
|
107
|
-
});
|
|
108
167
|
};
|
|
109
168
|
this.userInputOptions = options;
|
|
110
169
|
this.settings = settings;
|
|
111
170
|
this.cfaV1 = new ConstantFlowAgreementV1({
|
|
112
171
|
config: this.settings.config,
|
|
113
172
|
});
|
|
173
|
+
this.governance = new Governance(this.settings.config.governanceAddress, this.settings.config.hostAddress);
|
|
114
174
|
this.host = new Host(this.settings.config.hostAddress);
|
|
115
175
|
this.idaV1 = new InstantDistributionAgreementV1({
|
|
116
176
|
config: this.settings.config,
|
|
117
177
|
});
|
|
118
178
|
this.query = new Query(this.settings);
|
|
179
|
+
const resolver = new ethers.Contract(this.settings.config.resolverAddress, IResolverABI.abi);
|
|
180
|
+
this.contracts = {
|
|
181
|
+
cfaV1: this.cfaV1.contract,
|
|
182
|
+
governance: this.governance.contract,
|
|
183
|
+
host: this.host.contract,
|
|
184
|
+
idaV1: this.idaV1.contract,
|
|
185
|
+
resolver,
|
|
186
|
+
};
|
|
119
187
|
}
|
|
120
188
|
}
|
|
121
189
|
_a = Framework;
|
|
122
190
|
/**
|
|
123
|
-
*
|
|
191
|
+
* Creates the Framework object based on user provided `options`.
|
|
124
192
|
* @param options.chainId the chainId of your desired network (e.g. 137 = matic)
|
|
125
193
|
* @param options.customSubgraphQueriesEndpoint your custom subgraph endpoint
|
|
126
194
|
* @param options.dataMode the data mode you'd like the framework to use (SUBGRAPH_ONLY, SUBGRAPH_WEB3, WEB3_ONLY)
|
|
@@ -167,6 +235,7 @@ Framework.create = async (options) => {
|
|
|
167
235
|
subgraphAPIEndpoint: "",
|
|
168
236
|
resolverAddress: "",
|
|
169
237
|
networkName: "",
|
|
238
|
+
nativeTokenSymbol: "",
|
|
170
239
|
};
|
|
171
240
|
const resolverAddress = options.resolverAddress
|
|
172
241
|
? options.resolverAddress
|
|
@@ -175,6 +244,9 @@ Framework.create = async (options) => {
|
|
|
175
244
|
const superfluidLoaderAddress = await resolver.get("SuperfluidLoader-v1");
|
|
176
245
|
const superfluidLoader = new ethers.Contract(superfluidLoaderAddress, SuperfluidLoaderABI.abi, provider);
|
|
177
246
|
const framework = await superfluidLoader.loadFramework(releaseVersion);
|
|
247
|
+
const governanceAddress = await new Host(framework.superfluid).contract
|
|
248
|
+
.connect(provider)
|
|
249
|
+
.getGovernance();
|
|
178
250
|
const settings = {
|
|
179
251
|
chainId,
|
|
180
252
|
customSubgraphQueriesEndpoint,
|
|
@@ -187,6 +259,7 @@ Framework.create = async (options) => {
|
|
|
187
259
|
hostAddress: framework.superfluid,
|
|
188
260
|
cfaV1Address: framework.agreementCFAv1,
|
|
189
261
|
idaV1Address: framework.agreementIDAv1,
|
|
262
|
+
governanceAddress,
|
|
190
263
|
},
|
|
191
264
|
};
|
|
192
265
|
return new Framework(options, settings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,UAIN,MAAM,cAAc,CAAC;AACtB,OAAO,YAAY,MAAM,sBAA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IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,OAAO,CAAC;YACd,IAAI,EAAE,0BAA0B;YAChC,aAAa,EAAE,+CAA+C;YAC9D,WAAW,EAAE,GAAG;SACnB,CAAC,CAAC;KACN;AACL,CAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IGetGovernanceParametersParams, IWeb3GovernanceParams } from "./interfaces";
|
|
2
|
+
import { SuperfluidGovernanceII } from "./typechain/SuperfluidGovernanceII";
|
|
3
|
+
export default class Governance {
|
|
4
|
+
contract: SuperfluidGovernanceII;
|
|
5
|
+
hostAddress: string;
|
|
6
|
+
constructor(govAddress: string, hostAddress: string);
|
|
7
|
+
/**
|
|
8
|
+
* Returns the 3Ps config for the specified token (or default) - the liquidation period and patrician period
|
|
9
|
+
* @see https://docs.superfluid.finance/superfluid/sentinels/liquidations-and-toga
|
|
10
|
+
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
11
|
+
* @param token specified governance parameter token
|
|
12
|
+
* @returns {Object} liquidationPeriod and patricianPeriod as strings
|
|
13
|
+
*/
|
|
14
|
+
getPPPConfig: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<{
|
|
15
|
+
liquidationPeriod: string;
|
|
16
|
+
patricianPeriod: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the reward address for the specified token (or default)
|
|
20
|
+
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
21
|
+
* @param token specified governance parameter token
|
|
22
|
+
* @returns {string} the reward address
|
|
23
|
+
*/
|
|
24
|
+
getRewardAddress: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the minimum deposit for the specified token (or default)
|
|
27
|
+
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
28
|
+
* @param token specified governance parameter token
|
|
29
|
+
* @returns {string} minimum deposit
|
|
30
|
+
*/
|
|
31
|
+
getMinimumDeposit: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the relevant governance parameters
|
|
34
|
+
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
35
|
+
* @param token specified governance parameter token
|
|
36
|
+
* @returns {Object} liquidationPeriod, patricianPeriod, rewardAddress and minimumDeposit
|
|
37
|
+
*/
|
|
38
|
+
getGovernanceParameters: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<IWeb3GovernanceParams>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=Governance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Governance.d.ts","sourceRoot":"","sources":["../../src/Governance.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;gBAER,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAQnD;;;;;;OAMG;IACH,YAAY,iCAGT,8BAA8B;;;OAQ/B;IAEF;;;;;OAKG;IACH,gBAAgB,iCAGb,8BAA8B,qBAI/B;IAEF;;;;;OAKG;IACH,iBAAiB,iCAGd,8BAA8B,qBAK/B;IAEF;;;;;OAKG;IACH,uBAAuB,iCAGpB,8BAA8B,KAAG,QAAQ,qBAAqB,CAAC,CAqBhE;CACL"}
|