@superfluid-finance/sdk-core 0.3.3-dev.33b327e.0 → 0.3.3-dev.4c31a63.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 +6002 -1981
- 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 +109 -17
- package/dist/main/ConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/main/ConstantFlowAgreementV1.js +245 -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 +16 -7
- package/dist/main/Framework.d.ts.map +1 -1
- package/dist/main/Framework.js +34 -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 +229 -68
- 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 +350 -2
- package/dist/main/abi/ISETH.json +1604 -0
- package/dist/main/abi/Superfluid.json +13 -0
- package/dist/main/abi/SuperfluidGovernanceII.json +939 -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 +82 -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/Superfluid.d.ts +8 -0
- package/dist/main/typechain/Superfluid.d.ts.map +1 -1
- package/dist/main/typechain/SuperfluidGovernanceII.d.ts +633 -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 +350 -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 +957 -0
- package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
- package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -1
- package/dist/main/typechain/factories/Superfluid__factory.js +13 -0
- package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -1
- 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 +109 -17
- package/dist/module/ConstantFlowAgreementV1.d.ts.map +1 -1
- package/dist/module/ConstantFlowAgreementV1.js +246 -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 +16 -7
- package/dist/module/Framework.d.ts.map +1 -1
- package/dist/module/Framework.js +34 -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 +229 -68
- 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 +350 -2
- package/dist/module/abi/ISETH.json +1604 -0
- package/dist/module/abi/Superfluid.json +13 -0
- package/dist/module/abi/SuperfluidGovernanceII.json +939 -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 +82 -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/Superfluid.d.ts +8 -0
- package/dist/module/typechain/Superfluid.d.ts.map +1 -1
- package/dist/module/typechain/SuperfluidGovernanceII.d.ts +633 -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 +350 -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 +953 -0
- package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
- package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -1
- package/dist/module/typechain/factories/Superfluid__factory.js +13 -0
- package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -1
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchCall.js","sourceRoot":"","sources":["../../src/BatchCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAa/E,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAwB;IAChE,CAAC,eAAe,EAAE,CAAC,CAAC;IACpB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC1B,CAAC,oBAAoB,EAAE,GAAG,CAAC;IAC3B,CAAC,sBAAsB,EAAE,GAAG,CAAC;IAC7B,CAAC,2BAA2B,EAAE,GAAG,CAAC;IAClC,CAAC,iBAAiB,EAAE,GAAG,CAAC;CAC3B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAI1B,YAAY,OAA0B;QAKtC;;;;WAIG;QACH,iCAA4B,GAAG,CAAC,QAAgB,EAAuB,EAAE,CACrE,yBAAyB,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC;QAEhE;;;;;WAKG;QACH,uBAAkB,GAAG,KAAK,EACtB,SAAoB,EACpB,KAAa,EACW,EAAE;YAC1B,MAAM,aAAa,GAAG,4BAA4B,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACvE,MAAM,oBAAoB,GAAG,MAAM,SAAS,CAAC,0BAA0B,CAAC;YACxE,IAAI,CAAC,aAAa,EAAE;gBAChB,MAAM,IAAI,OAAO,CAAC;oBACd,IAAI,EAAE,uBAAuB;oBAC7B,aAA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AAC;QAEF,0BAA0B;QAC1B,oEAAoE;QACpE,6CAA6C;QAC7C;;;;WAIG;QACH,gBAAW,GAAG,KAAK,EACf,MAAqB,EACc,EAAE;YACrC,IAAI;gBACA,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,IAAI,CAAC,+BAA+B,CACvC,CAAC;gBACF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ;qBAC1B,OAAO,CAAC,MAAM,CAAC;qBACf,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;aAC/C;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,OAAO,CAAC;oBACd,IAAI,EAAE,kBAAkB;oBACxB,aAAa,EAAE,+CAA+C;oBAC9D,WAAW,EAAE,GAAG;iBACnB,CAAC,CAAC;aACN;QACL,CAAC,CAAC;QAhIE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAmED;;;OAGG;IACH,IAAI,+BAA+B;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACxC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAChC,CAAC;IACN,CAAC;CAoDJ"}
|
|
@@ -1,42 +1,62 @@
|
|
|
1
1
|
import Host from "./Host";
|
|
2
2
|
import Operation from "./Operation";
|
|
3
|
-
import { IAgreementV1Options, ICreateFlowParams, IDeleteFlowParams, IGetAccountFlowInfoParams, IGetFlowParams, IUpdateFlowParams, IWeb3FlowInfo, IWeb3FlowInfoParams } from "./interfaces";
|
|
3
|
+
import { IAgreementV1Options, ICreateFlowParams, IDeleteFlowParams, IFullControlParams, IGetAccountFlowInfoParams, IGetFlowOperatorDataByIDParams, IGetFlowOperatorDataParams, IGetFlowParams, IUpdateFlowByOperatorParams, IUpdateFlowOperatorPermissionsParams, IUpdateFlowParams, IWeb3FlowInfo, IWeb3FlowInfoParams, IWeb3FlowOperatorData, IWeb3FlowOperatorDataParams } from "./interfaces";
|
|
4
|
+
import { IConstantFlowAgreementV1 } from "./typechain";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Constant Flow Agreement V1 Helper Class
|
|
6
7
|
* @description A helper class to interact with the CFAV1 contract.
|
|
7
8
|
*/
|
|
8
9
|
export default class ConstantFlowAgreementV1 {
|
|
9
10
|
readonly options: IAgreementV1Options;
|
|
10
11
|
readonly host: Host;
|
|
12
|
+
readonly contract: IConstantFlowAgreementV1;
|
|
11
13
|
constructor(options: IAgreementV1Options);
|
|
12
|
-
|
|
14
|
+
/** ### CFA Read Functions ### */
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Get the details of a flow.
|
|
15
17
|
* @param superToken the superToken of the agreement
|
|
16
18
|
* @param sender the sender of the flow
|
|
17
19
|
* @param receiver the receiver of the flow
|
|
18
20
|
* @param providerOrSigner a provider or signer object
|
|
19
21
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
20
22
|
*/
|
|
21
|
-
getFlow: (
|
|
23
|
+
getFlow: (params: IGetFlowParams) => Promise<IWeb3FlowInfo>;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Get the flow info of an account (net flow).
|
|
24
26
|
* @param superToken the superToken of the agreement
|
|
25
27
|
* @param account the account we're querying
|
|
26
28
|
* @param providerOrSigner a provider or signer object
|
|
27
29
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
28
30
|
*/
|
|
29
|
-
getAccountFlowInfo: (
|
|
31
|
+
getAccountFlowInfo: (params: IGetAccountFlowInfoParams) => Promise<IWeb3FlowInfo>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Get the net flow of an account.
|
|
32
34
|
* @param superToken the superToken of the agreement
|
|
33
35
|
* @param account the account we're querying
|
|
34
36
|
* @param providerOrSigner a provider or signer object
|
|
35
37
|
* @returns {Promise<string>} Web3 Flow info object
|
|
36
38
|
*/
|
|
37
|
-
getNetFlow: (
|
|
39
|
+
getNetFlow: (params: IGetAccountFlowInfoParams) => Promise<string>;
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
41
|
+
* Get flow operator data.
|
|
42
|
+
* @param superToken the superToken of the agreement
|
|
43
|
+
* @param sender the sender
|
|
44
|
+
* @param flowOperator the flowOperator
|
|
45
|
+
* @param providerOrSigner a provider or signer object
|
|
46
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
47
|
+
*/
|
|
48
|
+
getFlowOperatorData: (params: IGetFlowOperatorDataParams) => Promise<IWeb3FlowOperatorData>;
|
|
49
|
+
/**
|
|
50
|
+
* Get flow operator data using the flowOperatorId.
|
|
51
|
+
* @param superToken the superToken of the agreement
|
|
52
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
53
|
+
* @param providerOrSigner a provider or signer object
|
|
54
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
55
|
+
*/
|
|
56
|
+
getFlowOperatorDataByID: (params: IGetFlowOperatorDataByIDParams) => Promise<IWeb3FlowOperatorData>;
|
|
57
|
+
/** ### CFA Write Functions ### */
|
|
58
|
+
/**
|
|
59
|
+
* Create a flow.
|
|
40
60
|
* @param flowRate The specified flow rate.
|
|
41
61
|
* @param receiver The receiver of the flow.
|
|
42
62
|
* @param superToken The token to be flowed.
|
|
@@ -44,9 +64,9 @@ export default class ConstantFlowAgreementV1 {
|
|
|
44
64
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
45
65
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
46
66
|
*/
|
|
47
|
-
createFlow: (
|
|
67
|
+
createFlow: (params: ICreateFlowParams) => Operation;
|
|
48
68
|
/**
|
|
49
|
-
*
|
|
69
|
+
* Update a flow.
|
|
50
70
|
* @param flowRate The specified flow rate.
|
|
51
71
|
* @param receiver The receiver of the flow.
|
|
52
72
|
* @param superToken The token to be flowed.
|
|
@@ -54,9 +74,9 @@ export default class ConstantFlowAgreementV1 {
|
|
|
54
74
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
55
75
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
56
76
|
*/
|
|
57
|
-
updateFlow: (
|
|
77
|
+
updateFlow: (params: IUpdateFlowParams) => Operation;
|
|
58
78
|
/**
|
|
59
|
-
*
|
|
79
|
+
* Delete a flow.
|
|
60
80
|
* @param superToken The token to be flowed.
|
|
61
81
|
* @param sender The sender of the flow.
|
|
62
82
|
* @param receiver The receiver of the flow.
|
|
@@ -64,15 +84,87 @@ export default class ConstantFlowAgreementV1 {
|
|
|
64
84
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
65
85
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
66
86
|
*/
|
|
67
|
-
deleteFlow: (
|
|
87
|
+
deleteFlow: (params: IDeleteFlowParams) => Operation;
|
|
88
|
+
/** ### CFA ACL Write Functions (byOperator) ### */
|
|
89
|
+
/**
|
|
90
|
+
* Update permissions for a flow operator as a sender.
|
|
91
|
+
* @param superToken The token to be flowed.
|
|
92
|
+
* @param sender The sender of the flow.
|
|
93
|
+
* @param flowOperator The permission grantee address
|
|
94
|
+
* @param permission The permissions to set.
|
|
95
|
+
* @param flowRateAllowance The flowRateAllowance granted to the flow operator.
|
|
96
|
+
* @param userData Extra user data provided.
|
|
97
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
98
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
99
|
+
*/
|
|
100
|
+
updateFlowOperatorPermissions(params: IUpdateFlowOperatorPermissionsParams): Operation;
|
|
101
|
+
/**
|
|
102
|
+
* Give flow operator full control - max flow rate and create/update/delete permissions.
|
|
103
|
+
* @param superToken The token to be flowed.
|
|
104
|
+
* @param sender The sender of the flow.
|
|
105
|
+
* @param flowOperator The permission grantee address
|
|
106
|
+
* @param userData Extra user data provided.
|
|
107
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
108
|
+
*/
|
|
109
|
+
authorizeFlowOperatorWithFullControl(params: IFullControlParams): Operation;
|
|
68
110
|
/**
|
|
69
|
-
*
|
|
111
|
+
* Revoke flow operator control - set flow rate to 0 with no permissions.
|
|
112
|
+
* @param superToken The token to be flowed.
|
|
113
|
+
* @param sender The sender of the flow.
|
|
114
|
+
* @param flowOperator The permission grantee address
|
|
115
|
+
* @param userData Extra user data provided.
|
|
116
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
117
|
+
*/
|
|
118
|
+
revokeFlowOperatorWithFullControl(params: IFullControlParams): Operation;
|
|
119
|
+
/**
|
|
120
|
+
* Create a flow as an operator
|
|
121
|
+
* @param flowRate The specified flow rate.
|
|
122
|
+
* @param sender The sender of the flow.
|
|
123
|
+
* @param receiver The receiver of the flow.
|
|
124
|
+
* @param superToken The token to be flowed.
|
|
125
|
+
* @param userData Extra user data provided.
|
|
126
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
127
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
128
|
+
*/
|
|
129
|
+
createFlowByOperator: (params: ICreateFlowParams) => Operation;
|
|
130
|
+
/**
|
|
131
|
+
* Update a flow as an operator.
|
|
132
|
+
* @param flowRate The specified flow rate.
|
|
133
|
+
* @param sender The sender of the flow.
|
|
134
|
+
* @param receiver The receiver of the flow.
|
|
135
|
+
* @param superToken The token to be flowed.
|
|
136
|
+
* @param userData Extra user data provided.
|
|
137
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
138
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
139
|
+
*/
|
|
140
|
+
updateFlowByOperator: (params: IUpdateFlowByOperatorParams) => Operation;
|
|
141
|
+
/**
|
|
142
|
+
* Delete a flow as an operator.
|
|
143
|
+
* @param sender The sender of the flow.
|
|
144
|
+
* @param receiver The receiver of the flow.
|
|
145
|
+
* @param superToken The token to be flowed.
|
|
146
|
+
* @param userData Extra user data provided.
|
|
147
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
148
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
149
|
+
*/
|
|
150
|
+
deleteFlowByOperator: (params: IDeleteFlowParams) => Operation;
|
|
151
|
+
/** ### Private Functions ### */
|
|
152
|
+
/**
|
|
153
|
+
* Sanitizes flow info, converting BigNumber to string.
|
|
70
154
|
* @param timestamp last updated timestamp of flow
|
|
71
155
|
* @param flowRate the current flow rate
|
|
72
156
|
* @param deposit the deposit amount
|
|
73
157
|
* @param owedDeposit any owed depsit
|
|
74
158
|
* @returns {IWeb3FlowInfo} sanitized web3 flow info
|
|
75
159
|
*/
|
|
76
|
-
|
|
160
|
+
_sanitizeFlowInfo: (params: IWeb3FlowInfoParams) => IWeb3FlowInfo;
|
|
161
|
+
/**
|
|
162
|
+
* Sanitizes flow operator data, converting BigNumber to string.
|
|
163
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
164
|
+
* @param permissions the permissions
|
|
165
|
+
* @param flowRateAllowance the flow rate allowance granted to the flow operator
|
|
166
|
+
* @returns {IWeb3FlowOperatorData} sanitized web3 flow info
|
|
167
|
+
*/
|
|
168
|
+
_sanitizeFlowOperatorData: (params: IWeb3FlowOperatorDataParams) => IWeb3FlowOperatorData;
|
|
77
169
|
}
|
|
78
170
|
//# sourceMappingURL=ConstantFlowAgreementV1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantFlowAgreementV1.d.ts","sourceRoot":"","sources":["../../src/ConstantFlowAgreementV1.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,yBAA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S,CAiBjD;IAEF;;;;;;;;OAQG;IACH,UAAU,WAAY,iBAAiB,KAAG,SAAS,CAiBjD;IAEF;;;;;;;;OAQG;IACH,UAAU,WAAY,iBAAiB,KAAG,SAAS,CAkBjD;IAEF,mDAAmD;IAEnD;;;;;;;;;;OAUG;IACH,6BAA6B,CACzB,MAAM,EAAE,oCAAoC,GAC7C,SAAS;IAsCZ;;;;;;;OAOG;IACH,oCAAoC,CAChC,MAAM,EAAE,kBAAkB,GAC3B,SAAS;IAkBZ;;;;;;;OAOG;IACH,iCAAiC,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS;IAkBxE;;;;;;;;;OASG;IACH,oBAAoB,WAAY,iBAAiB,KAAG,SAAS,CAsB3D;IAEF;;;;;;;;;OASG;IACH,oBAAoB,WAAY,2BAA2B,KAAG,SAAS,CAsBrE;IAEF;;;;;;;;OAQG;IACH,oBAAoB,WAAY,iBAAiB,KAAG,SAAS,CAgB3D;IAEF,gCAAgC;IAEhC;;;;;;;OAOG;IACH,iBAAiB,WAAY,mBAAmB,KAAG,aAAa,CAO9D;IAEF;;;;;;OAMG;IACH,yBAAyB,WACb,2BAA2B,KACpC,qBAAqB,CAMtB;CACL"}
|
|
@@ -2,32 +2,32 @@ import { ethers } from "ethers";
|
|
|
2
2
|
import Host from "./Host";
|
|
3
3
|
import { SFError } from "./SFError";
|
|
4
4
|
import IConstantFlowAgreementV1ABI from "./abi/IConstantFlowAgreementV1.json";
|
|
5
|
-
import { getSanitizedTimestamp, normalizeAddress } from "./utils";
|
|
5
|
+
import { getSanitizedTimestamp, isPermissionsClean, normalizeAddress, } from "./utils";
|
|
6
6
|
const cfaInterface = new ethers.utils.Interface(IConstantFlowAgreementV1ABI.abi);
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Constant Flow Agreement V1 Helper Class
|
|
9
9
|
* @description A helper class to interact with the CFAV1 contract.
|
|
10
10
|
*/
|
|
11
11
|
export default class ConstantFlowAgreementV1 {
|
|
12
12
|
constructor(options) {
|
|
13
|
-
|
|
13
|
+
/** ### CFA Read Functions ### */
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Get the details of a flow.
|
|
16
16
|
* @param superToken the superToken of the agreement
|
|
17
17
|
* @param sender the sender of the flow
|
|
18
18
|
* @param receiver the receiver of the flow
|
|
19
19
|
* @param providerOrSigner a provider or signer object
|
|
20
20
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
21
21
|
*/
|
|
22
|
-
this.getFlow = async (
|
|
23
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
24
|
-
const normalizedSender = normalizeAddress(sender);
|
|
25
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
22
|
+
this.getFlow = async (params) => {
|
|
23
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
24
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
25
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
26
26
|
try {
|
|
27
|
-
const flowData = await this.
|
|
28
|
-
.connect(providerOrSigner)
|
|
27
|
+
const flowData = await this.contract
|
|
28
|
+
.connect(params.providerOrSigner)
|
|
29
29
|
.getFlow(normalizedToken, normalizedSender, normalizedReceiver);
|
|
30
|
-
return this.
|
|
30
|
+
return this._sanitizeFlowInfo(flowData);
|
|
31
31
|
}
|
|
32
32
|
catch (err) {
|
|
33
33
|
throw new SFError({
|
|
@@ -38,20 +38,20 @@ export default class ConstantFlowAgreementV1 {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Get the flow info of an account (net flow).
|
|
42
42
|
* @param superToken the superToken of the agreement
|
|
43
43
|
* @param account the account we're querying
|
|
44
44
|
* @param providerOrSigner a provider or signer object
|
|
45
45
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
46
46
|
*/
|
|
47
|
-
this.getAccountFlowInfo = async (
|
|
48
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
49
|
-
const normalizedAccount = normalizeAddress(account);
|
|
47
|
+
this.getAccountFlowInfo = async (params) => {
|
|
48
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
49
|
+
const normalizedAccount = normalizeAddress(params.account);
|
|
50
50
|
try {
|
|
51
|
-
const flowData = await this.
|
|
52
|
-
.connect(providerOrSigner)
|
|
51
|
+
const flowData = await this.contract
|
|
52
|
+
.connect(params.providerOrSigner)
|
|
53
53
|
.getAccountFlowInfo(normalizedToken, normalizedAccount);
|
|
54
|
-
return this.
|
|
54
|
+
return this._sanitizeFlowInfo(flowData);
|
|
55
55
|
}
|
|
56
56
|
catch (err) {
|
|
57
57
|
throw new SFError({
|
|
@@ -62,18 +62,18 @@ export default class ConstantFlowAgreementV1 {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Get the net flow of an account.
|
|
66
66
|
* @param superToken the superToken of the agreement
|
|
67
67
|
* @param account the account we're querying
|
|
68
68
|
* @param providerOrSigner a provider or signer object
|
|
69
69
|
* @returns {Promise<string>} Web3 Flow info object
|
|
70
70
|
*/
|
|
71
|
-
this.getNetFlow = async (
|
|
72
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
73
|
-
const normalizedAccount = normalizeAddress(account);
|
|
71
|
+
this.getNetFlow = async (params) => {
|
|
72
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
73
|
+
const normalizedAccount = normalizeAddress(params.account);
|
|
74
74
|
try {
|
|
75
|
-
return (await this.
|
|
76
|
-
.connect(providerOrSigner)
|
|
75
|
+
return (await this.contract
|
|
76
|
+
.connect(params.providerOrSigner)
|
|
77
77
|
.getNetFlow(normalizedToken, normalizedAccount)).toString();
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
@@ -84,9 +84,61 @@ export default class ConstantFlowAgreementV1 {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
// CFA Write Functions
|
|
88
87
|
/**
|
|
89
|
-
*
|
|
88
|
+
* Get flow operator data.
|
|
89
|
+
* @param superToken the superToken of the agreement
|
|
90
|
+
* @param sender the sender
|
|
91
|
+
* @param flowOperator the flowOperator
|
|
92
|
+
* @param providerOrSigner a provider or signer object
|
|
93
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
94
|
+
*/
|
|
95
|
+
this.getFlowOperatorData = async (params) => {
|
|
96
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
97
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
98
|
+
const normalizedFlowOperator = normalizeAddress(params.flowOperator);
|
|
99
|
+
try {
|
|
100
|
+
const flowOperatorData = await this.contract
|
|
101
|
+
.connect(params.providerOrSigner)
|
|
102
|
+
.getFlowOperatorData(normalizedToken, normalizedSender, normalizedFlowOperator);
|
|
103
|
+
return this._sanitizeFlowOperatorData(flowOperatorData);
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
throw new SFError({
|
|
107
|
+
type: "CFAV1_READ",
|
|
108
|
+
customMessage: "There was an error getting flow operator data",
|
|
109
|
+
errorObject: err,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Get flow operator data using the flowOperatorId.
|
|
115
|
+
* @param superToken the superToken of the agreement
|
|
116
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
117
|
+
* @param providerOrSigner a provider or signer object
|
|
118
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
119
|
+
*/
|
|
120
|
+
this.getFlowOperatorDataByID = async (params) => {
|
|
121
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
122
|
+
try {
|
|
123
|
+
const flowOperatorData = await this.contract
|
|
124
|
+
.connect(params.providerOrSigner)
|
|
125
|
+
.getFlowOperatorDataByID(normalizedToken, params.flowOperatorId);
|
|
126
|
+
return this._sanitizeFlowOperatorData({
|
|
127
|
+
...flowOperatorData,
|
|
128
|
+
flowOperatorId: params.flowOperatorId,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
throw new SFError({
|
|
133
|
+
type: "CFAV1_READ",
|
|
134
|
+
customMessage: "There was an error getting flow operator data",
|
|
135
|
+
errorObject: err,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
/** ### CFA Write Functions ### */
|
|
140
|
+
/**
|
|
141
|
+
* Create a flow.
|
|
90
142
|
* @param flowRate The specified flow rate.
|
|
91
143
|
* @param receiver The receiver of the flow.
|
|
92
144
|
* @param superToken The token to be flowed.
|
|
@@ -94,19 +146,19 @@ export default class ConstantFlowAgreementV1 {
|
|
|
94
146
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
95
147
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
96
148
|
*/
|
|
97
|
-
this.createFlow = (
|
|
98
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
99
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
149
|
+
this.createFlow = (params) => {
|
|
150
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
151
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
100
152
|
const callData = cfaInterface.encodeFunctionData("createFlow", [
|
|
101
153
|
normalizedToken,
|
|
102
154
|
normalizedReceiver,
|
|
103
|
-
flowRate,
|
|
155
|
+
params.flowRate,
|
|
104
156
|
"0x",
|
|
105
157
|
]);
|
|
106
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
158
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
107
159
|
};
|
|
108
160
|
/**
|
|
109
|
-
*
|
|
161
|
+
* Update a flow.
|
|
110
162
|
* @param flowRate The specified flow rate.
|
|
111
163
|
* @param receiver The receiver of the flow.
|
|
112
164
|
* @param superToken The token to be flowed.
|
|
@@ -114,19 +166,19 @@ export default class ConstantFlowAgreementV1 {
|
|
|
114
166
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
115
167
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
116
168
|
*/
|
|
117
|
-
this.updateFlow = (
|
|
118
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
119
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
169
|
+
this.updateFlow = (params) => {
|
|
170
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
171
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
120
172
|
const callData = cfaInterface.encodeFunctionData("updateFlow", [
|
|
121
173
|
normalizedToken,
|
|
122
174
|
normalizedReceiver,
|
|
123
|
-
flowRate,
|
|
175
|
+
params.flowRate,
|
|
124
176
|
"0x",
|
|
125
177
|
]);
|
|
126
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
178
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
127
179
|
};
|
|
128
180
|
/**
|
|
129
|
-
*
|
|
181
|
+
* Delete a flow.
|
|
130
182
|
* @param superToken The token to be flowed.
|
|
131
183
|
* @param sender The sender of the flow.
|
|
132
184
|
* @param receiver The receiver of the flow.
|
|
@@ -134,39 +186,182 @@ export default class ConstantFlowAgreementV1 {
|
|
|
134
186
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
135
187
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
136
188
|
*/
|
|
137
|
-
this.deleteFlow = (
|
|
138
|
-
const normalizedToken = normalizeAddress(superToken);
|
|
139
|
-
const normalizedSender = normalizeAddress(sender);
|
|
140
|
-
const normalizedReceiver = normalizeAddress(receiver);
|
|
189
|
+
this.deleteFlow = (params) => {
|
|
190
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
191
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
192
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
141
193
|
const callData = cfaInterface.encodeFunctionData("deleteFlow", [
|
|
142
194
|
normalizedToken,
|
|
143
195
|
normalizedSender,
|
|
144
196
|
normalizedReceiver,
|
|
145
197
|
"0x",
|
|
146
198
|
]);
|
|
147
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
199
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
148
200
|
};
|
|
149
201
|
/**
|
|
150
|
-
*
|
|
202
|
+
* Create a flow as an operator
|
|
203
|
+
* @param flowRate The specified flow rate.
|
|
204
|
+
* @param sender The sender of the flow.
|
|
205
|
+
* @param receiver The receiver of the flow.
|
|
206
|
+
* @param superToken The token to be flowed.
|
|
207
|
+
* @param userData Extra user data provided.
|
|
208
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
209
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
210
|
+
*/
|
|
211
|
+
this.createFlowByOperator = (params) => {
|
|
212
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
213
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
214
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
215
|
+
const callData = cfaInterface.encodeFunctionData("createFlowByOperator", [
|
|
216
|
+
normalizedToken,
|
|
217
|
+
normalizedSender,
|
|
218
|
+
normalizedReceiver,
|
|
219
|
+
params.flowRate,
|
|
220
|
+
"0x",
|
|
221
|
+
]);
|
|
222
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Update a flow as an operator.
|
|
226
|
+
* @param flowRate The specified flow rate.
|
|
227
|
+
* @param sender The sender of the flow.
|
|
228
|
+
* @param receiver The receiver of the flow.
|
|
229
|
+
* @param superToken The token to be flowed.
|
|
230
|
+
* @param userData Extra user data provided.
|
|
231
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
232
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
233
|
+
*/
|
|
234
|
+
this.updateFlowByOperator = (params) => {
|
|
235
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
236
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
237
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
238
|
+
const callData = cfaInterface.encodeFunctionData("updateFlowByOperator", [
|
|
239
|
+
normalizedToken,
|
|
240
|
+
normalizedSender,
|
|
241
|
+
normalizedReceiver,
|
|
242
|
+
params.flowRate,
|
|
243
|
+
"0x",
|
|
244
|
+
]);
|
|
245
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Delete a flow as an operator.
|
|
249
|
+
* @param sender The sender of the flow.
|
|
250
|
+
* @param receiver The receiver of the flow.
|
|
251
|
+
* @param superToken The token to be flowed.
|
|
252
|
+
* @param userData Extra user data provided.
|
|
253
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
254
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
255
|
+
*/
|
|
256
|
+
this.deleteFlowByOperator = (params) => {
|
|
257
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
258
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
259
|
+
const normalizedReceiver = normalizeAddress(params.receiver);
|
|
260
|
+
const callData = cfaInterface.encodeFunctionData("deleteFlowByOperator", [normalizedToken, normalizedSender, normalizedReceiver, "0x"]);
|
|
261
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
262
|
+
};
|
|
263
|
+
/** ### Private Functions ### */
|
|
264
|
+
/**
|
|
265
|
+
* Sanitizes flow info, converting BigNumber to string.
|
|
151
266
|
* @param timestamp last updated timestamp of flow
|
|
152
267
|
* @param flowRate the current flow rate
|
|
153
268
|
* @param deposit the deposit amount
|
|
154
269
|
* @param owedDeposit any owed depsit
|
|
155
270
|
* @returns {IWeb3FlowInfo} sanitized web3 flow info
|
|
156
271
|
*/
|
|
157
|
-
this.
|
|
272
|
+
this._sanitizeFlowInfo = (params) => {
|
|
158
273
|
return {
|
|
159
|
-
timestamp: getSanitizedTimestamp(timestamp),
|
|
160
|
-
flowRate: flowRate.toString(),
|
|
161
|
-
deposit: deposit.toString(),
|
|
162
|
-
owedDeposit: owedDeposit.toString(),
|
|
274
|
+
timestamp: getSanitizedTimestamp(params.timestamp),
|
|
275
|
+
flowRate: params.flowRate.toString(),
|
|
276
|
+
deposit: params.deposit.toString(),
|
|
277
|
+
owedDeposit: params.owedDeposit.toString(),
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Sanitizes flow operator data, converting BigNumber to string.
|
|
282
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
283
|
+
* @param permissions the permissions
|
|
284
|
+
* @param flowRateAllowance the flow rate allowance granted to the flow operator
|
|
285
|
+
* @returns {IWeb3FlowOperatorData} sanitized web3 flow info
|
|
286
|
+
*/
|
|
287
|
+
this._sanitizeFlowOperatorData = (params) => {
|
|
288
|
+
return {
|
|
289
|
+
flowOperatorId: params.flowOperatorId,
|
|
290
|
+
permissions: params.permissions.toString(),
|
|
291
|
+
flowRateAllowance: params.flowRateAllowance.toString(),
|
|
163
292
|
};
|
|
164
293
|
};
|
|
165
294
|
this.options = options;
|
|
166
295
|
this.host = new Host(options.config.hostAddress);
|
|
296
|
+
this.contract = new ethers.Contract(this.options.config.cfaV1Address, IConstantFlowAgreementV1ABI.abi);
|
|
297
|
+
}
|
|
298
|
+
/** ### CFA ACL Write Functions (byOperator) ### */
|
|
299
|
+
/**
|
|
300
|
+
* Update permissions for a flow operator as a sender.
|
|
301
|
+
* @param superToken The token to be flowed.
|
|
302
|
+
* @param sender The sender of the flow.
|
|
303
|
+
* @param flowOperator The permission grantee address
|
|
304
|
+
* @param permission The permissions to set.
|
|
305
|
+
* @param flowRateAllowance The flowRateAllowance granted to the flow operator.
|
|
306
|
+
* @param userData Extra user data provided.
|
|
307
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
308
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
309
|
+
*/
|
|
310
|
+
updateFlowOperatorPermissions(params) {
|
|
311
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
312
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
313
|
+
const normalizedFlowOperator = normalizeAddress(params.flowOperator);
|
|
314
|
+
if (!isPermissionsClean(params.permissions)) {
|
|
315
|
+
throw new SFError({
|
|
316
|
+
type: "UNCLEAN_PERMISSIONS",
|
|
317
|
+
customMessage: "The desired permissions are unclean",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
if (Number(params.flowRateAllowance) < 0) {
|
|
321
|
+
throw new SFError({
|
|
322
|
+
type: "NEGATIVE_FLOW_ALLOWANCE",
|
|
323
|
+
customMessage: "No negative flow allowance allowed",
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
const callData = cfaInterface.encodeFunctionData("updateFlowOperatorPermissions", [
|
|
327
|
+
normalizedToken,
|
|
328
|
+
normalizedSender,
|
|
329
|
+
normalizedFlowOperator,
|
|
330
|
+
params.permissions,
|
|
331
|
+
params.flowRateAllowance,
|
|
332
|
+
"0x",
|
|
333
|
+
]);
|
|
334
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Give flow operator full control - max flow rate and create/update/delete permissions.
|
|
338
|
+
* @param superToken The token to be flowed.
|
|
339
|
+
* @param sender The sender of the flow.
|
|
340
|
+
* @param flowOperator The permission grantee address
|
|
341
|
+
* @param userData Extra user data provided.
|
|
342
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
343
|
+
*/
|
|
344
|
+
authorizeFlowOperatorWithFullControl(params) {
|
|
345
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
346
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
347
|
+
const normalizedFlowOperator = normalizeAddress(params.flowOperator);
|
|
348
|
+
const callData = cfaInterface.encodeFunctionData("authorizeFlowOperatorWithFullControl", [normalizedToken, normalizedSender, normalizedFlowOperator, "0x"]);
|
|
349
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
167
350
|
}
|
|
168
|
-
|
|
169
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Revoke flow operator control - set flow rate to 0 with no permissions.
|
|
353
|
+
* @param superToken The token to be flowed.
|
|
354
|
+
* @param sender The sender of the flow.
|
|
355
|
+
* @param flowOperator The permission grantee address
|
|
356
|
+
* @param userData Extra user data provided.
|
|
357
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
358
|
+
*/
|
|
359
|
+
revokeFlowOperatorWithFullControl(params) {
|
|
360
|
+
const normalizedToken = normalizeAddress(params.superToken);
|
|
361
|
+
const normalizedSender = normalizeAddress(params.sender);
|
|
362
|
+
const normalizedFlowOperator = normalizeAddress(params.flowOperator);
|
|
363
|
+
const callData = cfaInterface.encodeFunctionData("revokeFlowOperatorWithFullControl", [normalizedToken, normalizedSender, normalizedFlowOperator, "0x"]);
|
|
364
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
170
365
|
}
|
|
171
366
|
}
|
|
172
367
|
//# sourceMappingURL=ConstantFlowAgreementV1.js.map
|