@superfluid-finance/sdk-core 0.1.1-dev.fa49a94.0 → 0.2.1-dev.64549c3.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/README.md +124 -53
- package/dist/index.umd.js +63560 -0
- package/dist/main/BatchCall.d.ts +2 -2
- package/dist/main/BatchCall.d.ts.map +1 -0
- package/dist/main/BatchCall.js +128 -0
- package/dist/main/BatchCall.js.map +1 -0
- package/dist/main/ConstantFlowAgreementV1.d.ts +7 -3
- package/dist/main/ConstantFlowAgreementV1.d.ts.map +1 -0
- package/dist/main/ConstantFlowAgreementV1.js +178 -0
- package/dist/main/ConstantFlowAgreementV1.js.map +1 -0
- package/dist/main/Framework.d.ts +7 -2
- package/dist/main/Framework.d.ts.map +1 -0
- package/dist/main/Framework.js +181 -0
- package/dist/main/Framework.js.map +1 -0
- package/dist/main/Host.d.ts +6 -1
- package/dist/main/Host.d.ts.map +1 -0
- package/dist/main/Host.js +31 -0
- package/dist/main/Host.js.map +1 -0
- package/dist/main/InstantDistributionAgreementV1.d.ts +18 -9
- package/dist/main/InstantDistributionAgreementV1.d.ts.map +1 -0
- package/dist/main/InstantDistributionAgreementV1.js +249 -0
- package/dist/main/InstantDistributionAgreementV1.js.map +1 -0
- package/dist/main/Operation.d.ts +1 -0
- package/dist/main/Operation.d.ts.map +1 -0
- package/dist/main/Operation.js +86 -0
- package/dist/main/Operation.js.map +1 -0
- package/dist/main/Query.d.ts +1 -0
- package/dist/main/Query.d.ts.map +1 -0
- package/dist/main/Query.js +311 -0
- package/dist/main/Query.js.map +1 -0
- package/dist/main/SFError.d.ts +3 -2
- package/dist/main/SFError.d.ts.map +1 -0
- package/dist/main/SFError.js +36 -0
- package/dist/main/SFError.js.map +1 -0
- package/dist/main/SuperToken.d.ts +34 -14
- package/dist/main/SuperToken.d.ts.map +1 -0
- package/dist/main/SuperToken.js +398 -0
- package/dist/main/SuperToken.js.map +1 -0
- package/dist/main/Token.d.ts +7 -3
- package/dist/main/Token.d.ts.map +1 -0
- package/dist/main/Token.js +166 -0
- package/dist/main/Token.js.map +1 -0
- package/dist/main/abi/ERC20WithTokenInfo.json +224 -0
- package/dist/main/abi/IConstantFlowAgreementV1.json +406 -0
- package/dist/main/abi/IInstantDistributionAgreementV1.json +947 -0
- package/dist/main/abi/IResolver.json +58 -0
- package/dist/main/abi/SuperToken.json +1549 -0
- package/dist/main/abi/Superfluid.json +1159 -0
- package/dist/main/abi/SuperfluidLoader.json +54 -0
- package/dist/main/constants.d.ts +10 -2
- package/dist/main/constants.d.ts.map +1 -0
- package/dist/main/constants.js +134 -0
- package/dist/main/constants.js.map +1 -0
- package/dist/main/events.d.ts +1 -0
- package/dist/main/events.d.ts.map +1 -0
- package/dist/main/events.js +3 -0
- package/dist/main/events.js.map +1 -0
- package/dist/main/frameworkHelpers.d.ts +1 -0
- package/dist/main/frameworkHelpers.d.ts.map +1 -0
- package/dist/main/frameworkHelpers.js +90 -0
- package/dist/main/frameworkHelpers.js.map +1 -0
- package/dist/main/index.d.ts +6 -0
- package/dist/main/index.d.ts.map +1 -0
- package/dist/main/index.js +38 -7524
- package/dist/main/index.js.map +1 -0
- package/dist/main/interfaces.d.ts +100 -11
- package/dist/main/interfaces.d.ts.map +1 -0
- package/dist/main/interfaces.js +3 -0
- package/dist/main/interfaces.js.map +1 -0
- package/dist/main/mapGetAllEventsQueryEvents.d.ts +1 -0
- package/dist/main/mapGetAllEventsQueryEvents.d.ts.map +1 -0
- package/dist/main/mapGetAllEventsQueryEvents.js +432 -0
- package/dist/main/mapGetAllEventsQueryEvents.js.map +1 -0
- package/dist/main/ordering.d.ts +1 -0
- package/dist/main/ordering.d.ts.map +1 -0
- package/dist/main/ordering.js +3 -0
- package/dist/main/ordering.js.map +1 -0
- package/dist/main/pagination.d.ts +1 -0
- package/dist/main/pagination.d.ts.map +1 -0
- package/dist/main/pagination.js +60 -0
- package/dist/main/pagination.js.map +1 -0
- package/dist/main/subgraph/SubgraphClient.d.ts +1 -0
- package/dist/main/subgraph/SubgraphClient.d.ts.map +1 -0
- package/dist/main/subgraph/SubgraphClient.js +51 -0
- package/dist/main/subgraph/SubgraphClient.js.map +1 -0
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js +5 -0
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.js +6 -0
- package/dist/main/subgraph/queries/getAllEvents.generated.js.map +1 -0
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js +5 -0
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -0
- package/dist/main/subgraph/queries/getIndexes.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getIndexes.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getIndexes.generated.js +5 -0
- package/dist/main/subgraph/queries/getIndexes.generated.js.map +1 -0
- package/dist/main/subgraph/queries/getStreams.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getStreams.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getStreams.generated.js +5 -0
- package/dist/main/subgraph/queries/getStreams.generated.js.map +1 -0
- package/dist/main/subgraph/queries/getTokens.generated.d.ts +1 -0
- package/dist/main/subgraph/queries/getTokens.generated.d.ts.map +1 -0
- package/dist/main/subgraph/queries/getTokens.generated.js +5 -0
- package/dist/main/subgraph/queries/getTokens.generated.js.map +1 -0
- package/dist/main/subgraph/schema.generated.d.ts +1 -0
- package/dist/main/subgraph/schema.generated.d.ts.map +1 -0
- package/dist/main/subgraph/schema.generated.js +3 -0
- package/dist/main/subgraph/schema.generated.js.map +1 -0
- package/dist/main/typechain/ERC20WithTokenInfo.d.ts +1 -0
- package/dist/main/typechain/ERC20WithTokenInfo.d.ts.map +1 -0
- package/dist/main/typechain/ERC20WithTokenInfo.js +3 -0
- package/dist/main/typechain/ERC20WithTokenInfo.js.map +1 -0
- package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +1 -0
- package/dist/main/typechain/IConstantFlowAgreementV1.d.ts.map +1 -0
- package/dist/main/typechain/IConstantFlowAgreementV1.js +3 -0
- package/dist/main/typechain/IConstantFlowAgreementV1.js.map +1 -0
- package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts +1 -0
- package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -0
- package/dist/main/typechain/IInstantDistributionAgreementV1.js +3 -0
- package/dist/main/typechain/IInstantDistributionAgreementV1.js.map +1 -0
- package/dist/main/typechain/IResolver.d.ts +18 -3
- package/dist/main/typechain/IResolver.d.ts.map +1 -0
- package/dist/main/typechain/IResolver.js +3 -0
- package/dist/main/typechain/IResolver.js.map +1 -0
- package/dist/main/typechain/SuperToken.d.ts +1 -0
- package/dist/main/typechain/SuperToken.d.ts.map +1 -0
- package/dist/main/typechain/SuperToken.js +3 -0
- package/dist/main/typechain/SuperToken.js.map +1 -0
- package/dist/main/typechain/Superfluid.d.ts +1 -0
- package/dist/main/typechain/Superfluid.d.ts.map +1 -0
- package/dist/main/typechain/Superfluid.js +3 -0
- package/dist/main/typechain/Superfluid.js.map +1 -0
- package/dist/main/typechain/SuperfluidLoader.d.ts +1 -0
- package/dist/main/typechain/SuperfluidLoader.d.ts.map +1 -0
- package/dist/main/typechain/SuperfluidLoader.js +3 -0
- package/dist/main/typechain/SuperfluidLoader.js.map +1 -0
- package/dist/main/typechain/TestToken.d.ts +9 -0
- package/dist/main/typechain/TestToken.d.ts.map +1 -0
- package/dist/main/typechain/TestToken.js +3 -0
- package/dist/main/typechain/TestToken.js.map +1 -0
- package/dist/main/typechain/common.d.ts +1 -0
- package/dist/main/typechain/common.d.ts.map +1 -0
- package/dist/main/typechain/common.js +3 -0
- package/dist/main/typechain/common.js.map +1 -0
- package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -0
- package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.js +242 -0
- package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.js.map +1 -0
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -0
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js +424 -0
- package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -0
- package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -0
- package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js +965 -0
- package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -0
- package/dist/main/typechain/factories/IResolver__factory.d.ts +16 -2
- package/dist/main/typechain/factories/IResolver__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/IResolver__factory.js +76 -0
- package/dist/main/typechain/factories/IResolver__factory.js.map +1 -0
- package/dist/main/typechain/factories/SuperToken__factory.d.ts +1 -0
- package/dist/main/typechain/factories/SuperToken__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/SuperToken__factory.js +1567 -0
- package/dist/main/typechain/factories/SuperToken__factory.js.map +1 -0
- package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts +1 -0
- package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/SuperfluidLoader__factory.js +72 -0
- package/dist/main/typechain/factories/SuperfluidLoader__factory.js.map +1 -0
- package/dist/main/typechain/factories/Superfluid__factory.d.ts +1 -0
- package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/Superfluid__factory.js +1177 -0
- package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -0
- package/dist/main/typechain/factories/TestToken__factory.d.ts +1 -0
- package/dist/main/typechain/factories/TestToken__factory.d.ts.map +1 -0
- package/dist/main/typechain/factories/TestToken__factory.js +348 -0
- package/dist/main/typechain/factories/TestToken__factory.js.map +1 -0
- package/dist/main/typechain/index.d.ts +1 -0
- package/dist/main/typechain/index.d.ts.map +1 -0
- package/dist/main/typechain/index.js +20 -0
- package/dist/main/typechain/index.js.map +1 -0
- package/dist/main/types.d.ts +1 -0
- package/dist/main/types.d.ts.map +1 -0
- package/dist/main/types.js +3 -0
- package/dist/main/types.js.map +1 -0
- package/dist/main/utils.d.ts +23 -0
- package/dist/main/utils.d.ts.map +1 -0
- package/dist/main/utils.js +178 -0
- package/dist/main/utils.js.map +1 -0
- package/dist/main/validation.d.ts +1 -0
- package/dist/main/validation.d.ts.map +1 -0
- package/dist/main/validation.js +98 -0
- package/dist/main/validation.js.map +1 -0
- package/dist/module/BatchCall.d.ts +2 -2
- package/dist/module/BatchCall.d.ts.map +1 -0
- package/dist/module/BatchCall.js +122 -0
- package/dist/module/BatchCall.js.map +1 -0
- package/dist/module/ConstantFlowAgreementV1.d.ts +7 -3
- package/dist/module/ConstantFlowAgreementV1.d.ts.map +1 -0
- package/dist/module/ConstantFlowAgreementV1.js +172 -0
- package/dist/module/ConstantFlowAgreementV1.js.map +1 -0
- package/dist/module/Framework.d.ts +7 -2
- package/dist/module/Framework.d.ts.map +1 -0
- package/dist/module/Framework.js +175 -0
- package/dist/module/Framework.js.map +1 -0
- package/dist/module/Host.d.ts +6 -1
- package/dist/module/Host.d.ts.map +1 -0
- package/dist/module/Host.js +25 -0
- package/dist/module/Host.js.map +1 -0
- package/dist/module/InstantDistributionAgreementV1.d.ts +18 -9
- package/dist/module/InstantDistributionAgreementV1.d.ts.map +1 -0
- package/dist/module/InstantDistributionAgreementV1.js +243 -0
- package/dist/module/InstantDistributionAgreementV1.js.map +1 -0
- package/dist/module/Operation.d.ts +1 -0
- package/dist/module/Operation.d.ts.map +1 -0
- package/dist/module/Operation.js +80 -0
- package/dist/module/Operation.js.map +1 -0
- package/dist/module/Query.d.ts +1 -0
- package/dist/module/Query.d.ts.map +1 -0
- package/dist/module/Query.js +305 -0
- package/dist/module/Query.js.map +1 -0
- package/dist/module/SFError.d.ts +3 -2
- package/dist/module/SFError.d.ts.map +1 -0
- package/dist/module/SFError.js +33 -0
- package/dist/module/SFError.js.map +1 -0
- package/dist/module/SuperToken.d.ts +34 -14
- package/dist/module/SuperToken.d.ts.map +1 -0
- package/dist/module/SuperToken.js +392 -0
- package/dist/module/SuperToken.js.map +1 -0
- package/dist/module/Token.d.ts +7 -3
- package/dist/module/Token.d.ts.map +1 -0
- package/dist/module/Token.js +160 -0
- package/dist/module/Token.js.map +1 -0
- package/dist/module/abi/ERC20WithTokenInfo.json +224 -0
- package/dist/module/abi/IConstantFlowAgreementV1.json +406 -0
- package/dist/module/abi/IInstantDistributionAgreementV1.json +947 -0
- package/dist/module/abi/IResolver.json +58 -0
- package/dist/module/abi/SuperToken.json +1549 -0
- package/dist/module/abi/Superfluid.json +1159 -0
- package/dist/module/abi/SuperfluidLoader.json +54 -0
- package/dist/module/constants.d.ts +10 -2
- package/dist/module/constants.d.ts.map +1 -0
- package/dist/module/constants.js +131 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/events.d.ts +1 -0
- package/dist/module/events.d.ts.map +1 -0
- package/dist/module/events.js +2 -0
- package/dist/module/events.js.map +1 -0
- package/dist/module/frameworkHelpers.d.ts +1 -0
- package/dist/module/frameworkHelpers.d.ts.map +1 -0
- package/dist/module/frameworkHelpers.js +81 -0
- package/dist/module/frameworkHelpers.js.map +1 -0
- package/dist/module/index.d.ts +6 -0
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +25 -7490
- package/dist/module/index.js.map +1 -0
- package/dist/module/interfaces.d.ts +100 -11
- package/dist/module/interfaces.d.ts.map +1 -0
- package/dist/module/interfaces.js +2 -0
- package/dist/module/interfaces.js.map +1 -0
- package/dist/module/mapGetAllEventsQueryEvents.d.ts +1 -0
- package/dist/module/mapGetAllEventsQueryEvents.d.ts.map +1 -0
- package/dist/module/mapGetAllEventsQueryEvents.js +428 -0
- package/dist/module/mapGetAllEventsQueryEvents.js.map +1 -0
- package/dist/module/ordering.d.ts +1 -0
- package/dist/module/ordering.d.ts.map +1 -0
- package/dist/module/ordering.js +2 -0
- package/dist/module/ordering.js.map +1 -0
- package/dist/module/pagination.d.ts +1 -0
- package/dist/module/pagination.d.ts.map +1 -0
- package/dist/module/pagination.js +51 -0
- package/dist/module/pagination.js.map +1 -0
- package/dist/module/subgraph/SubgraphClient.d.ts +1 -0
- package/dist/module/subgraph/SubgraphClient.d.ts.map +1 -0
- package/dist/module/subgraph/SubgraphClient.js +44 -0
- package/dist/module/subgraph/SubgraphClient.js.map +1 -0
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js +2 -0
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.js +3 -0
- package/dist/module/subgraph/queries/getAllEvents.generated.js.map +1 -0
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js +2 -0
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -0
- package/dist/module/subgraph/queries/getIndexes.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getIndexes.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getIndexes.generated.js +2 -0
- package/dist/module/subgraph/queries/getIndexes.generated.js.map +1 -0
- package/dist/module/subgraph/queries/getStreams.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getStreams.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getStreams.generated.js +2 -0
- package/dist/module/subgraph/queries/getStreams.generated.js.map +1 -0
- package/dist/module/subgraph/queries/getTokens.generated.d.ts +1 -0
- package/dist/module/subgraph/queries/getTokens.generated.d.ts.map +1 -0
- package/dist/module/subgraph/queries/getTokens.generated.js +2 -0
- package/dist/module/subgraph/queries/getTokens.generated.js.map +1 -0
- package/dist/module/subgraph/schema.generated.d.ts +1 -0
- package/dist/module/subgraph/schema.generated.d.ts.map +1 -0
- package/dist/module/subgraph/schema.generated.js +2 -0
- package/dist/module/subgraph/schema.generated.js.map +1 -0
- package/dist/module/typechain/ERC20WithTokenInfo.d.ts +1 -0
- package/dist/module/typechain/ERC20WithTokenInfo.d.ts.map +1 -0
- package/dist/module/typechain/ERC20WithTokenInfo.js +2 -0
- package/dist/module/typechain/ERC20WithTokenInfo.js.map +1 -0
- package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +1 -0
- package/dist/module/typechain/IConstantFlowAgreementV1.d.ts.map +1 -0
- package/dist/module/typechain/IConstantFlowAgreementV1.js +2 -0
- package/dist/module/typechain/IConstantFlowAgreementV1.js.map +1 -0
- package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts +1 -0
- package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -0
- package/dist/module/typechain/IInstantDistributionAgreementV1.js +2 -0
- package/dist/module/typechain/IInstantDistributionAgreementV1.js.map +1 -0
- package/dist/module/typechain/IResolver.d.ts +18 -3
- package/dist/module/typechain/IResolver.d.ts.map +1 -0
- package/dist/module/typechain/IResolver.js +2 -0
- package/dist/module/typechain/IResolver.js.map +1 -0
- package/dist/module/typechain/SuperToken.d.ts +1 -0
- package/dist/module/typechain/SuperToken.d.ts.map +1 -0
- package/dist/module/typechain/SuperToken.js +2 -0
- package/dist/module/typechain/SuperToken.js.map +1 -0
- package/dist/module/typechain/Superfluid.d.ts +1 -0
- package/dist/module/typechain/Superfluid.d.ts.map +1 -0
- package/dist/module/typechain/Superfluid.js +2 -0
- package/dist/module/typechain/Superfluid.js.map +1 -0
- package/dist/module/typechain/SuperfluidLoader.d.ts +1 -0
- package/dist/module/typechain/SuperfluidLoader.d.ts.map +1 -0
- package/dist/module/typechain/SuperfluidLoader.js +2 -0
- package/dist/module/typechain/SuperfluidLoader.js.map +1 -0
- package/dist/module/typechain/TestToken.d.ts +9 -0
- package/dist/module/typechain/TestToken.d.ts.map +1 -0
- package/dist/module/typechain/TestToken.js +2 -0
- package/dist/module/typechain/TestToken.js.map +1 -0
- package/dist/module/typechain/common.d.ts +1 -0
- package/dist/module/typechain/common.d.ts.map +1 -0
- package/dist/module/typechain/common.js +2 -0
- package/dist/module/typechain/common.js.map +1 -0
- package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -0
- package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.js +238 -0
- package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.js.map +1 -0
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -0
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js +420 -0
- package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -0
- package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -0
- package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js +961 -0
- package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -0
- package/dist/module/typechain/factories/IResolver__factory.d.ts +16 -2
- package/dist/module/typechain/factories/IResolver__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/IResolver__factory.js +72 -0
- package/dist/module/typechain/factories/IResolver__factory.js.map +1 -0
- package/dist/module/typechain/factories/SuperToken__factory.d.ts +1 -0
- package/dist/module/typechain/factories/SuperToken__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/SuperToken__factory.js +1563 -0
- package/dist/module/typechain/factories/SuperToken__factory.js.map +1 -0
- package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts +1 -0
- package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/SuperfluidLoader__factory.js +68 -0
- package/dist/module/typechain/factories/SuperfluidLoader__factory.js.map +1 -0
- package/dist/module/typechain/factories/Superfluid__factory.d.ts +1 -0
- package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/Superfluid__factory.js +1173 -0
- package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -0
- package/dist/module/typechain/factories/TestToken__factory.d.ts +1 -0
- package/dist/module/typechain/factories/TestToken__factory.d.ts.map +1 -0
- package/dist/module/typechain/factories/TestToken__factory.js +344 -0
- package/dist/module/typechain/factories/TestToken__factory.js.map +1 -0
- package/dist/module/typechain/index.d.ts +1 -0
- package/dist/module/typechain/index.d.ts.map +1 -0
- package/dist/{umd/typechain/index.d.ts → module/typechain/index.js} +1 -8
- package/dist/module/typechain/index.js.map +1 -0
- package/dist/module/types.d.ts +1 -0
- package/dist/module/types.d.ts.map +1 -0
- package/dist/module/types.js +2 -0
- package/dist/module/types.js.map +1 -0
- package/dist/module/utils.d.ts +23 -0
- package/dist/module/utils.d.ts.map +1 -0
- package/dist/module/utils.js +153 -0
- package/dist/module/utils.js.map +1 -0
- package/dist/module/validation.d.ts +1 -0
- package/dist/module/validation.d.ts.map +1 -0
- package/dist/module/validation.js +92 -0
- package/dist/module/validation.js.map +1 -0
- package/package.json +48 -34
- package/dist/umd/BatchCall.d.ts +0 -53
- package/dist/umd/ConstantFlowAgreementV1.d.ts +0 -74
- package/dist/umd/Framework.d.ts +0 -75
- package/dist/umd/Host.d.ts +0 -18
- package/dist/umd/InstantDistributionAgreementV1.d.ts +0 -107
- package/dist/umd/Operation.d.ts +0 -38
- package/dist/umd/Query.d.ts +0 -31
- package/dist/umd/SFError.d.ts +0 -13
- package/dist/umd/SuperToken.d.ts +0 -191
- package/dist/umd/Token.d.ts +0 -76
- package/dist/umd/constants.d.ts +0 -10
- package/dist/umd/events.d.ts +0 -255
- package/dist/umd/frameworkHelpers.d.ts +0 -20
- package/dist/umd/index.d.ts +0 -19
- package/dist/umd/index.js +0 -7526
- package/dist/umd/interfaces.d.ts +0 -304
- package/dist/umd/mapGetAllEventsQueryEvents.d.ts +0 -3
- package/dist/umd/ordering.d.ts +0 -13
- package/dist/umd/pagination.d.ts +0 -65
- package/dist/umd/subgraph/SubgraphClient.d.ts +0 -16
- package/dist/umd/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +0 -45
- package/dist/umd/subgraph/queries/getAllEvents.generated.d.ts +0 -651
- package/dist/umd/subgraph/queries/getIndexSubscriptions.generated.d.ts +0 -46
- package/dist/umd/subgraph/queries/getIndexes.generated.d.ts +0 -44
- package/dist/umd/subgraph/queries/getStreams.generated.d.ts +0 -58
- package/dist/umd/subgraph/queries/getTokens.generated.d.ts +0 -27
- package/dist/umd/subgraph/schema.generated.d.ts +0 -6478
- package/dist/umd/typechain/ERC20WithTokenInfo.d.ts +0 -159
- package/dist/umd/typechain/IConstantFlowAgreementV1.d.ts +0 -305
- package/dist/umd/typechain/IInstantDistributionAgreementV1.d.ts +0 -585
- package/dist/umd/typechain/IResolver.d.ts +0 -57
- package/dist/umd/typechain/SuperToken.d.ts +0 -1011
- package/dist/umd/typechain/Superfluid.d.ts +0 -780
- package/dist/umd/typechain/SuperfluidLoader.d.ts +0 -55
- package/dist/umd/typechain/TestToken.d.ts +0 -207
- package/dist/umd/typechain/common.d.ts +0 -21
- package/dist/umd/typechain/factories/ERC20WithTokenInfo__factory.d.ts +0 -35
- package/dist/umd/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +0 -35
- package/dist/umd/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +0 -35
- package/dist/umd/typechain/factories/IResolver__factory.d.ts +0 -22
- package/dist/umd/typechain/factories/SuperToken__factory.d.ts +0 -46
- package/dist/umd/typechain/factories/SuperfluidLoader__factory.d.ts +0 -37
- package/dist/umd/typechain/factories/Superfluid__factory.d.ts +0 -82
- package/dist/umd/typechain/factories/TestToken__factory.d.ts +0 -46
- package/dist/umd/types.d.ts +0 -2
- package/dist/umd/utils.d.ts +0 -89
- package/dist/umd/validation.d.ts +0 -8
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import Host from "./Host";
|
|
3
|
+
import SFError from "./SFError";
|
|
4
|
+
import IInstantDistributionAgreementV1ABI from "./abi/IInstantDistributionAgreementV1.json";
|
|
5
|
+
import { normalizeAddress } from "./utils";
|
|
6
|
+
const idaInterface = new ethers.utils.Interface(IInstantDistributionAgreementV1ABI.abi);
|
|
7
|
+
/**
|
|
8
|
+
* @dev Instant Distribution Agreement V1 Helper Class
|
|
9
|
+
* @description A helper class to interact with the IDAV1 contract.
|
|
10
|
+
*/
|
|
11
|
+
export default class InstantDistributionAgreementV1 {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
// IDA Read Functions
|
|
14
|
+
/**
|
|
15
|
+
* @dev Get the details of a `Subscription`.
|
|
16
|
+
* @param superToken the superToken of the agreement
|
|
17
|
+
* @param publisher the address of the publisher of the index
|
|
18
|
+
* @param indexId the index id
|
|
19
|
+
* @param subscriber the subscriber's address
|
|
20
|
+
* @param providerOrSigner a provider or signer object
|
|
21
|
+
* @returns {Promise<IWeb3Subscription>} Web3 Subscription object
|
|
22
|
+
*/
|
|
23
|
+
this.getSubscription = async ({ superToken, publisher, indexId, subscriber, providerOrSigner, }) => {
|
|
24
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
25
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
26
|
+
const normalizedSubscriber = normalizeAddress(subscriber);
|
|
27
|
+
try {
|
|
28
|
+
const subscription = await this.idaContract
|
|
29
|
+
.connect(providerOrSigner)
|
|
30
|
+
.getSubscription(normalizedToken, normalizedPublisher, indexId, normalizedSubscriber);
|
|
31
|
+
return {
|
|
32
|
+
exist: subscription.exist,
|
|
33
|
+
approved: subscription.approved,
|
|
34
|
+
units: subscription.units.toString(),
|
|
35
|
+
pendingDistribution: subscription.pendingDistribution.toString(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
throw new SFError({
|
|
40
|
+
type: "IDAV1_READ",
|
|
41
|
+
customMessage: "There was an error getting the subscription",
|
|
42
|
+
errorObject: err,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @dev Get the details of an `Index`.
|
|
48
|
+
* @param superToken the superToken of the agreement
|
|
49
|
+
* @param publisher the address of the publisher of the index
|
|
50
|
+
* @param indexId the index id
|
|
51
|
+
* @param providerOrSigner a provider or signer object
|
|
52
|
+
* @returns {Promise<IWeb3Index>} Web3 Index object
|
|
53
|
+
*/
|
|
54
|
+
this.getIndex = async ({ superToken, publisher, indexId, providerOrSigner, }) => {
|
|
55
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
56
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
57
|
+
try {
|
|
58
|
+
const index = await this.idaContract
|
|
59
|
+
.connect(providerOrSigner)
|
|
60
|
+
.getIndex(normalizedToken, normalizedPublisher, indexId);
|
|
61
|
+
return {
|
|
62
|
+
exist: index.exist,
|
|
63
|
+
indexValue: index.indexValue.toString(),
|
|
64
|
+
totalUnitsApproved: index.totalUnitsApproved.toString(),
|
|
65
|
+
totalUnitsPending: index.totalUnitsPending.toString(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
throw new SFError({
|
|
70
|
+
type: "IDAV1_READ",
|
|
71
|
+
customMessage: "There was an error getting the index",
|
|
72
|
+
errorObject: err,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// IDA Write Functions
|
|
77
|
+
/**
|
|
78
|
+
* @dev Creates an IDA Index.
|
|
79
|
+
* @param indexId The id of the index.
|
|
80
|
+
* @param superToken The address of the `index` superToken.
|
|
81
|
+
* @param userData Extra user data provided.
|
|
82
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
83
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
84
|
+
*/
|
|
85
|
+
this.createIndex = ({ indexId, superToken, userData, overrides, }) => {
|
|
86
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
87
|
+
const callData = idaInterface.encodeFunctionData("createIndex", [
|
|
88
|
+
normalizedToken,
|
|
89
|
+
indexId,
|
|
90
|
+
"0x",
|
|
91
|
+
]);
|
|
92
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* @dev Distributes `amount` of `superToken` to an index
|
|
96
|
+
* @param indexId The id of the index.
|
|
97
|
+
* @param amount The amount of `superToken` to be distributed.
|
|
98
|
+
* @param superToken The superToken to be distributed.
|
|
99
|
+
* @param userData Extra user data provided.
|
|
100
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
101
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
102
|
+
*/
|
|
103
|
+
this.distribute = ({ indexId, amount, superToken, userData, overrides, }) => {
|
|
104
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
105
|
+
const callData = idaInterface.encodeFunctionData("distribute", [
|
|
106
|
+
normalizedToken,
|
|
107
|
+
indexId,
|
|
108
|
+
amount,
|
|
109
|
+
"0x",
|
|
110
|
+
]);
|
|
111
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* @dev Updates the `indexValue` of an index.
|
|
115
|
+
* @description NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
|
|
116
|
+
* @param indexId The id of the index.
|
|
117
|
+
* @param indexValue The new indexValue.
|
|
118
|
+
* @param superToken The superToken to be distributed.
|
|
119
|
+
* @param userData Extra user data provided.
|
|
120
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
121
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
122
|
+
*/
|
|
123
|
+
this.updateIndexValue = ({ indexId, indexValue, superToken, userData, overrides, }) => {
|
|
124
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
125
|
+
const callData = idaInterface.encodeFunctionData("updateIndex", [
|
|
126
|
+
normalizedToken,
|
|
127
|
+
indexId,
|
|
128
|
+
indexValue,
|
|
129
|
+
"0x",
|
|
130
|
+
]);
|
|
131
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @dev Updates the `units` allocated to a Subscription.
|
|
135
|
+
* @param indexId The id of the index.
|
|
136
|
+
* @param superToken The superToken of the index.
|
|
137
|
+
* @param subscriber The subscriber address whose units you want to update.
|
|
138
|
+
* @param units The amount of units you want to update to.
|
|
139
|
+
* @param userData Extra user data provided.
|
|
140
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
141
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
142
|
+
*/
|
|
143
|
+
this.updateSubscriptionUnits = ({ indexId, superToken, subscriber, units, userData, overrides, }) => {
|
|
144
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
145
|
+
const normalizedSubscriber = normalizeAddress(subscriber);
|
|
146
|
+
const callData = idaInterface.encodeFunctionData("updateSubscription", [
|
|
147
|
+
normalizedToken,
|
|
148
|
+
indexId,
|
|
149
|
+
normalizedSubscriber,
|
|
150
|
+
units,
|
|
151
|
+
"0x",
|
|
152
|
+
]);
|
|
153
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* @dev Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
|
|
157
|
+
* @param indexId The id of the index.
|
|
158
|
+
* @param superToken The superToken of the index.
|
|
159
|
+
* @param publisher The publisher of the index you want to approve.
|
|
160
|
+
* @param userData Extra user data provided.
|
|
161
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
162
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
163
|
+
*/
|
|
164
|
+
this.approveSubscription = ({ indexId, superToken, publisher, userData, overrides, }) => {
|
|
165
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
166
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
167
|
+
const callData = idaInterface.encodeFunctionData("approveSubscription", [normalizedToken, normalizedPublisher, indexId, "0x"]);
|
|
168
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* @dev Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
|
|
172
|
+
* @param indexId The id of the index.
|
|
173
|
+
* @param superToken The superToken of the index.
|
|
174
|
+
* @param subscriber The subscriber address whose subscription you want to revoke.
|
|
175
|
+
* @param userData Extra user data provided.
|
|
176
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
177
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
178
|
+
*/
|
|
179
|
+
this.revokeSubscription = ({ indexId, superToken, publisher, userData, overrides, }) => {
|
|
180
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
181
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
182
|
+
const callData = idaInterface.encodeFunctionData("revokeSubscription", [
|
|
183
|
+
normalizedToken,
|
|
184
|
+
normalizedPublisher,
|
|
185
|
+
indexId,
|
|
186
|
+
"0x",
|
|
187
|
+
]);
|
|
188
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* @dev Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
|
|
192
|
+
* @param indexId The id of the index.
|
|
193
|
+
* @param superToken The superToken of the index.
|
|
194
|
+
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
195
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
196
|
+
* @param userData Extra user data provided.
|
|
197
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
198
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
199
|
+
*/
|
|
200
|
+
this.deleteSubscription = ({ indexId, superToken, subscriber, publisher, userData, overrides, }) => {
|
|
201
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
202
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
203
|
+
const normalizedSubscriber = normalizeAddress(subscriber);
|
|
204
|
+
const callData = idaInterface.encodeFunctionData("deleteSubscription", [
|
|
205
|
+
normalizedToken,
|
|
206
|
+
normalizedPublisher,
|
|
207
|
+
indexId,
|
|
208
|
+
normalizedSubscriber,
|
|
209
|
+
"0x",
|
|
210
|
+
]);
|
|
211
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* @dev Claims any pending tokens allocated to the Subscription (unapproved).
|
|
215
|
+
* @param indexId The id of the index.
|
|
216
|
+
* @param superToken The superToken of the index.
|
|
217
|
+
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
218
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
219
|
+
* @param userData Extra user data provided.
|
|
220
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
221
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
222
|
+
*/
|
|
223
|
+
this.claim = ({ indexId, superToken, subscriber, publisher, userData, overrides, }) => {
|
|
224
|
+
const normalizedPublisher = normalizeAddress(publisher);
|
|
225
|
+
const normalizedToken = normalizeAddress(superToken);
|
|
226
|
+
const normalizedSubscriber = normalizeAddress(subscriber);
|
|
227
|
+
const callData = idaInterface.encodeFunctionData("claim", [
|
|
228
|
+
normalizedToken,
|
|
229
|
+
normalizedPublisher,
|
|
230
|
+
indexId,
|
|
231
|
+
normalizedSubscriber,
|
|
232
|
+
"0x",
|
|
233
|
+
]);
|
|
234
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
235
|
+
};
|
|
236
|
+
this.options = options;
|
|
237
|
+
this.host = new Host(options.config.hostAddress);
|
|
238
|
+
}
|
|
239
|
+
get idaContract() {
|
|
240
|
+
return new ethers.Contract(this.options.config.idaV1Address, IInstantDistributionAgreementV1ABI.abi);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=InstantDistributionAgreementV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstantDistributionAgreementV1.js","sourceRoot":"","sources":["../../src/InstantDistributionAgreementV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,kCAAkC,MAAM,4CAA4C,CAAC;AAiB5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,YAAY,GAAG,IAAI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AAM,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,IAAY,WAAW;QACnB,OAAO,IAAI,MAAM,CAAC,QAAQ,CACtB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAChC,kCAAkC,CAAC,GAAG,CACN,CAAC;IACzC,CAAC;CAiWJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,oBAAY,aAAa,GACnB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,sBAAsB,GACtB,2BAA2B,GAC3B,iBAAiB,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;gBAGzB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,EACzC,IAAI,EAAE,aAAa;IAMvB;;;;;OAKG;IACH,IAAI,WACQ,OAAO,MAAM,KACtB,QAAQ,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAY9C;IAEF;;;;OAIG;IACH,8BAA8B,WAClB,OAAO,MAAM,KACtB,QAAQ,kBAAkB,CAAC,CAY5B;IACF;;;;OAIG;IACH,oBAAoB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAenE;IAEF;;;;;OAKG;IACH,kBAAkB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAGjE;CACL"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import SFError from "./SFError";
|
|
3
|
+
/**
|
|
4
|
+
* @dev Operation Helper Class
|
|
5
|
+
* @description A helper class to create `Operation` objects which can be executed or batched.
|
|
6
|
+
*/
|
|
7
|
+
export default class Operation {
|
|
8
|
+
constructor(txn, type) {
|
|
9
|
+
/**
|
|
10
|
+
* @dev Executes the operation via the provided signer.
|
|
11
|
+
* @description Populates all fields of the transaction, signs it and sends it to the network.
|
|
12
|
+
* @param signer The signer of the transacation
|
|
13
|
+
* @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
|
|
14
|
+
*/
|
|
15
|
+
this.exec = async (signer) => {
|
|
16
|
+
try {
|
|
17
|
+
const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
|
|
18
|
+
return await signer.sendTransaction(populatedTransaction);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
throw new SFError({
|
|
22
|
+
type: "EXECUTE_TRANSACTION",
|
|
23
|
+
customMessage: "There was an error executing the transaction",
|
|
24
|
+
errorObject: err,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @dev Get the populated transaction by awaiting `populateTransactionPromise`.
|
|
30
|
+
* @description Note that we need to populate the txn with the signer.
|
|
31
|
+
* @returns {Promise<TransactionRequest>}
|
|
32
|
+
*/
|
|
33
|
+
this.getPopulatedTransactionRequest = async (signer) => {
|
|
34
|
+
try {
|
|
35
|
+
const prePopulated = await this.populateTransactionPromise;
|
|
36
|
+
return await signer.populateTransaction(prePopulated);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
/* istanbul ignore next */
|
|
40
|
+
throw new SFError({
|
|
41
|
+
type: "POPULATE_TRANSACTION",
|
|
42
|
+
customMessage: "There was an error populating the transaction",
|
|
43
|
+
errorObject: err,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @dev Signs the populated transaction via the provided signer (what you intend on sending to the network).
|
|
49
|
+
* @param signer The signer of the transacation
|
|
50
|
+
* @returns {Promise<string>} Fully serialized, signed transaction
|
|
51
|
+
*/
|
|
52
|
+
this.getSignedTransaction = async (signer) => {
|
|
53
|
+
try {
|
|
54
|
+
const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
|
|
55
|
+
const signedTxn = await signer.signTransaction(populatedTransaction);
|
|
56
|
+
return signedTxn;
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
throw new SFError({
|
|
60
|
+
type: "SIGN_TRANSACTION",
|
|
61
|
+
customMessage: "There was an error signing the transaction",
|
|
62
|
+
errorObject: err,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @dev Gets the transaction hash of the transaction.
|
|
68
|
+
* @description Calculates this by getting the keccak256 hash of the signedTxn.
|
|
69
|
+
* @param signer The signer of the transacation
|
|
70
|
+
* @returns {Promise<string>} The transaction hash of the transaction
|
|
71
|
+
*/
|
|
72
|
+
this.getTransactionHash = async (signer) => {
|
|
73
|
+
const signedTxn = await this.getSignedTransaction(signer);
|
|
74
|
+
return ethers.utils.keccak256(signedTxn);
|
|
75
|
+
};
|
|
76
|
+
this.populateTransactionPromise = txn;
|
|
77
|
+
this.type = type;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=Operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,OAAO,MAAM,WAAW,CAAC;AAWhC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAI1B,YACI,GAAyC,EACzC,IAAmB;QAMvB;;;;;WAKG;QACH,SAAI,GAAG,KAAK,EACR,MAAqB,EACwB,EAAE;YAC/C,IAAI;gBACA,MAAM,oBAAoB,GACtB,MAAM,IAAI,CAAC,8BAA8B,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C,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC;QA7EE,IAAI,CAAC,0BAA0B,GAAG,GAAG,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CA4EJ"}
|
package/dist/module/Query.d.ts
CHANGED
|
@@ -29,3 +29,4 @@ export default class Query {
|
|
|
29
29
|
listEvents: (filter: IEventFilter, paging?: Paging, ordering?: Ordering<Event_OrderBy>) => Promise<PagedResult<AllEvents>>;
|
|
30
30
|
on(callback: (events: AllEvents[], unsubscribe: () => void) => void, ms: number, account?: string, timeout?: number): () => void;
|
|
31
31
|
}
|
|
32
|
+
//# sourceMappingURL=Query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EACH,2BAA2B,EAC3B,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,+BAA+B,EAC/B,0BAA0B,EAC1B,YAAY,EACZ,OAAO,EACP,oBAAoB,EACpB,WAAW,EACX,wBAAwB,EAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAIH,WAAW,EACX,MAAM,EAET,MAAM,cAAc,CAAC;AAgCtB,OAAO,EACH,4BAA4B,EAC5B,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,cAAc,EACd,aAAa,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUnC,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC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