@superfluid-finance/sdk-core 0.1.1-dev.8caff13.0 → 0.1.1-dev.b8d3bbf.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 +37 -11
- package/dist/index.umd.js +45852 -0
- package/dist/main/BatchCall.d.ts +1 -0
- 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 +177 -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 +310 -0
- package/dist/main/Query.js.map +1 -0
- package/dist/main/SFError.d.ts +1 -0
- 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 +396 -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 +2 -1
- 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 +89 -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 -7597
- package/dist/main/index.js.map +1 -0
- package/dist/main/interfaces.d.ts +100 -10
- 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 +7 -6
- 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 +1 -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 +1 -0
- 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 +6 -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 +1 -0
- 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 +171 -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 +304 -0
- package/dist/module/Query.js.map +1 -0
- package/dist/module/SFError.d.ts +1 -0
- 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 +390 -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 +2 -1
- 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 +80 -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 -7561
- package/dist/module/index.js.map +1 -0
- package/dist/module/interfaces.d.ts +100 -10
- 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 +7 -6
- 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 +1 -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 +1 -0
- 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 +6 -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 +29 -15
- 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 -17
- 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 -7599
- 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 -71
- 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 -215
- 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 -35
- 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 -106
- package/dist/umd/validation.d.ts +0 -8
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ethers_1 = require("ethers");
|
|
7
|
+
const Operation_1 = __importDefault(require("./Operation"));
|
|
8
|
+
const Superfluid_json_1 = __importDefault(require("./abi/Superfluid.json"));
|
|
9
|
+
/**
|
|
10
|
+
* @dev Host Helper Class
|
|
11
|
+
* @description A helper class which can be used as a standalone class to populate call agreement transactions.
|
|
12
|
+
*/
|
|
13
|
+
class Host {
|
|
14
|
+
constructor(hostAddress) {
|
|
15
|
+
/**
|
|
16
|
+
* @dev Creates an Operation of the `callAgreement` function on the host contract.
|
|
17
|
+
* @param agreementAddress the agreement address (cfa or ida address)
|
|
18
|
+
* @param callData the encoded callData for the function
|
|
19
|
+
* @param userData any additional user data
|
|
20
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
21
|
+
* @returns {Operation} an `Operation` class
|
|
22
|
+
*/
|
|
23
|
+
this.populateCallAgreementTxnAndReturnOperation = (agreementAddress, callData, userData, overrides) => {
|
|
24
|
+
const txn = this.hostContract.populateTransaction.callAgreement(agreementAddress, callData, userData || "0x", overrides || {});
|
|
25
|
+
return new Operation_1.default(txn, "SUPERFLUID_CALL_AGREEMENT");
|
|
26
|
+
};
|
|
27
|
+
this.hostContract = new ethers_1.ethers.Contract(hostAddress, Superfluid_json_1.default.abi);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = Host;
|
|
31
|
+
//# sourceMappingURL=Host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Host.js","sourceRoot":"","sources":["../../src/Host.ts"],"names":[],"mappings":";;;;;AAAA,mCAA2C;AAE3C,4DAAoC;AACpC,4EAAkD;AAGlD;;;GAGG;AACH,MAAqB,IAAI;IAGrB,YAAY,WAAmB;QAO/B;;;;;;;WAOG;QACH,+CAA0C,GAAG,CACzC,gBAAwB,EACxB,QAAgB,EAChB,QAA4B,EAC5B,SAA2D,EAClD,EAAE;YACX,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,aAAa,CAC3D,gBAAgB,EAChB,QAAQ,EACR,QAAQ,IAAI,IAAI,EAChB,SAAS,IAAI,EAAE,CAClB,CAAC;YACF,OAAO,IAAI,mBAAS,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;QAC3D,CAAC,CAAC;QA3BE,IAAI,CAAC,YAAY,GAAG,IAAI,eAAM,CAAC,QAAQ,CACnC,WAAW,EACX,yBAAa,CAAC,GAAG,CACN,CAAC;IACpB,CAAC;CAwBJ;AAhCD,uBAgCC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Host from "./Host";
|
|
2
2
|
import Operation from "./Operation";
|
|
3
|
-
import { IAgreementV1Options,
|
|
3
|
+
import { IAgreementV1Options, IApproveSubscriptionParams, IClaimParams, ICreateIndexParams, IDeleteSubscriptionParams, IDistributeParams, IGetIndexParams, IGetSubscriptionParams, IRevokeSubscriptionParams, IUpdateIndexValueParams, IUpdateSubscriptionUnitsParams, IWeb3Index, IWeb3Subscription } from "./interfaces";
|
|
4
4
|
/**
|
|
5
5
|
* @dev Instant Distribution Agreement V1 Helper Class
|
|
6
6
|
* @description A helper class to interact with the IDAV1 contract.
|
|
@@ -34,18 +34,20 @@ export default class InstantDistributionAgreementV1 {
|
|
|
34
34
|
* @param indexId The id of the index.
|
|
35
35
|
* @param superToken The address of the `index` superToken.
|
|
36
36
|
* @param userData Extra user data provided.
|
|
37
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
37
38
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
38
39
|
*/
|
|
39
|
-
createIndex: ({ indexId, superToken, userData, }:
|
|
40
|
+
createIndex: ({ indexId, superToken, userData, overrides, }: ICreateIndexParams) => Operation;
|
|
40
41
|
/**
|
|
41
42
|
* @dev Distributes `amount` of `superToken` to an index
|
|
42
43
|
* @param indexId The id of the index.
|
|
43
44
|
* @param amount The amount of `superToken` to be distributed.
|
|
44
45
|
* @param superToken The superToken to be distributed.
|
|
45
46
|
* @param userData Extra user data provided.
|
|
47
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
46
48
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
47
49
|
*/
|
|
48
|
-
distribute: ({ indexId, amount, superToken, userData, }: IDistributeParams) => Operation;
|
|
50
|
+
distribute: ({ indexId, amount, superToken, userData, overrides, }: IDistributeParams) => Operation;
|
|
49
51
|
/**
|
|
50
52
|
* @dev Updates the `indexValue` of an index.
|
|
51
53
|
* @description NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
|
|
@@ -53,9 +55,10 @@ export default class InstantDistributionAgreementV1 {
|
|
|
53
55
|
* @param indexValue The new indexValue.
|
|
54
56
|
* @param superToken The superToken to be distributed.
|
|
55
57
|
* @param userData Extra user data provided.
|
|
58
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
56
59
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
57
60
|
*/
|
|
58
|
-
updateIndexValue: ({ indexId, indexValue, superToken, userData, }: IUpdateIndexValueParams) => Operation;
|
|
61
|
+
updateIndexValue: ({ indexId, indexValue, superToken, userData, overrides, }: IUpdateIndexValueParams) => Operation;
|
|
59
62
|
/**
|
|
60
63
|
* @dev Updates the `units` allocated to a Subscription.
|
|
61
64
|
* @param indexId The id of the index.
|
|
@@ -63,27 +66,30 @@ export default class InstantDistributionAgreementV1 {
|
|
|
63
66
|
* @param subscriber The subscriber address whose units you want to update.
|
|
64
67
|
* @param units The amount of units you want to update to.
|
|
65
68
|
* @param userData Extra user data provided.
|
|
69
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
66
70
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
67
71
|
*/
|
|
68
|
-
updateSubscriptionUnits: ({ indexId, superToken, subscriber, units, userData, }: IUpdateSubscriptionUnitsParams) => Operation;
|
|
72
|
+
updateSubscriptionUnits: ({ indexId, superToken, subscriber, units, userData, overrides, }: IUpdateSubscriptionUnitsParams) => Operation;
|
|
69
73
|
/**
|
|
70
74
|
* @dev Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
|
|
71
75
|
* @param indexId The id of the index.
|
|
72
76
|
* @param superToken The superToken of the index.
|
|
73
77
|
* @param publisher The publisher of the index you want to approve.
|
|
74
78
|
* @param userData Extra user data provided.
|
|
79
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
75
80
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
76
81
|
*/
|
|
77
|
-
approveSubscription: ({ indexId, superToken, publisher, userData, }:
|
|
82
|
+
approveSubscription: ({ indexId, superToken, publisher, userData, overrides, }: IApproveSubscriptionParams) => Operation;
|
|
78
83
|
/**
|
|
79
84
|
* @dev Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
|
|
80
85
|
* @param indexId The id of the index.
|
|
81
86
|
* @param superToken The superToken of the index.
|
|
82
87
|
* @param subscriber The subscriber address whose subscription you want to revoke.
|
|
83
88
|
* @param userData Extra user data provided.
|
|
89
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
84
90
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
85
91
|
*/
|
|
86
|
-
revokeSubscription: ({ indexId, superToken, publisher, userData, }:
|
|
92
|
+
revokeSubscription: ({ indexId, superToken, publisher, userData, overrides, }: IRevokeSubscriptionParams) => Operation;
|
|
87
93
|
/**
|
|
88
94
|
* @dev Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
|
|
89
95
|
* @param indexId The id of the index.
|
|
@@ -91,9 +97,10 @@ export default class InstantDistributionAgreementV1 {
|
|
|
91
97
|
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
92
98
|
* @param publisher The publisher address of the index you are targetting.
|
|
93
99
|
* @param userData Extra user data provided.
|
|
100
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
94
101
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
95
102
|
*/
|
|
96
|
-
deleteSubscription: ({ indexId, superToken, subscriber, publisher, userData, }:
|
|
103
|
+
deleteSubscription: ({ indexId, superToken, subscriber, publisher, userData, overrides, }: IDeleteSubscriptionParams) => Operation;
|
|
97
104
|
/**
|
|
98
105
|
* @dev Claims any pending tokens allocated to the Subscription (unapproved).
|
|
99
106
|
* @param indexId The id of the index.
|
|
@@ -101,7 +108,9 @@ export default class InstantDistributionAgreementV1 {
|
|
|
101
108
|
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
102
109
|
* @param publisher The publisher address of the index you are targetting.
|
|
103
110
|
* @param userData Extra user data provided.
|
|
111
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
104
112
|
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
105
113
|
*/
|
|
106
|
-
claim: ({ indexId, superToken, subscriber, publisher, userData, }:
|
|
114
|
+
claim: ({ indexId, superToken, subscriber, publisher, userData, overrides, }: IClaimParams) => Operation;
|
|
107
115
|
}
|
|
116
|
+
//# sourceMappingURL=InstantDistributionAgreementV1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstantDistributionAgreementV1.d.ts","sourceRoot":"","sources":["../../src/InstantDistributionAgreementV1.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,UAAU,EACV,iBAAiB,EACpB,MAAM,cAAc,CAAC;AAQtB;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,8BAA8B;IAC/C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;gBAER,OAAO,EAAE,mBAAmB;IAKxC,OAAO,KAAK,WAAW,GAKtB;IAID;;;;;;;;OAQG;IACH,eAAe,sEAMZ,sBAAsB,KAAG,QAAQ,iBAAiB,CAAC,CA4BpD;IAEF;;;;;;;OAOG;IACH,QAAQ,0DAKL,eAAe,KAAG,QAAQ,UAAU,CAAC,CAoBtC;IAIF;;;;;;;OAOG;IACH,WAAW,kDAKR,kBAAkB,KAAG,SAAS,CAc/B;IAEF;;;;;;;;OAQG;IACH,UAAU,0DAMP,iBAAiB,KAAG,SAAS,CAe9B;IAEF;;;;;;;;;OASG;IACH,gBAAgB,8DAMb,uBAAuB,KAAG,SAAS,CAepC;IAEF;;;;;;;;;OASG;IACH,uBAAuB,qEAOpB,8BAA8B,KAAG,SAAS,CAiB3C;IAEF;;;;;;;;OAQG;IACH,mBAAmB,6DAMhB,0BAA0B,KAAG,SAAS,CAcvC;IAEF;;;;;;;;OAQG;IACH,kBAAkB,6DAMf,yBAAyB,KAAG,SAAS,CAgBtC;IAEF;;;;;;;;;OASG;IACH,kBAAkB,yEAOf,yBAAyB,KAAG,SAAS,CAkBtC;IAEF;;;;;;;;;OASG;IACH,KAAK,yEAOF,YAAY,KAAG,SAAS,CAkBzB;CACL"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ethers_1 = require("ethers");
|
|
7
|
+
const Host_1 = __importDefault(require("./Host"));
|
|
8
|
+
const SFError_1 = __importDefault(require("./SFError"));
|
|
9
|
+
const IInstantDistributionAgreementV1_json_1 = __importDefault(require("./abi/IInstantDistributionAgreementV1.json"));
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const idaInterface = new ethers_1.ethers.utils.Interface(IInstantDistributionAgreementV1_json_1.default.abi);
|
|
12
|
+
/**
|
|
13
|
+
* @dev Instant Distribution Agreement V1 Helper Class
|
|
14
|
+
* @description A helper class to interact with the IDAV1 contract.
|
|
15
|
+
*/
|
|
16
|
+
class InstantDistributionAgreementV1 {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
// IDA Read Functions
|
|
19
|
+
/**
|
|
20
|
+
* @dev Get the details of a `Subscription`.
|
|
21
|
+
* @param superToken the superToken of the agreement
|
|
22
|
+
* @param publisher the address of the publisher of the index
|
|
23
|
+
* @param indexId the index id
|
|
24
|
+
* @param subscriber the subscriber's address
|
|
25
|
+
* @param providerOrSigner a provider or signer object
|
|
26
|
+
* @returns {Promise<IWeb3Subscription>} Web3 Subscription object
|
|
27
|
+
*/
|
|
28
|
+
this.getSubscription = async ({ superToken, publisher, indexId, subscriber, providerOrSigner, }) => {
|
|
29
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
30
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
31
|
+
const normalizedSubscriber = (0, utils_1.normalizeAddress)(subscriber);
|
|
32
|
+
try {
|
|
33
|
+
const subscription = await this.idaContract
|
|
34
|
+
.connect(providerOrSigner)
|
|
35
|
+
.getSubscription(normalizedToken, normalizedPublisher, indexId, normalizedSubscriber);
|
|
36
|
+
return {
|
|
37
|
+
exist: subscription.exist,
|
|
38
|
+
approved: subscription.approved,
|
|
39
|
+
units: subscription.units.toString(),
|
|
40
|
+
pendingDistribution: subscription.pendingDistribution.toString(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
throw new SFError_1.default({
|
|
45
|
+
type: "IDAV1_READ",
|
|
46
|
+
customMessage: "There was an error getting the subscription",
|
|
47
|
+
errorObject: err,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @dev Get the details of an `Index`.
|
|
53
|
+
* @param superToken the superToken of the agreement
|
|
54
|
+
* @param publisher the address of the publisher of the index
|
|
55
|
+
* @param indexId the index id
|
|
56
|
+
* @param providerOrSigner a provider or signer object
|
|
57
|
+
* @returns {Promise<IWeb3Index>} Web3 Index object
|
|
58
|
+
*/
|
|
59
|
+
this.getIndex = async ({ superToken, publisher, indexId, providerOrSigner, }) => {
|
|
60
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
61
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
62
|
+
try {
|
|
63
|
+
const index = await this.idaContract
|
|
64
|
+
.connect(providerOrSigner)
|
|
65
|
+
.getIndex(normalizedToken, normalizedPublisher, indexId);
|
|
66
|
+
return {
|
|
67
|
+
exist: index.exist,
|
|
68
|
+
indexValue: index.indexValue.toString(),
|
|
69
|
+
totalUnitsApproved: index.totalUnitsApproved.toString(),
|
|
70
|
+
totalUnitsPending: index.totalUnitsPending.toString(),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
throw new SFError_1.default({
|
|
75
|
+
type: "IDAV1_READ",
|
|
76
|
+
customMessage: "There was an error getting the index",
|
|
77
|
+
errorObject: err,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
// IDA Write Functions
|
|
82
|
+
/**
|
|
83
|
+
* @dev Creates an IDA Index.
|
|
84
|
+
* @param indexId The id of the index.
|
|
85
|
+
* @param superToken The address of the `index` superToken.
|
|
86
|
+
* @param userData Extra user data provided.
|
|
87
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
88
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
89
|
+
*/
|
|
90
|
+
this.createIndex = ({ indexId, superToken, userData, overrides, }) => {
|
|
91
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
92
|
+
const callData = idaInterface.encodeFunctionData("createIndex", [
|
|
93
|
+
normalizedToken,
|
|
94
|
+
indexId,
|
|
95
|
+
"0x",
|
|
96
|
+
]);
|
|
97
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @dev Distributes `amount` of `superToken` to an index
|
|
101
|
+
* @param indexId The id of the index.
|
|
102
|
+
* @param amount The amount of `superToken` to be distributed.
|
|
103
|
+
* @param superToken The superToken to be distributed.
|
|
104
|
+
* @param userData Extra user data provided.
|
|
105
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
106
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
107
|
+
*/
|
|
108
|
+
this.distribute = ({ indexId, amount, superToken, userData, overrides, }) => {
|
|
109
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
110
|
+
const callData = idaInterface.encodeFunctionData("distribute", [
|
|
111
|
+
normalizedToken,
|
|
112
|
+
indexId,
|
|
113
|
+
amount,
|
|
114
|
+
"0x",
|
|
115
|
+
]);
|
|
116
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* @dev Updates the `indexValue` of an index.
|
|
120
|
+
* @description NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
|
|
121
|
+
* @param indexId The id of the index.
|
|
122
|
+
* @param indexValue The new indexValue.
|
|
123
|
+
* @param superToken The superToken to be distributed.
|
|
124
|
+
* @param userData Extra user data provided.
|
|
125
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
126
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
127
|
+
*/
|
|
128
|
+
this.updateIndexValue = ({ indexId, indexValue, superToken, userData, overrides, }) => {
|
|
129
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
130
|
+
const callData = idaInterface.encodeFunctionData("updateIndex", [
|
|
131
|
+
normalizedToken,
|
|
132
|
+
indexId,
|
|
133
|
+
indexValue,
|
|
134
|
+
"0x",
|
|
135
|
+
]);
|
|
136
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* @dev Updates the `units` allocated to a Subscription.
|
|
140
|
+
* @param indexId The id of the index.
|
|
141
|
+
* @param superToken The superToken of the index.
|
|
142
|
+
* @param subscriber The subscriber address whose units you want to update.
|
|
143
|
+
* @param units The amount of units you want to update to.
|
|
144
|
+
* @param userData Extra user data provided.
|
|
145
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
146
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
147
|
+
*/
|
|
148
|
+
this.updateSubscriptionUnits = ({ indexId, superToken, subscriber, units, userData, overrides, }) => {
|
|
149
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
150
|
+
const normalizedSubscriber = (0, utils_1.normalizeAddress)(subscriber);
|
|
151
|
+
const callData = idaInterface.encodeFunctionData("updateSubscription", [
|
|
152
|
+
normalizedToken,
|
|
153
|
+
indexId,
|
|
154
|
+
normalizedSubscriber,
|
|
155
|
+
units,
|
|
156
|
+
"0x",
|
|
157
|
+
]);
|
|
158
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* @dev Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
|
|
162
|
+
* @param indexId The id of the index.
|
|
163
|
+
* @param superToken The superToken of the index.
|
|
164
|
+
* @param publisher The publisher of the index you want to approve.
|
|
165
|
+
* @param userData Extra user data provided.
|
|
166
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
167
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
168
|
+
*/
|
|
169
|
+
this.approveSubscription = ({ indexId, superToken, publisher, userData, overrides, }) => {
|
|
170
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
171
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
172
|
+
const callData = idaInterface.encodeFunctionData("approveSubscription", [normalizedToken, normalizedPublisher, indexId, "0x"]);
|
|
173
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* @dev Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
|
|
177
|
+
* @param indexId The id of the index.
|
|
178
|
+
* @param superToken The superToken of the index.
|
|
179
|
+
* @param subscriber The subscriber address whose subscription you want to revoke.
|
|
180
|
+
* @param userData Extra user data provided.
|
|
181
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
182
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
183
|
+
*/
|
|
184
|
+
this.revokeSubscription = ({ indexId, superToken, publisher, userData, overrides, }) => {
|
|
185
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
186
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
187
|
+
const callData = idaInterface.encodeFunctionData("revokeSubscription", [
|
|
188
|
+
normalizedToken,
|
|
189
|
+
normalizedPublisher,
|
|
190
|
+
indexId,
|
|
191
|
+
"0x",
|
|
192
|
+
]);
|
|
193
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* @dev Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
|
|
197
|
+
* @param indexId The id of the index.
|
|
198
|
+
* @param superToken The superToken of the index.
|
|
199
|
+
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
200
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
201
|
+
* @param userData Extra user data provided.
|
|
202
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
203
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
204
|
+
*/
|
|
205
|
+
this.deleteSubscription = ({ indexId, superToken, subscriber, publisher, userData, overrides, }) => {
|
|
206
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
207
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
208
|
+
const normalizedSubscriber = (0, utils_1.normalizeAddress)(subscriber);
|
|
209
|
+
const callData = idaInterface.encodeFunctionData("deleteSubscription", [
|
|
210
|
+
normalizedToken,
|
|
211
|
+
normalizedPublisher,
|
|
212
|
+
indexId,
|
|
213
|
+
normalizedSubscriber,
|
|
214
|
+
"0x",
|
|
215
|
+
]);
|
|
216
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* @dev Claims any pending tokens allocated to the Subscription (unapproved).
|
|
220
|
+
* @param indexId The id of the index.
|
|
221
|
+
* @param superToken The superToken of the index.
|
|
222
|
+
* @param subscriber The subscriber address whose subscription you want to delete.
|
|
223
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
224
|
+
* @param userData Extra user data provided.
|
|
225
|
+
* @param overrides ethers overrides object for more control over the transaction sent.
|
|
226
|
+
* @returns {Operation} An instance of Operation which can be executed or batched.
|
|
227
|
+
*/
|
|
228
|
+
this.claim = ({ indexId, superToken, subscriber, publisher, userData, overrides, }) => {
|
|
229
|
+
const normalizedPublisher = (0, utils_1.normalizeAddress)(publisher);
|
|
230
|
+
const normalizedToken = (0, utils_1.normalizeAddress)(superToken);
|
|
231
|
+
const normalizedSubscriber = (0, utils_1.normalizeAddress)(subscriber);
|
|
232
|
+
const callData = idaInterface.encodeFunctionData("claim", [
|
|
233
|
+
normalizedToken,
|
|
234
|
+
normalizedPublisher,
|
|
235
|
+
indexId,
|
|
236
|
+
normalizedSubscriber,
|
|
237
|
+
"0x",
|
|
238
|
+
]);
|
|
239
|
+
return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, userData, overrides);
|
|
240
|
+
};
|
|
241
|
+
this.options = options;
|
|
242
|
+
this.host = new Host_1.default(options.config.hostAddress);
|
|
243
|
+
}
|
|
244
|
+
get idaContract() {
|
|
245
|
+
return new ethers_1.ethers.Contract(this.options.config.idaV1Address, IInstantDistributionAgreementV1_json_1.default.abi);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.default = InstantDistributionAgreementV1;
|
|
249
|
+
//# sourceMappingURL=InstantDistributionAgreementV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstantDistributionAgreementV1.js","sourceRoot":"","sources":["../../src/InstantDistributionAgreementV1.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAEhC,kDAA0B;AAE1B,wDAAgC;AAChC,sHAA4F;AAiB5F,mC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EF;;;;;OAKG;IACH,kBAAkB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAGjE;CACL"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ethers_1 = require("ethers");
|
|
7
|
+
const SFError_1 = __importDefault(require("./SFError"));
|
|
8
|
+
/**
|
|
9
|
+
* @dev Operation Helper Class
|
|
10
|
+
* @description A helper class to create `Operation` objects which can be executed or batched.
|
|
11
|
+
*/
|
|
12
|
+
class Operation {
|
|
13
|
+
constructor(txn, type) {
|
|
14
|
+
/**
|
|
15
|
+
* @dev Executes the operation via the provided signer.
|
|
16
|
+
* @description Populates all fields of the transaction, signs it and sends it to the network.
|
|
17
|
+
* @param signer The signer of the transacation
|
|
18
|
+
* @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
|
|
19
|
+
*/
|
|
20
|
+
this.exec = async (signer) => {
|
|
21
|
+
try {
|
|
22
|
+
const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
|
|
23
|
+
return await signer.sendTransaction(populatedTransaction);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
throw new SFError_1.default({
|
|
27
|
+
type: "EXECUTE_TRANSACTION",
|
|
28
|
+
customMessage: "There was an error executing the transaction",
|
|
29
|
+
errorObject: err,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @dev Get the populated transaction by awaiting `populateTransactionPromise`.
|
|
35
|
+
* @description Note that we need to populate the txn with the signer.
|
|
36
|
+
* @returns {Promise<TransactionRequest>}
|
|
37
|
+
*/
|
|
38
|
+
this.getPopulatedTransactionRequest = async (signer) => {
|
|
39
|
+
try {
|
|
40
|
+
const prePopulated = await this.populateTransactionPromise;
|
|
41
|
+
return await signer.populateTransaction(prePopulated);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
/* istanbul ignore next */
|
|
45
|
+
throw new SFError_1.default({
|
|
46
|
+
type: "POPULATE_TRANSACTION",
|
|
47
|
+
customMessage: "There was an error populating the transaction",
|
|
48
|
+
errorObject: err,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @dev Signs the populated transaction via the provided signer (what you intend on sending to the network).
|
|
54
|
+
* @param signer The signer of the transacation
|
|
55
|
+
* @returns {Promise<string>} Fully serialized, signed transaction
|
|
56
|
+
*/
|
|
57
|
+
this.getSignedTransaction = async (signer) => {
|
|
58
|
+
try {
|
|
59
|
+
const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
|
|
60
|
+
const signedTxn = await signer.signTransaction(populatedTransaction);
|
|
61
|
+
return signedTxn;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
throw new SFError_1.default({
|
|
65
|
+
type: "SIGN_TRANSACTION",
|
|
66
|
+
customMessage: "There was an error signing the transaction",
|
|
67
|
+
errorObject: err,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @dev Gets the transaction hash of the transaction.
|
|
73
|
+
* @description Calculates this by getting the keccak256 hash of the signedTxn.
|
|
74
|
+
* @param signer The signer of the transacation
|
|
75
|
+
* @returns {Promise<string>} The transaction hash of the transaction
|
|
76
|
+
*/
|
|
77
|
+
this.getTransactionHash = async (signer) => {
|
|
78
|
+
const signedTxn = await this.getSignedTransaction(signer);
|
|
79
|
+
return ethers_1.ethers.utils.keccak256(signedTxn);
|
|
80
|
+
};
|
|
81
|
+
this.populateTransactionPromise = txn;
|
|
82
|
+
this.type = type;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = Operation;
|
|
86
|
+
//# sourceMappingURL=Operation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vB,CAAC;gBACF,OAAO,SAAS,CAAC;aACpB;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,iBAAO,CAAC;oBACd,IAAI,EAAE,kBAAkB;oBACxB,aAAa,EAAE,4CAA4C;oBAC3D,WAAW,EAAE,GAAG;iBACnB,CAAC,CAAC;aACN;QACL,CAAC,CAAC;QAEF;;;;;WAKG;QACH,uBAAkB,GAAG,KAAK,EAAE,MAAqB,EAAmB,EAAE;YAClE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,eAAM,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;AAtFD,4BAsFC"}
|
package/dist/main/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":"AACA,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,YA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