@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,25 +1,28 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
3
|
import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
|
|
4
|
+
import ERC20Token from "./ERC20Token";
|
|
5
|
+
import Governance from "./Governance";
|
|
4
6
|
import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
|
|
5
7
|
import Operation from "./Operation";
|
|
6
8
|
import { SFError } from "./SFError";
|
|
7
|
-
import
|
|
9
|
+
import ISETHABI from "./abi/ISETH.json";
|
|
8
10
|
import SuperTokenABI from "./abi/SuperToken.json";
|
|
9
|
-
import { networkNameToChainIdMap } from "./constants";
|
|
11
|
+
import { chainIdToResolverDataMap, networkNameToChainIdMap } from "./constants";
|
|
10
12
|
import { getNetworkName } from "./frameworkHelpers";
|
|
11
13
|
import { getSanitizedTimestamp, getStringCurrentTimeInSeconds, normalizeAddress, } from "./utils";
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* SuperToken Helper Class
|
|
14
16
|
* @description A helper class to create `SuperToken` objects which can interact with the `SuperToken` contract as well as the CFAV1 and IDAV1 contracts of the desired `SuperToken`.
|
|
17
|
+
* @see https://www.notion.so/superfluidhq/Classification-of-Super-Tokens-5beace780b5c4d09a5752a3677da3dc0 for further details on naming classification and underlying implementation.
|
|
15
18
|
*/
|
|
16
|
-
export default class SuperToken extends
|
|
19
|
+
export default class SuperToken extends ERC20Token {
|
|
17
20
|
constructor(options, settings) {
|
|
18
21
|
// initialize ERC20 token functions here
|
|
19
22
|
super(settings.address);
|
|
20
|
-
|
|
23
|
+
/** ### SuperToken Contract Read Functions ### */
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Returns the real time balance of `address`.
|
|
23
26
|
* @param account the target address
|
|
24
27
|
* @param timestamp the timestamp you'd like to see the data
|
|
25
28
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
@@ -28,7 +31,7 @@ export default class SuperToken extends Token {
|
|
|
28
31
|
this.realtimeBalanceOf = async ({ providerOrSigner, account, timestamp = getStringCurrentTimeInSeconds(), }) => {
|
|
29
32
|
const normalizedAccount = normalizeAddress(account);
|
|
30
33
|
try {
|
|
31
|
-
const realtimeBalanceOf = await this.
|
|
34
|
+
const realtimeBalanceOf = await this.contract
|
|
32
35
|
.connect(providerOrSigner)
|
|
33
36
|
.realtimeBalanceOf(normalizedAccount, timestamp);
|
|
34
37
|
return {
|
|
@@ -46,193 +49,223 @@ export default class SuperToken extends Token {
|
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
|
-
|
|
52
|
+
/** ### CFA Read Functions ### */
|
|
50
53
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @param amount The amount to be downgraded.
|
|
53
|
-
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
54
|
-
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
55
|
-
*/
|
|
56
|
-
this.downgrade = ({ amount, overrides, }) => {
|
|
57
|
-
const txn = this.superTokenContract.populateTransaction.downgrade(amount, overrides || {});
|
|
58
|
-
return new Operation(txn, "SUPERTOKEN_DOWNGRADE");
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* @dev Upgrade `amount` SuperToken's.
|
|
62
|
-
* @param amount The amount to be upgraded.
|
|
63
|
-
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
64
|
-
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
65
|
-
*/
|
|
66
|
-
this.upgrade = ({ amount, overrides, }) => {
|
|
67
|
-
const txn = this.superTokenContract.populateTransaction.upgrade(amount, overrides || {});
|
|
68
|
-
return new Operation(txn, "SUPERTOKEN_UPGRADE");
|
|
69
|
-
};
|
|
70
|
-
// CFA Read Functions
|
|
71
|
-
/**
|
|
72
|
-
* @dev Get the details of a flow.
|
|
54
|
+
* Get the details of a flow.
|
|
73
55
|
* @param sender the sender of the flow
|
|
74
56
|
* @param receiver the receiver of the flow
|
|
75
57
|
* @param providerOrSigner a provider or signer object
|
|
76
58
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
77
59
|
*/
|
|
78
|
-
this.getFlow = async (
|
|
60
|
+
this.getFlow = async (params) => {
|
|
79
61
|
return await this.cfaV1.getFlow({
|
|
80
62
|
superToken: this.settings.address,
|
|
81
|
-
sender,
|
|
82
|
-
receiver,
|
|
83
|
-
providerOrSigner,
|
|
63
|
+
sender: params.sender,
|
|
64
|
+
receiver: params.receiver,
|
|
65
|
+
providerOrSigner: params.providerOrSigner,
|
|
84
66
|
});
|
|
85
67
|
};
|
|
86
68
|
/**
|
|
87
|
-
*
|
|
69
|
+
* Get the flow info of an account (net flow).
|
|
88
70
|
* @param account the account we're querying
|
|
89
71
|
* @param providerOrSigner a provider or signer object
|
|
90
72
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
91
73
|
*/
|
|
92
|
-
this.getAccountFlowInfo = async (
|
|
74
|
+
this.getAccountFlowInfo = async (params) => {
|
|
93
75
|
return await this.cfaV1.getAccountFlowInfo({
|
|
94
76
|
superToken: this.settings.address,
|
|
95
|
-
account,
|
|
96
|
-
providerOrSigner,
|
|
77
|
+
account: params.account,
|
|
78
|
+
providerOrSigner: params.providerOrSigner,
|
|
97
79
|
});
|
|
98
80
|
};
|
|
99
81
|
/**
|
|
100
|
-
*
|
|
82
|
+
* Get the net flow of an account.
|
|
101
83
|
* @param account the account we're querying
|
|
102
84
|
* @param providerOrSigner a provider or signer object
|
|
103
85
|
* @returns {Promise<string>} Web3 Flow info object
|
|
104
86
|
*/
|
|
105
|
-
this.getNetFlow = async (
|
|
87
|
+
this.getNetFlow = async (params) => {
|
|
106
88
|
return await this.cfaV1.getNetFlow({
|
|
107
89
|
superToken: this.settings.address,
|
|
108
|
-
account,
|
|
109
|
-
providerOrSigner,
|
|
90
|
+
account: params.account,
|
|
91
|
+
providerOrSigner: params.providerOrSigner,
|
|
110
92
|
});
|
|
111
93
|
};
|
|
112
|
-
// CFA Write Functions
|
|
113
94
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @param sender
|
|
95
|
+
* Get flow operator data.
|
|
96
|
+
* @param sender the sender
|
|
97
|
+
* @param flowOperator the flowOperator
|
|
98
|
+
* @param providerOrSigner a provider or signer object
|
|
99
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
100
|
+
*/
|
|
101
|
+
this.getFlowOperatorData = async (params) => {
|
|
102
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
103
|
+
const normalizedFlowOperator = normalizeAddress(params.flowOperator);
|
|
104
|
+
return await this.cfaV1.getFlowOperatorData({
|
|
105
|
+
superToken: this.settings.address,
|
|
106
|
+
sender: normalizedSender,
|
|
107
|
+
flowOperator: normalizedFlowOperator,
|
|
108
|
+
providerOrSigner: params.providerOrSigner,
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Get flow operator data using the flowOperatorId.
|
|
113
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
114
|
+
* @param providerOrSigner a provider or signer object
|
|
115
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
116
|
+
*/
|
|
117
|
+
this.getFlowOperatorDataByID = async (params) => {
|
|
118
|
+
return await this.cfaV1.getFlowOperatorDataByID({
|
|
119
|
+
superToken: this.settings.address,
|
|
120
|
+
flowOperatorId: params.flowOperatorId,
|
|
121
|
+
providerOrSigner: params.providerOrSigner,
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
/** ### CFA Write Functions ### */
|
|
125
|
+
/**
|
|
126
|
+
* Create a flow of the token of this class.
|
|
116
127
|
* @param receiver The receiver of the flow.
|
|
117
128
|
* @param flowRate The specified flow rate.
|
|
118
129
|
* @param userData Extra user data provided.
|
|
119
130
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
120
131
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
121
132
|
*/
|
|
122
|
-
this.createFlow = (
|
|
133
|
+
this.createFlow = (params) => {
|
|
123
134
|
return this.cfaV1.createFlow({
|
|
124
|
-
flowRate,
|
|
125
|
-
receiver,
|
|
126
|
-
sender,
|
|
127
135
|
superToken: this.settings.address,
|
|
128
|
-
|
|
129
|
-
overrides,
|
|
136
|
+
...params,
|
|
130
137
|
});
|
|
131
138
|
};
|
|
132
139
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @param sender The sender of the flow.
|
|
140
|
+
* Update a flow of the token of this class.
|
|
135
141
|
* @param receiver The receiver of the flow.
|
|
136
142
|
* @param flowRate The specified flow rate.
|
|
137
143
|
* @param userData Extra user data provided.
|
|
138
144
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
139
145
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
140
146
|
*/
|
|
141
|
-
this.updateFlow = (
|
|
147
|
+
this.updateFlow = (params) => {
|
|
142
148
|
return this.cfaV1.updateFlow({
|
|
143
|
-
flowRate,
|
|
144
|
-
receiver,
|
|
145
|
-
sender,
|
|
146
149
|
superToken: this.settings.address,
|
|
147
|
-
|
|
148
|
-
overrides,
|
|
150
|
+
...params,
|
|
149
151
|
});
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
152
|
-
*
|
|
154
|
+
* Delete a flow of the token of this class.
|
|
153
155
|
* @param sender The sender of the flow.
|
|
154
156
|
* @param receiver The receiver of the flow.
|
|
155
157
|
* @param userData Extra user data provided.
|
|
156
158
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
157
159
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
158
160
|
*/
|
|
159
|
-
this.deleteFlow = (
|
|
161
|
+
this.deleteFlow = (params) => {
|
|
160
162
|
return this.cfaV1.deleteFlow({
|
|
161
163
|
superToken: this.settings.address,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
...params,
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Create a flow as an operator
|
|
169
|
+
* @param flowRate The specified flow rate.
|
|
170
|
+
* @param sender The sender of the flow.
|
|
171
|
+
* @param receiver The receiver of the flow.
|
|
172
|
+
* @param userData Extra user data provided.
|
|
173
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
174
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
175
|
+
*/
|
|
176
|
+
this.createFlowByOperator = (params) => {
|
|
177
|
+
return this.cfaV1.createFlowByOperator({
|
|
178
|
+
superToken: this.settings.address,
|
|
179
|
+
...params,
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Update a flow as an operator.
|
|
184
|
+
* @param flowRate The specified flow rate.
|
|
185
|
+
* @param sender The sender of the flow.
|
|
186
|
+
* @param receiver The receiver of the flow.
|
|
187
|
+
* @param userData Extra user data provided.
|
|
188
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
189
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
190
|
+
*/
|
|
191
|
+
this.updateFlowByOperator = (params) => {
|
|
192
|
+
return this.cfaV1.updateFlowByOperator({
|
|
193
|
+
superToken: this.settings.address,
|
|
194
|
+
...params,
|
|
166
195
|
});
|
|
167
196
|
};
|
|
168
|
-
// IDA Read Functions
|
|
169
197
|
/**
|
|
170
|
-
*
|
|
198
|
+
* Delete a flow as an operator.
|
|
199
|
+
* @param sender The sender of the flow.
|
|
200
|
+
* @param receiver The receiver of the flow.
|
|
201
|
+
* @param userData Extra user data provided.
|
|
202
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
203
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
204
|
+
*/
|
|
205
|
+
this.deleteFlowByOperator = (params) => {
|
|
206
|
+
return this.cfaV1.deleteFlowByOperator({
|
|
207
|
+
superToken: this.settings.address,
|
|
208
|
+
...params,
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
/** ### IDA Read Functions ### */
|
|
212
|
+
/**
|
|
213
|
+
* Get the details of a `Subscription`.
|
|
171
214
|
* @param publisher the address of the publisher of the index
|
|
172
215
|
* @param indexId the index id
|
|
173
216
|
* @param subscriber the subscriber's address
|
|
174
217
|
* @param providerOrSigner a provider or signer object
|
|
175
218
|
* @returns {Promise<IWeb3Subscription>} Web3 Subscription object
|
|
176
219
|
*/
|
|
177
|
-
this.getSubscription = async (
|
|
220
|
+
this.getSubscription = async (params) => {
|
|
178
221
|
return await this.idaV1.getSubscription({
|
|
179
222
|
superToken: this.settings.address,
|
|
180
|
-
|
|
181
|
-
indexId,
|
|
182
|
-
subscriber,
|
|
183
|
-
providerOrSigner,
|
|
223
|
+
...params,
|
|
184
224
|
});
|
|
185
225
|
};
|
|
186
226
|
/**
|
|
187
|
-
*
|
|
227
|
+
* Get the details of an `Index`.
|
|
188
228
|
* @param publisher the address of the publisher of the index
|
|
189
229
|
* @param indexId the index id
|
|
190
230
|
* @param providerOrSigner a provider or signer object
|
|
191
231
|
* @returns {Promise<IWeb3Index>} Web3 Index object
|
|
192
232
|
*/
|
|
193
|
-
this.getIndex = async (
|
|
233
|
+
this.getIndex = async (params) => {
|
|
194
234
|
return await this.idaV1.getIndex({
|
|
195
235
|
superToken: this.settings.address,
|
|
196
|
-
|
|
197
|
-
indexId,
|
|
198
|
-
providerOrSigner,
|
|
236
|
+
...params,
|
|
199
237
|
});
|
|
200
238
|
};
|
|
201
|
-
|
|
239
|
+
/** ### IDA Write Functions ### */
|
|
202
240
|
/**
|
|
203
|
-
*
|
|
241
|
+
* Creates an IDA Index.
|
|
204
242
|
* @param indexId The id of the index.
|
|
205
243
|
* @param userData Extra user data provided.
|
|
206
244
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
207
245
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
208
246
|
*/
|
|
209
|
-
this.createIndex = (
|
|
247
|
+
this.createIndex = (params) => {
|
|
210
248
|
return this.idaV1.createIndex({
|
|
211
|
-
indexId,
|
|
212
249
|
superToken: this.settings.address,
|
|
213
|
-
|
|
214
|
-
overrides,
|
|
250
|
+
...params,
|
|
215
251
|
});
|
|
216
252
|
};
|
|
217
253
|
/**
|
|
218
|
-
*
|
|
254
|
+
* Distributes `amount` of token to an index
|
|
219
255
|
* @param indexId The id of the index.
|
|
220
256
|
* @param amount The amount of tokens to be distributed.
|
|
221
257
|
* @param userData Extra user data provided.
|
|
222
258
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
223
259
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
224
260
|
*/
|
|
225
|
-
this.distribute = (
|
|
261
|
+
this.distribute = (params) => {
|
|
226
262
|
return this.idaV1.distribute({
|
|
227
|
-
indexId,
|
|
228
|
-
amount,
|
|
229
263
|
superToken: this.settings.address,
|
|
230
|
-
|
|
231
|
-
overrides,
|
|
264
|
+
...params,
|
|
232
265
|
});
|
|
233
266
|
};
|
|
234
267
|
/**
|
|
235
|
-
*
|
|
268
|
+
* Updates the `IndexValue` field of an index.
|
|
236
269
|
* @param indexId The id of the index.
|
|
237
270
|
* @param indexValue The new indexValue.
|
|
238
271
|
* @param userData Extra user data provided.
|
|
@@ -241,17 +274,14 @@ export default class SuperToken extends Token {
|
|
|
241
274
|
*
|
|
242
275
|
* NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
|
|
243
276
|
*/
|
|
244
|
-
this.updateIndexValue = (
|
|
277
|
+
this.updateIndexValue = (params) => {
|
|
245
278
|
return this.idaV1.updateIndexValue({
|
|
246
|
-
indexId,
|
|
247
|
-
indexValue,
|
|
248
279
|
superToken: this.settings.address,
|
|
249
|
-
|
|
250
|
-
overrides,
|
|
280
|
+
...params,
|
|
251
281
|
});
|
|
252
282
|
};
|
|
253
283
|
/**
|
|
254
|
-
*
|
|
284
|
+
* Updates the `units` allocated to a Subscription.
|
|
255
285
|
* @param indexId The id of the index.
|
|
256
286
|
* @param subscriber The subscriber address whose units you want to update.
|
|
257
287
|
* @param units The amount of units you want to update to.
|
|
@@ -259,52 +289,42 @@ export default class SuperToken extends Token {
|
|
|
259
289
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
260
290
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
261
291
|
*/
|
|
262
|
-
this.updateSubscriptionUnits = (
|
|
292
|
+
this.updateSubscriptionUnits = (params) => {
|
|
263
293
|
return this.idaV1.updateSubscriptionUnits({
|
|
264
|
-
indexId,
|
|
265
294
|
superToken: this.settings.address,
|
|
266
|
-
|
|
267
|
-
units,
|
|
268
|
-
userData,
|
|
269
|
-
overrides,
|
|
295
|
+
...params,
|
|
270
296
|
});
|
|
271
297
|
};
|
|
272
298
|
/**
|
|
273
|
-
*
|
|
299
|
+
* Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
|
|
274
300
|
* @param indexId The id of the index.
|
|
275
301
|
* @param publisher The publisher address whose subscription you want to approve.
|
|
276
302
|
* @param userData Extra user data provided.
|
|
277
303
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
278
304
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
279
305
|
*/
|
|
280
|
-
this.approveSubscription = (
|
|
306
|
+
this.approveSubscription = (params) => {
|
|
281
307
|
return this.idaV1.approveSubscription({
|
|
282
|
-
indexId,
|
|
283
308
|
superToken: this.settings.address,
|
|
284
|
-
|
|
285
|
-
userData,
|
|
286
|
-
overrides,
|
|
309
|
+
...params,
|
|
287
310
|
});
|
|
288
311
|
};
|
|
289
312
|
/**
|
|
290
|
-
*
|
|
313
|
+
* Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
|
|
291
314
|
* @param indexId The id of the index.
|
|
292
315
|
* @param publisher The index publisher address you want to revoke for the subscriber.
|
|
293
316
|
* @param userData Extra user data provided.
|
|
294
317
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
295
318
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
296
319
|
*/
|
|
297
|
-
this.revokeSubscription = (
|
|
320
|
+
this.revokeSubscription = (params) => {
|
|
298
321
|
return this.idaV1.revokeSubscription({
|
|
299
|
-
indexId,
|
|
300
322
|
superToken: this.settings.address,
|
|
301
|
-
|
|
302
|
-
userData,
|
|
303
|
-
overrides,
|
|
323
|
+
...params,
|
|
304
324
|
});
|
|
305
325
|
};
|
|
306
326
|
/**
|
|
307
|
-
*
|
|
327
|
+
* Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
|
|
308
328
|
* @param indexId The id of the index.
|
|
309
329
|
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
310
330
|
* @param publisher The publisher address of the index you are targeting.
|
|
@@ -312,18 +332,14 @@ export default class SuperToken extends Token {
|
|
|
312
332
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
313
333
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
314
334
|
*/
|
|
315
|
-
this.deleteSubscription = (
|
|
335
|
+
this.deleteSubscription = (params) => {
|
|
316
336
|
return this.idaV1.deleteSubscription({
|
|
317
|
-
indexId,
|
|
318
337
|
superToken: this.settings.address,
|
|
319
|
-
|
|
320
|
-
publisher,
|
|
321
|
-
userData,
|
|
322
|
-
overrides,
|
|
338
|
+
...params,
|
|
323
339
|
});
|
|
324
340
|
};
|
|
325
341
|
/**
|
|
326
|
-
*
|
|
342
|
+
* Claims any pending tokens allocated to the Subscription (unapproved).
|
|
327
343
|
* @param indexId The id of the index.
|
|
328
344
|
* @param subscriber The subscriber address who you are claiming for.
|
|
329
345
|
* @param publisher The publisher address of the index you are targeting.
|
|
@@ -331,14 +347,17 @@ export default class SuperToken extends Token {
|
|
|
331
347
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
332
348
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
333
349
|
*/
|
|
334
|
-
this.claim = (
|
|
350
|
+
this.claim = (params) => {
|
|
335
351
|
return this.idaV1.claim({
|
|
336
|
-
indexId,
|
|
337
352
|
superToken: this.settings.address,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
353
|
+
...params,
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
/** ### Governance Read Functions ### */
|
|
357
|
+
this.getGovernanceParameters = async (providerOrSigner) => {
|
|
358
|
+
return this.governance.getGovernanceParameters({
|
|
359
|
+
providerOrSigner,
|
|
360
|
+
token: this.settings.address,
|
|
342
361
|
});
|
|
343
362
|
};
|
|
344
363
|
this.options = options;
|
|
@@ -349,10 +368,51 @@ export default class SuperToken extends Token {
|
|
|
349
368
|
this.idaV1 = new InstantDistributionAgreementV1({
|
|
350
369
|
config: this.settings.config,
|
|
351
370
|
});
|
|
352
|
-
this.
|
|
371
|
+
this.governance = new Governance(this.settings.config.governanceAddress, this.settings.config.hostAddress);
|
|
372
|
+
this.contract = new ethers.Contract(this.settings.address, SuperTokenABI.abi);
|
|
353
373
|
}
|
|
354
|
-
|
|
355
|
-
|
|
374
|
+
/** ### CFA ACL Write Functions (byOperator) ### */
|
|
375
|
+
/**
|
|
376
|
+
* Update permissions for a flow operator as a sender.
|
|
377
|
+
* @param sender The sender of the flow.
|
|
378
|
+
* @param flowOperator The permission grantee address
|
|
379
|
+
* @param permission The permissions to set.
|
|
380
|
+
* @param flowRateAllowance The flowRateAllowance granted to the flow operator.
|
|
381
|
+
* @param userData Extra user data provided.
|
|
382
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
383
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
384
|
+
*/
|
|
385
|
+
updateFlowOperatorPermissions(params) {
|
|
386
|
+
return this.cfaV1.updateFlowOperatorPermissions({
|
|
387
|
+
superToken: this.settings.address,
|
|
388
|
+
...params,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Give flow operator full control - max flow rate and create/update/delete permissions.
|
|
393
|
+
* @param sender The sender of the flow.
|
|
394
|
+
* @param flowOperator The permission grantee address
|
|
395
|
+
* @param userData Extra user data provided.
|
|
396
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
397
|
+
*/
|
|
398
|
+
authorizeFlowOperatorWithFullControl(params) {
|
|
399
|
+
return this.cfaV1.authorizeFlowOperatorWithFullControl({
|
|
400
|
+
superToken: this.settings.address,
|
|
401
|
+
...params,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Revoke flow operator control - set flow rate to 0 with no permissions.
|
|
406
|
+
* @param sender The sender of the flow.
|
|
407
|
+
* @param flowOperator The permission grantee address
|
|
408
|
+
* @param userData Extra user data provided.
|
|
409
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
410
|
+
*/
|
|
411
|
+
revokeFlowOperatorWithFullControl(params) {
|
|
412
|
+
return this.cfaV1.revokeFlowOperatorWithFullControl({
|
|
413
|
+
superToken: this.settings.address,
|
|
414
|
+
...params,
|
|
415
|
+
});
|
|
356
416
|
}
|
|
357
417
|
}
|
|
358
418
|
_a = SuperToken;
|
|
@@ -375,9 +435,28 @@ SuperToken.create = async (options) => {
|
|
|
375
435
|
config: options.config,
|
|
376
436
|
chainId,
|
|
377
437
|
networkName,
|
|
378
|
-
underlyingTokenAddress,
|
|
379
438
|
};
|
|
380
|
-
|
|
439
|
+
const tokenSymbol = await superToken
|
|
440
|
+
.connect(options.provider)
|
|
441
|
+
.symbol();
|
|
442
|
+
const resolverData = chainIdToResolverDataMap.get(chainId) || {
|
|
443
|
+
subgraphAPIEndpoint: "",
|
|
444
|
+
resolverAddress: "",
|
|
445
|
+
networkName: "",
|
|
446
|
+
nativeTokenSymbol: "",
|
|
447
|
+
};
|
|
448
|
+
const nativeTokenSymbol = resolverData.nativeTokenSymbol || "ETH";
|
|
449
|
+
const nativeSuperTokenSymbol = nativeTokenSymbol + "x";
|
|
450
|
+
if (nativeSuperTokenSymbol === tokenSymbol) {
|
|
451
|
+
return new NativeAssetSuperToken(options, settings, nativeTokenSymbol);
|
|
452
|
+
}
|
|
453
|
+
if (underlyingTokenAddress !== ethers.constants.AddressZero) {
|
|
454
|
+
return new WrapperSuperToken(options, {
|
|
455
|
+
...settings,
|
|
456
|
+
underlyingTokenAddress,
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
return new PureSuperToken(options, settings);
|
|
381
460
|
}
|
|
382
461
|
catch (err) {
|
|
383
462
|
throw new SFError({
|
|
@@ -387,4 +466,107 @@ SuperToken.create = async (options) => {
|
|
|
387
466
|
});
|
|
388
467
|
}
|
|
389
468
|
};
|
|
469
|
+
/**
|
|
470
|
+
* WrapperSuperToken has an underlying ERC20 token.
|
|
471
|
+
*/
|
|
472
|
+
export class WrapperSuperToken extends SuperToken {
|
|
473
|
+
constructor(options, settings) {
|
|
474
|
+
super(options, settings);
|
|
475
|
+
/** ### WrapperSuperToken Contract Write Functions ### */
|
|
476
|
+
/**
|
|
477
|
+
* Downgrade `amount` SuperToken's.
|
|
478
|
+
* @param amount The amount to be downgraded.
|
|
479
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
480
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
481
|
+
*/
|
|
482
|
+
this.downgrade = ({ amount, overrides, }) => {
|
|
483
|
+
const txn = this.contract.populateTransaction.downgrade(amount, overrides || {});
|
|
484
|
+
return new Operation(txn, "SUPERTOKEN_DOWNGRADE");
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Upgrade `amount` SuperToken's.
|
|
488
|
+
* @param amount The amount to be upgraded.
|
|
489
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
490
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
491
|
+
*/
|
|
492
|
+
this.upgrade = ({ amount, overrides, }) => {
|
|
493
|
+
const txn = this.contract.populateTransaction.upgrade(amount, overrides || {});
|
|
494
|
+
return new Operation(txn, "SUPERTOKEN_UPGRADE");
|
|
495
|
+
};
|
|
496
|
+
/**
|
|
497
|
+
* Upgrade `amount` of an ERC20 token to its SuperToken to `to` address.
|
|
498
|
+
* @param amount The amount to be upgraded.
|
|
499
|
+
* @param to The destination of the upgraded native asset super tokens.
|
|
500
|
+
* @param data Bytes operatorData
|
|
501
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
502
|
+
* @returns {Operation} An instance of Operation which can be executed.
|
|
503
|
+
*/
|
|
504
|
+
this.upgradeTo = ({ amount, to, data = "0x", overrides, }) => {
|
|
505
|
+
const txn = this.contract.populateTransaction.upgradeTo(to, amount, data, {
|
|
506
|
+
...overrides,
|
|
507
|
+
});
|
|
508
|
+
return new Operation(txn, "UNSUPPORTED");
|
|
509
|
+
};
|
|
510
|
+
this.underlyingToken = new ERC20Token(settings.underlyingTokenAddress);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* PureSuperToken doesn't have any underlying ERC20 token.
|
|
515
|
+
*/
|
|
516
|
+
export class PureSuperToken extends SuperToken {
|
|
517
|
+
constructor(options, settings) {
|
|
518
|
+
super(options, settings);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* NativeAssetSuperToken wraps the native asset of the network.
|
|
523
|
+
*/
|
|
524
|
+
export class NativeAssetSuperToken extends SuperToken {
|
|
525
|
+
constructor(options, settings, nativeTokenSymbol) {
|
|
526
|
+
super(options, settings);
|
|
527
|
+
/**
|
|
528
|
+
* Upgrade `amount` of a network's native asset to its SuperToken.
|
|
529
|
+
* @param amount The amount to be upgraded.
|
|
530
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
531
|
+
* @returns {Operation} An instance of Operation which can be executed.
|
|
532
|
+
*/
|
|
533
|
+
this.upgrade = ({ amount, overrides, }) => {
|
|
534
|
+
const txn = this.nativeAssetContract.populateTransaction.upgradeByETH({
|
|
535
|
+
...overrides,
|
|
536
|
+
value: amount,
|
|
537
|
+
});
|
|
538
|
+
return new Operation(txn, "UNSUPPORTED");
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Upgrade `amount` of a network's native asset to its SuperToken to `to` address.
|
|
542
|
+
* @param amount The amount to be upgraded.
|
|
543
|
+
* @param to The destination of the upgraded native asset super tokens.
|
|
544
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
545
|
+
* @returns {Operation} An instance of Operation which can be executed.
|
|
546
|
+
*/
|
|
547
|
+
this.upgradeTo = ({ amount, to, overrides, }) => {
|
|
548
|
+
const txn = this.nativeAssetContract.populateTransaction.upgradeByETHTo(to, {
|
|
549
|
+
...overrides,
|
|
550
|
+
value: amount,
|
|
551
|
+
});
|
|
552
|
+
return new Operation(txn, "UNSUPPORTED");
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* Downgrade `amount` of a native asset super token to the underlying native asset.
|
|
556
|
+
* @param amount The amount to be upgraded.
|
|
557
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
558
|
+
* @returns {Operation} An instance of Operation which can be executed.
|
|
559
|
+
*/
|
|
560
|
+
this.downgrade = ({ amount, overrides, }) => {
|
|
561
|
+
const txn = this.nativeAssetContract.populateTransaction.downgradeToETH(amount, {
|
|
562
|
+
...overrides,
|
|
563
|
+
});
|
|
564
|
+
return new Operation(txn, "UNSUPPORTED");
|
|
565
|
+
};
|
|
566
|
+
this.nativeTokenSymbol = nativeTokenSymbol;
|
|
567
|
+
}
|
|
568
|
+
get nativeAssetContract() {
|
|
569
|
+
return new ethers.Contract(this.settings.address, ISETHABI.abi);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
390
572
|
//# sourceMappingURL=SuperToken.js.map
|