@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
|
@@ -10,29 +10,29 @@ const IConstantFlowAgreementV1_json_1 = __importDefault(require("./abi/IConstant
|
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
const cfaInterface = new ethers_1.ethers.utils.Interface(IConstantFlowAgreementV1_json_1.default.abi);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Constant Flow Agreement V1 Helper Class
|
|
14
14
|
* @description A helper class to interact with the CFAV1 contract.
|
|
15
15
|
*/
|
|
16
16
|
class ConstantFlowAgreementV1 {
|
|
17
17
|
constructor(options) {
|
|
18
|
-
|
|
18
|
+
/** ### CFA Read Functions ### */
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Get the details of a flow.
|
|
21
21
|
* @param superToken the superToken of the agreement
|
|
22
22
|
* @param sender the sender of the flow
|
|
23
23
|
* @param receiver the receiver of the flow
|
|
24
24
|
* @param providerOrSigner a provider or signer object
|
|
25
25
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
26
26
|
*/
|
|
27
|
-
this.getFlow = async (
|
|
28
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
29
|
-
const normalizedSender = (0, utils_1.normalizeAddress)(sender);
|
|
30
|
-
const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
|
|
27
|
+
this.getFlow = async (params) => {
|
|
28
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
29
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
30
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
31
31
|
try {
|
|
32
|
-
const flowData = await this.
|
|
33
|
-
.connect(providerOrSigner)
|
|
32
|
+
const flowData = await this.contract
|
|
33
|
+
.connect(params.providerOrSigner)
|
|
34
34
|
.getFlow(normalizedToken, normalizedSender, normalizedReceiver);
|
|
35
|
-
return this.
|
|
35
|
+
return this._sanitizeFlowInfo(flowData);
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
|
38
38
|
throw new SFError_1.SFError({
|
|
@@ -43,20 +43,20 @@ class ConstantFlowAgreementV1 {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Get the flow info of an account (net flow).
|
|
47
47
|
* @param superToken the superToken of the agreement
|
|
48
48
|
* @param account the account we're querying
|
|
49
49
|
* @param providerOrSigner a provider or signer object
|
|
50
50
|
* @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
|
|
51
51
|
*/
|
|
52
|
-
this.getAccountFlowInfo = async (
|
|
53
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
54
|
-
const normalizedAccount = (0, utils_1.normalizeAddress)(account);
|
|
52
|
+
this.getAccountFlowInfo = async (params) => {
|
|
53
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
54
|
+
const normalizedAccount = (0, utils_1.normalizeAddress)(params.account);
|
|
55
55
|
try {
|
|
56
|
-
const flowData = await this.
|
|
57
|
-
.connect(providerOrSigner)
|
|
56
|
+
const flowData = await this.contract
|
|
57
|
+
.connect(params.providerOrSigner)
|
|
58
58
|
.getAccountFlowInfo(normalizedToken, normalizedAccount);
|
|
59
|
-
return this.
|
|
59
|
+
return this._sanitizeFlowInfo(flowData);
|
|
60
60
|
}
|
|
61
61
|
catch (err) {
|
|
62
62
|
throw new SFError_1.SFError({
|
|
@@ -67,18 +67,18 @@ class ConstantFlowAgreementV1 {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Get the net flow of an account.
|
|
71
71
|
* @param superToken the superToken of the agreement
|
|
72
72
|
* @param account the account we're querying
|
|
73
73
|
* @param providerOrSigner a provider or signer object
|
|
74
74
|
* @returns {Promise<string>} Web3 Flow info object
|
|
75
75
|
*/
|
|
76
|
-
this.getNetFlow = async (
|
|
77
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
78
|
-
const normalizedAccount = (0, utils_1.normalizeAddress)(account);
|
|
76
|
+
this.getNetFlow = async (params) => {
|
|
77
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
78
|
+
const normalizedAccount = (0, utils_1.normalizeAddress)(params.account);
|
|
79
79
|
try {
|
|
80
|
-
return (await this.
|
|
81
|
-
.connect(providerOrSigner)
|
|
80
|
+
return (await this.contract
|
|
81
|
+
.connect(params.providerOrSigner)
|
|
82
82
|
.getNetFlow(normalizedToken, normalizedAccount)).toString();
|
|
83
83
|
}
|
|
84
84
|
catch (err) {
|
|
@@ -89,9 +89,61 @@ class ConstantFlowAgreementV1 {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
// CFA Write Functions
|
|
93
92
|
/**
|
|
94
|
-
*
|
|
93
|
+
* Get flow operator data.
|
|
94
|
+
* @param superToken the superToken of the agreement
|
|
95
|
+
* @param sender the sender
|
|
96
|
+
* @param flowOperator the flowOperator
|
|
97
|
+
* @param providerOrSigner a provider or signer object
|
|
98
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
99
|
+
*/
|
|
100
|
+
this.getFlowOperatorData = async (params) => {
|
|
101
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
102
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
103
|
+
const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
|
|
104
|
+
try {
|
|
105
|
+
const flowOperatorData = await this.contract
|
|
106
|
+
.connect(params.providerOrSigner)
|
|
107
|
+
.getFlowOperatorData(normalizedToken, normalizedSender, normalizedFlowOperator);
|
|
108
|
+
return this._sanitizeFlowOperatorData(flowOperatorData);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
throw new SFError_1.SFError({
|
|
112
|
+
type: "CFAV1_READ",
|
|
113
|
+
customMessage: "There was an error getting flow operator data",
|
|
114
|
+
errorObject: err,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Get flow operator data using the flowOperatorId.
|
|
120
|
+
* @param superToken the superToken of the agreement
|
|
121
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
122
|
+
* @param providerOrSigner a provider or signer object
|
|
123
|
+
* @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
|
|
124
|
+
*/
|
|
125
|
+
this.getFlowOperatorDataByID = async (params) => {
|
|
126
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
127
|
+
try {
|
|
128
|
+
const flowOperatorData = await this.contract
|
|
129
|
+
.connect(params.providerOrSigner)
|
|
130
|
+
.getFlowOperatorDataByID(normalizedToken, params.flowOperatorId);
|
|
131
|
+
return this._sanitizeFlowOperatorData({
|
|
132
|
+
...flowOperatorData,
|
|
133
|
+
flowOperatorId: params.flowOperatorId,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
throw new SFError_1.SFError({
|
|
138
|
+
type: "CFAV1_READ",
|
|
139
|
+
customMessage: "There was an error getting flow operator data",
|
|
140
|
+
errorObject: err,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
/** ### CFA Write Functions ### */
|
|
145
|
+
/**
|
|
146
|
+
* Create a flow.
|
|
95
147
|
* @param flowRate The specified flow rate.
|
|
96
148
|
* @param receiver The receiver of the flow.
|
|
97
149
|
* @param superToken The token to be flowed.
|
|
@@ -99,19 +151,19 @@ class ConstantFlowAgreementV1 {
|
|
|
99
151
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
100
152
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
101
153
|
*/
|
|
102
|
-
this.createFlow = (
|
|
103
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
104
|
-
const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
|
|
154
|
+
this.createFlow = (params) => {
|
|
155
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
156
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
105
157
|
const callData = cfaInterface.encodeFunctionData("createFlow", [
|
|
106
158
|
normalizedToken,
|
|
107
159
|
normalizedReceiver,
|
|
108
|
-
flowRate,
|
|
160
|
+
params.flowRate,
|
|
109
161
|
"0x",
|
|
110
162
|
]);
|
|
111
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
163
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
112
164
|
};
|
|
113
165
|
/**
|
|
114
|
-
*
|
|
166
|
+
* Update a flow.
|
|
115
167
|
* @param flowRate The specified flow rate.
|
|
116
168
|
* @param receiver The receiver of the flow.
|
|
117
169
|
* @param superToken The token to be flowed.
|
|
@@ -119,19 +171,19 @@ class ConstantFlowAgreementV1 {
|
|
|
119
171
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
120
172
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
121
173
|
*/
|
|
122
|
-
this.updateFlow = (
|
|
123
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
124
|
-
const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
|
|
174
|
+
this.updateFlow = (params) => {
|
|
175
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
176
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
125
177
|
const callData = cfaInterface.encodeFunctionData("updateFlow", [
|
|
126
178
|
normalizedToken,
|
|
127
179
|
normalizedReceiver,
|
|
128
|
-
flowRate,
|
|
180
|
+
params.flowRate,
|
|
129
181
|
"0x",
|
|
130
182
|
]);
|
|
131
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
183
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
132
184
|
};
|
|
133
185
|
/**
|
|
134
|
-
*
|
|
186
|
+
* Delete a flow.
|
|
135
187
|
* @param superToken The token to be flowed.
|
|
136
188
|
* @param sender The sender of the flow.
|
|
137
189
|
* @param receiver The receiver of the flow.
|
|
@@ -139,39 +191,175 @@ class ConstantFlowAgreementV1 {
|
|
|
139
191
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
140
192
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
141
193
|
*/
|
|
142
|
-
this.deleteFlow = (
|
|
143
|
-
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
144
|
-
const normalizedSender = (0, utils_1.normalizeAddress)(sender);
|
|
145
|
-
const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
|
|
194
|
+
this.deleteFlow = (params) => {
|
|
195
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
196
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
197
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
146
198
|
const callData = cfaInterface.encodeFunctionData("deleteFlow", [
|
|
147
199
|
normalizedToken,
|
|
148
200
|
normalizedSender,
|
|
149
201
|
normalizedReceiver,
|
|
150
202
|
"0x",
|
|
151
203
|
]);
|
|
152
|
-
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, userData, overrides);
|
|
204
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
153
205
|
};
|
|
154
206
|
/**
|
|
155
|
-
*
|
|
207
|
+
* Create a flow as an operator
|
|
208
|
+
* @param flowRate The specified flow rate.
|
|
209
|
+
* @param sender The sender of the flow.
|
|
210
|
+
* @param receiver The receiver of the flow.
|
|
211
|
+
* @param superToken The token to be flowed.
|
|
212
|
+
* @param userData Extra user data provided.
|
|
213
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
214
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
215
|
+
*/
|
|
216
|
+
this.createFlowByOperator = (params) => {
|
|
217
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
218
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
219
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
220
|
+
const callData = cfaInterface.encodeFunctionData("createFlowByOperator", [
|
|
221
|
+
normalizedToken,
|
|
222
|
+
normalizedSender,
|
|
223
|
+
normalizedReceiver,
|
|
224
|
+
params.flowRate,
|
|
225
|
+
"0x",
|
|
226
|
+
]);
|
|
227
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Update a flow as an operator.
|
|
231
|
+
* @param flowRate The specified flow rate.
|
|
232
|
+
* @param sender The sender of the flow.
|
|
233
|
+
* @param receiver The receiver of the flow.
|
|
234
|
+
* @param superToken The token to be flowed.
|
|
235
|
+
* @param userData Extra user data provided.
|
|
236
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
237
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
238
|
+
*/
|
|
239
|
+
this.updateFlowByOperator = (params) => {
|
|
240
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
241
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
242
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
243
|
+
const callData = cfaInterface.encodeFunctionData("updateFlowByOperator", [
|
|
244
|
+
normalizedToken,
|
|
245
|
+
normalizedSender,
|
|
246
|
+
normalizedReceiver,
|
|
247
|
+
params.flowRate,
|
|
248
|
+
"0x",
|
|
249
|
+
]);
|
|
250
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Delete a flow as an operator.
|
|
254
|
+
* @param sender The sender of the flow.
|
|
255
|
+
* @param receiver The receiver of the flow.
|
|
256
|
+
* @param superToken The token to be flowed.
|
|
257
|
+
* @param userData Extra user data provided.
|
|
258
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
259
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
260
|
+
*/
|
|
261
|
+
this.deleteFlowByOperator = (params) => {
|
|
262
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
263
|
+
const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
|
|
264
|
+
const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
|
|
265
|
+
const callData = cfaInterface.encodeFunctionData("deleteFlowByOperator", [normalizedToken, normalizedSender, normalizedReceiver, "0x"]);
|
|
266
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
267
|
+
};
|
|
268
|
+
/** ### Private Functions ### */
|
|
269
|
+
/**
|
|
270
|
+
* Sanitizes flow info, converting BigNumber to string.
|
|
156
271
|
* @param timestamp last updated timestamp of flow
|
|
157
272
|
* @param flowRate the current flow rate
|
|
158
273
|
* @param deposit the deposit amount
|
|
159
274
|
* @param owedDeposit any owed depsit
|
|
160
275
|
* @returns {IWeb3FlowInfo} sanitized web3 flow info
|
|
161
276
|
*/
|
|
162
|
-
this.
|
|
277
|
+
this._sanitizeFlowInfo = (params) => {
|
|
163
278
|
return {
|
|
164
|
-
timestamp: (0, utils_1.getSanitizedTimestamp)(timestamp),
|
|
165
|
-
flowRate: flowRate.toString(),
|
|
166
|
-
deposit: deposit.toString(),
|
|
167
|
-
owedDeposit: owedDeposit.toString(),
|
|
279
|
+
timestamp: (0, utils_1.getSanitizedTimestamp)(params.timestamp),
|
|
280
|
+
flowRate: params.flowRate.toString(),
|
|
281
|
+
deposit: params.deposit.toString(),
|
|
282
|
+
owedDeposit: params.owedDeposit.toString(),
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Sanitizes flow operator data, converting BigNumber to string.
|
|
287
|
+
* @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
|
|
288
|
+
* @param permissions the permissions
|
|
289
|
+
* @param flowRateAllowance the flow rate allowance granted to the flow operator
|
|
290
|
+
* @returns {IWeb3FlowOperatorData} sanitized web3 flow info
|
|
291
|
+
*/
|
|
292
|
+
this._sanitizeFlowOperatorData = (params) => {
|
|
293
|
+
return {
|
|
294
|
+
flowOperatorId: params.flowOperatorId,
|
|
295
|
+
permissions: params.permissions.toString(),
|
|
296
|
+
flowRateAllowance: params.flowRateAllowance.toString(),
|
|
168
297
|
};
|
|
169
298
|
};
|
|
170
299
|
this.options = options;
|
|
171
300
|
this.host = new Host_1.default(options.config.hostAddress);
|
|
301
|
+
this.contract = new ethers_1.ethers.Contract(this.options.config.cfaV1Address, IConstantFlowAgreementV1_json_1.default.abi);
|
|
302
|
+
}
|
|
303
|
+
/** ### CFA ACL Write Functions (byOperator) ### */
|
|
304
|
+
/**
|
|
305
|
+
* Update permissions for a flow operator as a sender.
|
|
306
|
+
* @param superToken The token to be flowed.
|
|
307
|
+
* @param flowOperator The permission grantee address
|
|
308
|
+
* @param permission The permissions to set.
|
|
309
|
+
* @param flowRateAllowance The flowRateAllowance granted to the flow operator.
|
|
310
|
+
* @param userData Extra user data provided.
|
|
311
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
312
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
313
|
+
*/
|
|
314
|
+
updateFlowOperatorPermissions(params) {
|
|
315
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
316
|
+
const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
|
|
317
|
+
if (!(0, utils_1.isPermissionsClean)(params.permissions)) {
|
|
318
|
+
throw new SFError_1.SFError({
|
|
319
|
+
type: "UNCLEAN_PERMISSIONS",
|
|
320
|
+
customMessage: "The desired permissions are unclean",
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
if (Number(params.flowRateAllowance) < 0) {
|
|
324
|
+
throw new SFError_1.SFError({
|
|
325
|
+
type: "NEGATIVE_FLOW_ALLOWANCE",
|
|
326
|
+
customMessage: "No negative flow allowance allowed",
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
const callData = cfaInterface.encodeFunctionData("updateFlowOperatorPermissions", [
|
|
330
|
+
normalizedToken,
|
|
331
|
+
normalizedFlowOperator,
|
|
332
|
+
params.permissions,
|
|
333
|
+
params.flowRateAllowance,
|
|
334
|
+
"0x",
|
|
335
|
+
]);
|
|
336
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Give flow operator full control - max flow rate and create/update/delete permissions.
|
|
340
|
+
* @param superToken The token to be flowed.
|
|
341
|
+
* @param flowOperator The permission grantee address
|
|
342
|
+
* @param userData Extra user data provided.
|
|
343
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
344
|
+
*/
|
|
345
|
+
authorizeFlowOperatorWithFullControl(params) {
|
|
346
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
347
|
+
const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
|
|
348
|
+
const callData = cfaInterface.encodeFunctionData("authorizeFlowOperatorWithFullControl", [normalizedToken, normalizedFlowOperator, "0x"]);
|
|
349
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
172
350
|
}
|
|
173
|
-
|
|
174
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Revoke flow operator control - set flow rate to 0 with no permissions.
|
|
353
|
+
* @param superToken The token to be flowed.
|
|
354
|
+
* @param flowOperator The permission grantee address
|
|
355
|
+
* @param userData Extra user data provided.
|
|
356
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
357
|
+
*/
|
|
358
|
+
revokeFlowOperatorWithFullControl(params) {
|
|
359
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
|
|
360
|
+
const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
|
|
361
|
+
const callData = cfaInterface.encodeFunctionData("revokeFlowOperatorWithFullControl", [normalizedToken, normalizedFlowOperator, "0x"]);
|
|
362
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
|
|
175
363
|
}
|
|
176
364
|
}
|
|
177
365
|
exports.default = ConstantFlowAgreementV1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantFlowAgreementV1.js","sourceRoot":"","sources":["../../src/ConstantFlowAgreementV1.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAEhC,kDAA0B;AAE1B,uCAAoC;AACpC,wGAA8E;
|
|
1
|
+
{"version":3,"file":"ConstantFlowAgreementV1.js","sourceRoot":"","sources":["../../src/ConstantFlowAgreementV1.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAEhC,kDAA0B;AAE1B,uCAAoC;AACpC,wGAA8E;AAmB9E,mCAIiB;AAEjB,MAAM,YAAY,GAAG,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAC3C,uCAA2B,CAAC,GAAG,CAClC,CAAC;AAEF;;;GAGG;AACH,MAAqB,uBAAuB;IAKxC,YAAY,OAA4B;QASxC,iCAAiC;QAEjC;;;;;;;WAOG;QACH,YAAO,GAAG,KAAK,EAAE,MAAsB,EAA0B,EAAE;YAC/D,MAAM,eAAe,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5D,MAAM,gBAAgB,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzD,MAAM,kBAAkB,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7D,IAAI;gBACA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ;qBAC/B,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC;qBAChC,OAAO,CAAC,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;gBACpE,OAAO,IAAI,CAAC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AAQ,EACR,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,SAAS,CACnB,CAAC;IACN,CAAC;IAED;;;;;;OAMG;IACH,iCAAiC,CAAC,MAA0B;QACxD,MAAM,eAAe,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5D,MAAM,sBAAsB,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAErE,MAAM,QAAQ,GAAG,YAAY,CAAC,kBAAkB,CAC5C,mCAAmC,EACnC,CAAC,eAAe,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAClD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC,0CAA0C,CACvD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAChC,QAAQ,EACR,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,SAAS,CACnB,CAAC;IACN,CAAC;CAoIJ;AA1dD,0CA0dC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
2
|
import Operation from "./Operation";
|
|
3
3
|
import { IBaseSuperTokenParams, ITransferFromParams } from "./interfaces";
|
|
4
|
-
|
|
4
|
+
import { ERC20WithTokenInfo } from "./typechain/ERC20WithTokenInfo";
|
|
5
|
+
export default class ERC20Token {
|
|
5
6
|
readonly address: string;
|
|
7
|
+
readonly contract: ERC20WithTokenInfo;
|
|
6
8
|
constructor(address: string);
|
|
7
|
-
|
|
9
|
+
/** ### ERC20 Token Contract Read Functions ### */
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* Returns the allowance the `owner` has granted the `spender`.
|
|
10
12
|
* @param owner the owner who has allotted the allowance
|
|
11
13
|
* @param spender the spender who has received the allowance
|
|
12
14
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
@@ -18,7 +20,7 @@ export default class Token {
|
|
|
18
20
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
19
21
|
}) => Promise<string>;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
|
|
22
24
|
* @param account the account you would like to query
|
|
23
25
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
24
26
|
* @returns {Promise<string>} the token balance of `account`
|
|
@@ -28,7 +30,7 @@ export default class Token {
|
|
|
28
30
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
29
31
|
}) => Promise<string>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Returns the token name
|
|
32
34
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
33
35
|
* @returns {string} the token name
|
|
34
36
|
*/
|
|
@@ -36,7 +38,7 @@ export default class Token {
|
|
|
36
38
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
37
39
|
}) => Promise<string>;
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
41
|
+
* Returns the token symbol
|
|
40
42
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
41
43
|
* @returns {string} the token symbol
|
|
42
44
|
*/
|
|
@@ -44,37 +46,38 @@ export default class Token {
|
|
|
44
46
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
45
47
|
}) => Promise<string>;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
49
|
+
* Returns the total supply of the token.
|
|
48
50
|
* @param providerOrSigner a provider or signer for executing a web3 call
|
|
49
51
|
* @returns {Promise<string>} the total supply of the token
|
|
50
52
|
*/
|
|
51
53
|
totalSupply: ({ providerOrSigner, }: {
|
|
52
54
|
providerOrSigner: ethers.providers.Provider | ethers.Signer;
|
|
53
55
|
}) => Promise<string>;
|
|
56
|
+
/** ### ERC20 Token Contract Write Functions ### */
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
58
|
+
* Approve `receiver` to spend `amount` tokens.
|
|
56
59
|
* @param receiver The receiver approved.
|
|
57
60
|
* @param amount The amount approved.
|
|
58
61
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
59
62
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
60
63
|
*/
|
|
61
|
-
approve: (
|
|
64
|
+
approve: (params: IBaseSuperTokenParams) => Operation;
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
66
|
+
* Transfer `receiver` `amount` tokens.
|
|
64
67
|
* @param receiver The receiver of the transfer.
|
|
65
68
|
* @param amount The amount to be transferred.
|
|
66
69
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
67
70
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
68
71
|
*/
|
|
69
|
-
transfer: (
|
|
72
|
+
transfer: (params: IBaseSuperTokenParams) => Operation;
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Transfer from `sender` to `receiver` `amount` tokens.
|
|
72
75
|
* @param sender The sender of the transfer.
|
|
73
76
|
* @param receiver The receiver of the transfer.
|
|
74
77
|
* @param amount The amount to be transferred.
|
|
75
78
|
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
76
79
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
77
80
|
*/
|
|
78
|
-
transferFrom: (
|
|
81
|
+
transferFrom: (params: ITransferFromParams) => Operation;
|
|
79
82
|
}
|
|
80
|
-
//# sourceMappingURL=
|
|
83
|
+
//# sourceMappingURL=ERC20Token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20Token.d.ts","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM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