@polymeshassociation/polymesh-sdk 14.0.0-beta.11
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/AccountManagement.d.ts +89 -0
- package/AccountManagement.d.ts.map +1 -0
- package/AccountManagement.js +116 -0
- package/AccountManagement.js.map +1 -0
- package/Assets.d.ts +68 -0
- package/Assets.d.ts.map +1 -0
- package/Assets.js +114 -0
- package/Assets.js.map +1 -0
- package/CHANGELOG.md +6 -0
- package/Claims.d.ts +123 -0
- package/Claims.d.ts.map +1 -0
- package/Claims.js +247 -0
- package/Claims.js.map +1 -0
- package/Identities.d.ts +45 -0
- package/Identities.d.ts.map +1 -0
- package/Identities.js +34 -0
- package/Identities.js.map +1 -0
- package/Network.d.ts +104 -0
- package/Network.d.ts.map +1 -0
- package/Network.js +203 -0
- package/Network.js.map +1 -0
- package/Polymesh.d.ts +111 -0
- package/Polymesh.d.ts.map +1 -0
- package/Polymesh.js +219 -0
- package/Polymesh.js.map +1 -0
- package/Settlements.d.ts +44 -0
- package/Settlements.d.ts.map +1 -0
- package/Settlements.js +93 -0
- package/Settlements.js.map +1 -0
- package/api/entities/Account.d.ts +102 -0
- package/api/entities/Account.d.ts.map +1 -0
- package/api/entities/Account.js +375 -0
- package/api/entities/Account.js.map +1 -0
- package/api/entities/Asset/AssetHolders.d.ts +14 -0
- package/api/entities/Asset/AssetHolders.d.ts.map +1 -0
- package/api/entities/Asset/AssetHolders.js +45 -0
- package/api/entities/Asset/AssetHolders.js.map +1 -0
- package/api/entities/Asset/Checkpoints/Schedules.d.ts +50 -0
- package/api/entities/Asset/Checkpoints/Schedules.d.ts.map +1 -0
- package/api/entities/Asset/Checkpoints/Schedules.js +103 -0
- package/api/entities/Asset/Checkpoints/Schedules.js.map +1 -0
- package/api/entities/Asset/Checkpoints/index.d.ts +33 -0
- package/api/entities/Asset/Checkpoints/index.d.ts.map +1 -0
- package/api/entities/Asset/Checkpoints/index.js +90 -0
- package/api/entities/Asset/Checkpoints/index.js.map +1 -0
- package/api/entities/Asset/Checkpoints/types.d.ts +20 -0
- package/api/entities/Asset/Checkpoints/types.d.ts.map +1 -0
- package/api/entities/Asset/Checkpoints/types.js +9 -0
- package/api/entities/Asset/Checkpoints/types.js.map +1 -0
- package/api/entities/Asset/Compliance/Requirements.d.ts +68 -0
- package/api/entities/Asset/Compliance/Requirements.d.ts.map +1 -0
- package/api/entities/Asset/Compliance/Requirements.js +114 -0
- package/api/entities/Asset/Compliance/Requirements.js.map +1 -0
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts +33 -0
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts.map +1 -0
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.js +70 -0
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.js.map +1 -0
- package/api/entities/Asset/Compliance/index.d.ts +15 -0
- package/api/entities/Asset/Compliance/index.d.ts.map +1 -0
- package/api/entities/Asset/Compliance/index.js +21 -0
- package/api/entities/Asset/Compliance/index.js.map +1 -0
- package/api/entities/Asset/CorporateActions/Distributions.d.ts +32 -0
- package/api/entities/Asset/CorporateActions/Distributions.d.ts.map +1 -0
- package/api/entities/Asset/CorporateActions/Distributions.js +74 -0
- package/api/entities/Asset/CorporateActions/Distributions.js.map +1 -0
- package/api/entities/Asset/CorporateActions/index.d.ts +58 -0
- package/api/entities/Asset/CorporateActions/index.d.ts.map +1 -0
- package/api/entities/Asset/CorporateActions/index.js +85 -0
- package/api/entities/Asset/CorporateActions/index.js.map +1 -0
- package/api/entities/Asset/CorporateActions/types.d.ts +8 -0
- package/api/entities/Asset/CorporateActions/types.d.ts.map +1 -0
- package/api/entities/Asset/CorporateActions/types.js +3 -0
- package/api/entities/Asset/CorporateActions/types.js.map +1 -0
- package/api/entities/Asset/Documents.d.ts +24 -0
- package/api/entities/Asset/Documents.d.ts.map +1 -0
- package/api/entities/Asset/Documents.js +49 -0
- package/api/entities/Asset/Documents.js.map +1 -0
- package/api/entities/Asset/Issuance.d.ts +21 -0
- package/api/entities/Asset/Issuance.d.ts.map +1 -0
- package/api/entities/Asset/Issuance.js +20 -0
- package/api/entities/Asset/Issuance.js.map +1 -0
- package/api/entities/Asset/Offerings.d.ts +37 -0
- package/api/entities/Asset/Offerings.d.ts.map +1 -0
- package/api/entities/Asset/Offerings.js +79 -0
- package/api/entities/Asset/Offerings.js.map +1 -0
- package/api/entities/Asset/Permissions.d.ts +50 -0
- package/api/entities/Asset/Permissions.d.ts.map +1 -0
- package/api/entities/Asset/Permissions.js +83 -0
- package/api/entities/Asset/Permissions.js.map +1 -0
- package/api/entities/Asset/Settlements.d.ts +48 -0
- package/api/entities/Asset/Settlements.d.ts.map +1 -0
- package/api/entities/Asset/Settlements.js +108 -0
- package/api/entities/Asset/Settlements.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/Count.d.ts +36 -0
- package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/Count.js +16 -0
- package/api/entities/Asset/TransferRestrictions/Count.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts +36 -0
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/Percentage.js +16 -0
- package/api/entities/Asset/TransferRestrictions/Percentage.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts +44 -0
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js +99 -0
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/index.d.ts +15 -0
- package/api/entities/Asset/TransferRestrictions/index.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/index.js +21 -0
- package/api/entities/Asset/TransferRestrictions/index.js.map +1 -0
- package/api/entities/Asset/index.d.ts +166 -0
- package/api/entities/Asset/index.d.ts.map +1 -0
- package/api/entities/Asset/index.js +306 -0
- package/api/entities/Asset/index.js.map +1 -0
- package/api/entities/Asset/types.d.ts +55 -0
- package/api/entities/Asset/types.d.ts.map +1 -0
- package/api/entities/Asset/types.js +19 -0
- package/api/entities/Asset/types.js.map +1 -0
- package/api/entities/AuthorizationRequest.d.ts +95 -0
- package/api/entities/AuthorizationRequest.d.ts.map +1 -0
- package/api/entities/AuthorizationRequest.js +128 -0
- package/api/entities/AuthorizationRequest.js.map +1 -0
- package/api/entities/Checkpoint.d.ts +71 -0
- package/api/entities/Checkpoint.d.ts.map +1 -0
- package/api/entities/Checkpoint.js +180 -0
- package/api/entities/Checkpoint.js.map +1 -0
- package/api/entities/CheckpointSchedule/index.d.ts +83 -0
- package/api/entities/CheckpointSchedule/index.d.ts.map +1 -0
- package/api/entities/CheckpointSchedule/index.js +137 -0
- package/api/entities/CheckpointSchedule/index.js.map +1 -0
- package/api/entities/CheckpointSchedule/types.d.ts +8 -0
- package/api/entities/CheckpointSchedule/types.d.ts.map +1 -0
- package/api/entities/CheckpointSchedule/types.js +3 -0
- package/api/entities/CheckpointSchedule/types.js.map +1 -0
- package/api/entities/CorporateAction.d.ts +40 -0
- package/api/entities/CorporateAction.d.ts.map +1 -0
- package/api/entities/CorporateAction.js +25 -0
- package/api/entities/CorporateAction.js.map +1 -0
- package/api/entities/CorporateActionBase/index.d.ts +106 -0
- package/api/entities/CorporateActionBase/index.d.ts.map +1 -0
- package/api/entities/CorporateActionBase/index.js +134 -0
- package/api/entities/CorporateActionBase/index.js.map +1 -0
- package/api/entities/CorporateActionBase/types.d.ts +30 -0
- package/api/entities/CorporateActionBase/types.d.ts.map +1 -0
- package/api/entities/CorporateActionBase/types.js +17 -0
- package/api/entities/CorporateActionBase/types.js.map +1 -0
- package/api/entities/CustomPermissionGroup.d.ts +43 -0
- package/api/entities/CustomPermissionGroup.d.ts.map +1 -0
- package/api/entities/CustomPermissionGroup.js +81 -0
- package/api/entities/CustomPermissionGroup.js.map +1 -0
- package/api/entities/DefaultPortfolio.d.ts +18 -0
- package/api/entities/DefaultPortfolio.d.ts.map +1 -0
- package/api/entities/DefaultPortfolio.js +35 -0
- package/api/entities/DefaultPortfolio.js.map +1 -0
- package/api/entities/DefaultTrustedClaimIssuer.d.ts +36 -0
- package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -0
- package/api/entities/DefaultTrustedClaimIssuer.js +88 -0
- package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -0
- package/api/entities/DividendDistribution/index.d.ts +158 -0
- package/api/entities/DividendDistribution/index.d.ts.map +1 -0
- package/api/entities/DividendDistribution/index.js +346 -0
- package/api/entities/DividendDistribution/index.js.map +1 -0
- package/api/entities/DividendDistribution/types.d.ts +24 -0
- package/api/entities/DividendDistribution/types.d.ts.map +1 -0
- package/api/entities/DividendDistribution/types.js +3 -0
- package/api/entities/DividendDistribution/types.js.map +1 -0
- package/api/entities/Entity.d.ts +43 -0
- package/api/entities/Entity.d.ts.map +1 -0
- package/api/entities/Entity.js +58 -0
- package/api/entities/Entity.js.map +1 -0
- package/api/entities/Identity/AssetPermissions.d.ts +76 -0
- package/api/entities/Identity/AssetPermissions.d.ts.map +1 -0
- package/api/entities/Identity/AssetPermissions.js +284 -0
- package/api/entities/Identity/AssetPermissions.js.map +1 -0
- package/api/entities/Identity/IdentityAuthorizations.d.ts +23 -0
- package/api/entities/Identity/IdentityAuthorizations.d.ts.map +1 -0
- package/api/entities/Identity/IdentityAuthorizations.js +79 -0
- package/api/entities/Identity/IdentityAuthorizations.js.map +1 -0
- package/api/entities/Identity/Portfolios.d.ts +43 -0
- package/api/entities/Identity/Portfolios.d.ts.map +1 -0
- package/api/entities/Identity/Portfolios.js +107 -0
- package/api/entities/Identity/Portfolios.js.map +1 -0
- package/api/entities/Identity/index.d.ts +152 -0
- package/api/entities/Identity/index.d.ts.map +1 -0
- package/api/entities/Identity/index.js +430 -0
- package/api/entities/Identity/index.js.map +1 -0
- package/api/entities/Instruction/index.d.ts +91 -0
- package/api/entities/Instruction/index.d.ts.map +1 -0
- package/api/entities/Instruction/index.js +261 -0
- package/api/entities/Instruction/index.js.map +1 -0
- package/api/entities/Instruction/types.d.ts +52 -0
- package/api/entities/Instruction/types.d.ts.map +1 -0
- package/api/entities/Instruction/types.js +21 -0
- package/api/entities/Instruction/types.js.map +1 -0
- package/api/entities/KnownPermissionGroup.d.ts +38 -0
- package/api/entities/KnownPermissionGroup.d.ts.map +1 -0
- package/api/entities/KnownPermissionGroup.js +100 -0
- package/api/entities/KnownPermissionGroup.js.map +1 -0
- package/api/entities/Namespace.d.ts +15 -0
- package/api/entities/Namespace.d.ts.map +1 -0
- package/api/entities/Namespace.js +19 -0
- package/api/entities/Namespace.js.map +1 -0
- package/api/entities/NumberedPortfolio.d.ts +48 -0
- package/api/entities/NumberedPortfolio.d.ts.map +1 -0
- package/api/entities/NumberedPortfolio.js +95 -0
- package/api/entities/NumberedPortfolio.js.map +1 -0
- package/api/entities/Offering/index.d.ts +93 -0
- package/api/entities/Offering/index.d.ts.map +1 -0
- package/api/entities/Offering/index.js +135 -0
- package/api/entities/Offering/index.js.map +1 -0
- package/api/entities/Offering/types.d.ts +83 -0
- package/api/entities/Offering/types.d.ts.map +1 -0
- package/api/entities/Offering/types.js +55 -0
- package/api/entities/Offering/types.js.map +1 -0
- package/api/entities/PermissionGroup.d.ts +26 -0
- package/api/entities/PermissionGroup.d.ts.map +1 -0
- package/api/entities/PermissionGroup.js +19 -0
- package/api/entities/PermissionGroup.js.map +1 -0
- package/api/entities/Portfolio/index.d.ts +112 -0
- package/api/entities/Portfolio/index.d.ts.map +1 -0
- package/api/entities/Portfolio/index.js +246 -0
- package/api/entities/Portfolio/index.js.map +1 -0
- package/api/entities/Portfolio/types.d.ts +21 -0
- package/api/entities/Portfolio/types.d.ts.map +1 -0
- package/api/entities/Portfolio/types.js +3 -0
- package/api/entities/Portfolio/types.js.map +1 -0
- package/api/entities/Subsidy/index.d.ts +80 -0
- package/api/entities/Subsidy/index.d.ts.map +1 -0
- package/api/entities/Subsidy/index.js +97 -0
- package/api/entities/Subsidy/index.js.map +1 -0
- package/api/entities/Subsidy/types.d.ts +21 -0
- package/api/entities/Subsidy/types.d.ts.map +1 -0
- package/api/entities/Subsidy/types.js +3 -0
- package/api/entities/Subsidy/types.js.map +1 -0
- package/api/entities/TickerReservation/index.d.ts +72 -0
- package/api/entities/TickerReservation/index.d.ts.map +1 -0
- package/api/entities/TickerReservation/index.js +118 -0
- package/api/entities/TickerReservation/index.js.map +1 -0
- package/api/entities/TickerReservation/types.d.ts +27 -0
- package/api/entities/TickerReservation/types.d.ts.map +1 -0
- package/api/entities/TickerReservation/types.js +19 -0
- package/api/entities/TickerReservation/types.js.map +1 -0
- package/api/entities/Venue/index.d.ts +77 -0
- package/api/entities/Venue/index.d.ts.map +1 -0
- package/api/entities/Venue/index.js +139 -0
- package/api/entities/Venue/index.js.map +1 -0
- package/api/entities/Venue/types.d.ts +22 -0
- package/api/entities/Venue/types.d.ts.map +1 -0
- package/api/entities/Venue/types.js +20 -0
- package/api/entities/Venue/types.js.map +1 -0
- package/api/entities/common/namespaces/Authorizations.d.ts +37 -0
- package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -0
- package/api/entities/common/namespaces/Authorizations.js +91 -0
- package/api/entities/common/namespaces/Authorizations.js.map +1 -0
- package/api/entities/types.d.ts +30 -0
- package/api/entities/types.d.ts.map +1 -0
- package/api/entities/types.js +27 -0
- package/api/entities/types.js.map +1 -0
- package/api/procedures/addAssetRequirement.d.ts +30 -0
- package/api/procedures/addAssetRequirement.d.ts.map +1 -0
- package/api/procedures/addAssetRequirement.js +70 -0
- package/api/procedures/addAssetRequirement.js.map +1 -0
- package/api/procedures/addInstruction.d.ts +70 -0
- package/api/procedures/addInstruction.d.ts.map +1 -0
- package/api/procedures/addInstruction.js +266 -0
- package/api/procedures/addInstruction.js.map +1 -0
- package/api/procedures/addInvestorUniquenessClaim.d.ts +23 -0
- package/api/procedures/addInvestorUniquenessClaim.d.ts.map +1 -0
- package/api/procedures/addInvestorUniquenessClaim.js +80 -0
- package/api/procedures/addInvestorUniquenessClaim.js.map +1 -0
- package/api/procedures/addTransferRestriction.d.ts +29 -0
- package/api/procedures/addTransferRestriction.d.ts.map +1 -0
- package/api/procedures/addTransferRestriction.js +102 -0
- package/api/procedures/addTransferRestriction.js.map +1 -0
- package/api/procedures/claimClassicTicker.d.ts +22 -0
- package/api/procedures/claimClassicTicker.d.ts.map +1 -0
- package/api/procedures/claimClassicTicker.js +112 -0
- package/api/procedures/claimClassicTicker.js.map +1 -0
- package/api/procedures/claimDividends.d.ts +16 -0
- package/api/procedures/claimDividends.d.ts.map +1 -0
- package/api/procedures/claimDividends.js +58 -0
- package/api/procedures/claimDividends.js.map +1 -0
- package/api/procedures/closeOffering.d.ts +23 -0
- package/api/procedures/closeOffering.d.ts.map +1 -0
- package/api/procedures/closeOffering.js +59 -0
- package/api/procedures/closeOffering.js.map +1 -0
- package/api/procedures/configureDividendDistribution.d.ts +69 -0
- package/api/procedures/configureDividendDistribution.d.ts.map +1 -0
- package/api/procedures/configureDividendDistribution.js +158 -0
- package/api/procedures/configureDividendDistribution.js.map +1 -0
- package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts +22 -0
- package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts.map +1 -0
- package/api/procedures/consumeAddMultiSigSignerAuthorization.js +102 -0
- package/api/procedures/consumeAddMultiSigSignerAuthorization.js.map +1 -0
- package/api/procedures/consumeAuthorizationRequests.d.ts +24 -0
- package/api/procedures/consumeAuthorizationRequests.d.ts.map +1 -0
- package/api/procedures/consumeAuthorizationRequests.js +124 -0
- package/api/procedures/consumeAuthorizationRequests.js.map +1 -0
- package/api/procedures/consumeJoinOrRotateAuthorization.d.ts +35 -0
- package/api/procedures/consumeJoinOrRotateAuthorization.d.ts.map +1 -0
- package/api/procedures/consumeJoinOrRotateAuthorization.js +136 -0
- package/api/procedures/consumeJoinOrRotateAuthorization.js.map +1 -0
- package/api/procedures/controllerTransfer.d.ts +40 -0
- package/api/procedures/controllerTransfer.d.ts.map +1 -0
- package/api/procedures/controllerTransfer.js +90 -0
- package/api/procedures/controllerTransfer.js.map +1 -0
- package/api/procedures/createAsset.d.ts +82 -0
- package/api/procedures/createAsset.d.ts.map +1 -0
- package/api/procedures/createAsset.js +178 -0
- package/api/procedures/createAsset.js.map +1 -0
- package/api/procedures/createCheckpoint.d.ts +26 -0
- package/api/procedures/createCheckpoint.d.ts.map +1 -0
- package/api/procedures/createCheckpoint.js +61 -0
- package/api/procedures/createCheckpoint.js.map +1 -0
- package/api/procedures/createCheckpointSchedule.d.ts +43 -0
- package/api/procedures/createCheckpointSchedule.d.ts.map +1 -0
- package/api/procedures/createCheckpointSchedule.js +70 -0
- package/api/procedures/createCheckpointSchedule.js.map +1 -0
- package/api/procedures/createGroup.d.ts +44 -0
- package/api/procedures/createGroup.d.ts.map +1 -0
- package/api/procedures/createGroup.js +90 -0
- package/api/procedures/createGroup.js.map +1 -0
- package/api/procedures/createPortfolio.d.ts +21 -0
- package/api/procedures/createPortfolio.d.ts.map +1 -0
- package/api/procedures/createPortfolio.js +64 -0
- package/api/procedures/createPortfolio.js.map +1 -0
- package/api/procedures/createVenue.d.ts +20 -0
- package/api/procedures/createVenue.d.ts.map +1 -0
- package/api/procedures/createVenue.js +56 -0
- package/api/procedures/createVenue.js.map +1 -0
- package/api/procedures/deletePortfolio.d.ts +20 -0
- package/api/procedures/deletePortfolio.d.ts.map +1 -0
- package/api/procedures/deletePortfolio.js +69 -0
- package/api/procedures/deletePortfolio.js.map +1 -0
- package/api/procedures/initiateCorporateAction.d.ts +60 -0
- package/api/procedures/initiateCorporateAction.d.ts.map +1 -0
- package/api/procedures/initiateCorporateAction.js +107 -0
- package/api/procedures/initiateCorporateAction.js.map +1 -0
- package/api/procedures/investInOffering.d.ts +66 -0
- package/api/procedures/investInOffering.d.ts.map +1 -0
- package/api/procedures/investInOffering.js +147 -0
- package/api/procedures/investInOffering.js.map +1 -0
- package/api/procedures/inviteAccount.d.ts +16 -0
- package/api/procedures/inviteAccount.d.ts.map +1 -0
- package/api/procedures/inviteAccount.js +92 -0
- package/api/procedures/inviteAccount.js.map +1 -0
- package/api/procedures/inviteExternalAgent.d.ts +46 -0
- package/api/procedures/inviteExternalAgent.d.ts.map +1 -0
- package/api/procedures/inviteExternalAgent.js +97 -0
- package/api/procedures/inviteExternalAgent.js.map +1 -0
- package/api/procedures/issueTokens.d.ts +27 -0
- package/api/procedures/issueTokens.d.ts.map +1 -0
- package/api/procedures/issueTokens.js +75 -0
- package/api/procedures/issueTokens.js.map +1 -0
- package/api/procedures/launchOffering.d.ts +81 -0
- package/api/procedures/launchOffering.d.ts.map +1 -0
- package/api/procedures/launchOffering.js +139 -0
- package/api/procedures/launchOffering.js.map +1 -0
- package/api/procedures/leaveIdentity.d.ts +10 -0
- package/api/procedures/leaveIdentity.d.ts.map +1 -0
- package/api/procedures/leaveIdentity.js +53 -0
- package/api/procedures/leaveIdentity.js.map +1 -0
- package/api/procedures/linkCaDocs.d.ts +30 -0
- package/api/procedures/linkCaDocs.d.ts.map +1 -0
- package/api/procedures/linkCaDocs.js +69 -0
- package/api/procedures/linkCaDocs.js.map +1 -0
- package/api/procedures/modifyAllowance.d.ts +42 -0
- package/api/procedures/modifyAllowance.d.ts.map +1 -0
- package/api/procedures/modifyAllowance.js +87 -0
- package/api/procedures/modifyAllowance.js.map +1 -0
- package/api/procedures/modifyAsset.d.ts +46 -0
- package/api/procedures/modifyAsset.d.ts.map +1 -0
- package/api/procedures/modifyAsset.js +130 -0
- package/api/procedures/modifyAsset.js.map +1 -0
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +35 -0
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -0
- package/api/procedures/modifyAssetTrustedClaimIssuers.js +139 -0
- package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -0
- package/api/procedures/modifyCaCheckpoint.d.ts +25 -0
- package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -0
- package/api/procedures/modifyCaCheckpoint.js +58 -0
- package/api/procedures/modifyCaCheckpoint.js.map +1 -0
- package/api/procedures/modifyCaDefaultConfig.d.ts +36 -0
- package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -0
- package/api/procedures/modifyCaDefaultConfig.js +119 -0
- package/api/procedures/modifyCaDefaultConfig.js.map +1 -0
- package/api/procedures/modifyClaims.d.ts +39 -0
- package/api/procedures/modifyClaims.d.ts.map +1 -0
- package/api/procedures/modifyClaims.js +205 -0
- package/api/procedures/modifyClaims.js.map +1 -0
- package/api/procedures/modifyComplianceRequirement.d.ts +35 -0
- package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -0
- package/api/procedures/modifyComplianceRequirement.js +75 -0
- package/api/procedures/modifyComplianceRequirement.js.map +1 -0
- package/api/procedures/modifyCorporateActionsAgent.d.ts +31 -0
- package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -0
- package/api/procedures/modifyCorporateActionsAgent.js +83 -0
- package/api/procedures/modifyCorporateActionsAgent.js.map +1 -0
- package/api/procedures/modifyDistributionCheckpoint.d.ts +25 -0
- package/api/procedures/modifyDistributionCheckpoint.d.ts.map +1 -0
- package/api/procedures/modifyDistributionCheckpoint.js +60 -0
- package/api/procedures/modifyDistributionCheckpoint.js.map +1 -0
- package/api/procedures/modifyInstructionAffirmation.d.ts +33 -0
- package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -0
- package/api/procedures/modifyInstructionAffirmation.js +158 -0
- package/api/procedures/modifyInstructionAffirmation.js.map +1 -0
- package/api/procedures/modifyOfferingTimes.d.ts +39 -0
- package/api/procedures/modifyOfferingTimes.d.ts.map +1 -0
- package/api/procedures/modifyOfferingTimes.js +103 -0
- package/api/procedures/modifyOfferingTimes.js.map +1 -0
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts +33 -0
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts.map +1 -0
- package/api/procedures/modifyPrimaryIssuanceAgent.js +87 -0
- package/api/procedures/modifyPrimaryIssuanceAgent.js.map +1 -0
- package/api/procedures/modifySignerPermissions.d.ts +35 -0
- package/api/procedures/modifySignerPermissions.d.ts.map +1 -0
- package/api/procedures/modifySignerPermissions.js +82 -0
- package/api/procedures/modifySignerPermissions.js.map +1 -0
- package/api/procedures/modifyVenue.d.ts +32 -0
- package/api/procedures/modifyVenue.d.ts.map +1 -0
- package/api/procedures/modifyVenue.js +81 -0
- package/api/procedures/modifyVenue.js.map +1 -0
- package/api/procedures/moveFunds.d.ts +33 -0
- package/api/procedures/moveFunds.d.ts.map +1 -0
- package/api/procedures/moveFunds.js +124 -0
- package/api/procedures/moveFunds.js.map +1 -0
- package/api/procedures/payDividends.d.ts +24 -0
- package/api/procedures/payDividends.d.ts.map +1 -0
- package/api/procedures/payDividends.js +90 -0
- package/api/procedures/payDividends.js.map +1 -0
- package/api/procedures/quitCustody.d.ts +28 -0
- package/api/procedures/quitCustody.d.ts.map +1 -0
- package/api/procedures/quitCustody.js +71 -0
- package/api/procedures/quitCustody.js.map +1 -0
- package/api/procedures/quitSubsidy.d.ts +20 -0
- package/api/procedures/quitSubsidy.d.ts.map +1 -0
- package/api/procedures/quitSubsidy.js +64 -0
- package/api/procedures/quitSubsidy.js.map +1 -0
- package/api/procedures/reclaimDividendDistributionFunds.d.ts +21 -0
- package/api/procedures/reclaimDividendDistributionFunds.d.ts.map +1 -0
- package/api/procedures/reclaimDividendDistributionFunds.js +69 -0
- package/api/procedures/reclaimDividendDistributionFunds.js.map +1 -0
- package/api/procedures/redeemTokens.d.ts +25 -0
- package/api/procedures/redeemTokens.d.ts.map +1 -0
- package/api/procedures/redeemTokens.js +70 -0
- package/api/procedures/redeemTokens.js.map +1 -0
- package/api/procedures/registerIdentity.d.ts +23 -0
- package/api/procedures/registerIdentity.d.ts.map +1 -0
- package/api/procedures/registerIdentity.js +70 -0
- package/api/procedures/registerIdentity.js.map +1 -0
- package/api/procedures/removeAssetRequirement.d.ts +26 -0
- package/api/procedures/removeAssetRequirement.d.ts.map +1 -0
- package/api/procedures/removeAssetRequirement.js +62 -0
- package/api/procedures/removeAssetRequirement.js.map +1 -0
- package/api/procedures/removeCheckpointSchedule.d.ts +28 -0
- package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -0
- package/api/procedures/removeCheckpointSchedule.js +75 -0
- package/api/procedures/removeCheckpointSchedule.js.map +1 -0
- package/api/procedures/removeCorporateAction.d.ts +25 -0
- package/api/procedures/removeCorporateAction.d.ts.map +1 -0
- package/api/procedures/removeCorporateAction.js +98 -0
- package/api/procedures/removeCorporateAction.js.map +1 -0
- package/api/procedures/removeCorporateActionsAgent.d.ts +23 -0
- package/api/procedures/removeCorporateActionsAgent.d.ts.map +1 -0
- package/api/procedures/removeCorporateActionsAgent.js +60 -0
- package/api/procedures/removeCorporateActionsAgent.js.map +1 -0
- package/api/procedures/removeExternalAgent.d.ts +34 -0
- package/api/procedures/removeExternalAgent.d.ts.map +1 -0
- package/api/procedures/removeExternalAgent.js +83 -0
- package/api/procedures/removeExternalAgent.js.map +1 -0
- package/api/procedures/removePrimaryIssuanceAgent.d.ts +21 -0
- package/api/procedures/removePrimaryIssuanceAgent.d.ts.map +1 -0
- package/api/procedures/removePrimaryIssuanceAgent.js +58 -0
- package/api/procedures/removePrimaryIssuanceAgent.js.map +1 -0
- package/api/procedures/removeSecondaryAccounts.d.ts +14 -0
- package/api/procedures/removeSecondaryAccounts.d.ts.map +1 -0
- package/api/procedures/removeSecondaryAccounts.js +61 -0
- package/api/procedures/removeSecondaryAccounts.js.map +1 -0
- package/api/procedures/renamePortfolio.d.ts +26 -0
- package/api/procedures/renamePortfolio.d.ts.map +1 -0
- package/api/procedures/renamePortfolio.js +69 -0
- package/api/procedures/renamePortfolio.js.map +1 -0
- package/api/procedures/rescheduleInstruction.d.ts +17 -0
- package/api/procedures/rescheduleInstruction.d.ts.map +1 -0
- package/api/procedures/rescheduleInstruction.js +52 -0
- package/api/procedures/rescheduleInstruction.js.map +1 -0
- package/api/procedures/reserveTicker.d.ts +29 -0
- package/api/procedures/reserveTicker.d.ts.map +1 -0
- package/api/procedures/reserveTicker.js +94 -0
- package/api/procedures/reserveTicker.js.map +1 -0
- package/api/procedures/setAssetDocuments.d.ts +37 -0
- package/api/procedures/setAssetDocuments.d.ts.map +1 -0
- package/api/procedures/setAssetDocuments.js +103 -0
- package/api/procedures/setAssetDocuments.js.map +1 -0
- package/api/procedures/setAssetRequirements.d.ts +29 -0
- package/api/procedures/setAssetRequirements.d.ts.map +1 -0
- package/api/procedures/setAssetRequirements.js +81 -0
- package/api/procedures/setAssetRequirements.js.map +1 -0
- package/api/procedures/setCustodian.d.ts +27 -0
- package/api/procedures/setCustodian.d.ts.map +1 -0
- package/api/procedures/setCustodian.js +86 -0
- package/api/procedures/setCustodian.js.map +1 -0
- package/api/procedures/setGroupPermissions.d.ts +29 -0
- package/api/procedures/setGroupPermissions.d.ts.map +1 -0
- package/api/procedures/setGroupPermissions.js +61 -0
- package/api/procedures/setGroupPermissions.js.map +1 -0
- package/api/procedures/setPermissionGroup.d.ts +57 -0
- package/api/procedures/setPermissionGroup.d.ts.map +1 -0
- package/api/procedures/setPermissionGroup.js +108 -0
- package/api/procedures/setPermissionGroup.js.map +1 -0
- package/api/procedures/setTransferRestrictions.d.ts +50 -0
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -0
- package/api/procedures/setTransferRestrictions.js +204 -0
- package/api/procedures/setTransferRestrictions.js.map +1 -0
- package/api/procedures/subsidizeAccount.d.ts +21 -0
- package/api/procedures/subsidizeAccount.d.ts.map +1 -0
- package/api/procedures/subsidizeAccount.js +77 -0
- package/api/procedures/subsidizeAccount.js.map +1 -0
- package/api/procedures/toggleFreezeOffering.d.ts +21 -0
- package/api/procedures/toggleFreezeOffering.d.ts.map +1 -0
- package/api/procedures/toggleFreezeOffering.js +85 -0
- package/api/procedures/toggleFreezeOffering.js.map +1 -0
- package/api/procedures/toggleFreezeSecondaryAccounts.d.ts +18 -0
- package/api/procedures/toggleFreezeSecondaryAccounts.d.ts.map +1 -0
- package/api/procedures/toggleFreezeSecondaryAccounts.js +65 -0
- package/api/procedures/toggleFreezeSecondaryAccounts.js.map +1 -0
- package/api/procedures/toggleFreezeTransfers.d.ts +24 -0
- package/api/procedures/toggleFreezeTransfers.d.ts.map +1 -0
- package/api/procedures/toggleFreezeTransfers.js +72 -0
- package/api/procedures/toggleFreezeTransfers.js.map +1 -0
- package/api/procedures/togglePauseRequirements.d.ts +24 -0
- package/api/procedures/togglePauseRequirements.d.ts.map +1 -0
- package/api/procedures/togglePauseRequirements.js +63 -0
- package/api/procedures/togglePauseRequirements.js.map +1 -0
- package/api/procedures/transferAssetOwnership.d.ts +28 -0
- package/api/procedures/transferAssetOwnership.d.ts.map +1 -0
- package/api/procedures/transferAssetOwnership.js +61 -0
- package/api/procedures/transferAssetOwnership.js.map +1 -0
- package/api/procedures/transferPolyx.d.ts +30 -0
- package/api/procedures/transferPolyx.d.ts.map +1 -0
- package/api/procedures/transferPolyx.js +101 -0
- package/api/procedures/transferPolyx.js.map +1 -0
- package/api/procedures/transferTickerOwnership.d.ts +28 -0
- package/api/procedures/transferTickerOwnership.d.ts.map +1 -0
- package/api/procedures/transferTickerOwnership.js +70 -0
- package/api/procedures/transferTickerOwnership.js.map +1 -0
- package/api/procedures/utils.d.ts +103 -0
- package/api/procedures/utils.d.ts.map +1 -0
- package/api/procedures/utils.js +537 -0
- package/api/procedures/utils.js.map +1 -0
- package/api/procedures/waivePermissions.d.ts +34 -0
- package/api/procedures/waivePermissions.d.ts.map +1 -0
- package/api/procedures/waivePermissions.js +70 -0
- package/api/procedures/waivePermissions.js.map +1 -0
- package/base/Context.d.ts +287 -0
- package/base/Context.d.ts.map +1 -0
- package/base/Context.js +838 -0
- package/base/Context.js.map +1 -0
- package/base/PolymeshError.d.ts +17 -0
- package/base/PolymeshError.d.ts.map +1 -0
- package/base/PolymeshError.js +24 -0
- package/base/PolymeshError.js.map +1 -0
- package/base/PolymeshTransaction.d.ts +54 -0
- package/base/PolymeshTransaction.d.ts.map +1 -0
- package/base/PolymeshTransaction.js +84 -0
- package/base/PolymeshTransaction.js.map +1 -0
- package/base/PolymeshTransactionBase.d.ts +163 -0
- package/base/PolymeshTransactionBase.d.ts.map +1 -0
- package/base/PolymeshTransactionBase.js +322 -0
- package/base/PolymeshTransactionBase.js.map +1 -0
- package/base/PolymeshTransactionBatch.d.ts +51 -0
- package/base/PolymeshTransactionBatch.d.ts.map +1 -0
- package/base/PolymeshTransactionBatch.js +107 -0
- package/base/PolymeshTransactionBatch.js.map +1 -0
- package/base/PostTransactionValue.d.ts +45 -0
- package/base/PostTransactionValue.d.ts.map +1 -0
- package/base/PostTransactionValue.js +108 -0
- package/base/PostTransactionValue.js.map +1 -0
- package/base/Procedure.d.ts +92 -0
- package/base/Procedure.d.ts.map +1 -0
- package/base/Procedure.js +362 -0
- package/base/Procedure.js.map +1 -0
- package/base/TransactionQueue.d.ts +142 -0
- package/base/TransactionQueue.d.ts.map +1 -0
- package/base/TransactionQueue.js +420 -0
- package/base/TransactionQueue.js.map +1 -0
- package/base/types.d.ts +9 -0
- package/base/types.d.ts.map +1 -0
- package/base/types.js +4 -0
- package/base/types.js.map +1 -0
- package/generated/types.d.ts +253 -0
- package/generated/types.d.ts.map +1 -0
- package/generated/types.js +258 -0
- package/generated/types.js.map +1 -0
- package/generated/utils.d.ts +12 -0
- package/generated/utils.d.ts.map +1 -0
- package/generated/utils.js +767 -0
- package/generated/utils.js.map +1 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -0
- package/index.js +12 -0
- package/index.js.map +1 -0
- package/internal.d.ts +107 -0
- package/internal.d.ts.map +1 -0
- package/internal.js +219 -0
- package/internal.js.map +1 -0
- package/middleware/queries.d.ts +129 -0
- package/middleware/queries.d.ts.map +1 -0
- package/middleware/queries.js +701 -0
- package/middleware/queries.js.map +1 -0
- package/middleware/types.d.ts +1624 -0
- package/middleware/types.d.ts.map +1 -0
- package/middleware/types.js +866 -0
- package/middleware/types.js.map +1 -0
- package/npm-package/polymeshassociation-polymesh-sdk-14.0.0-beta.11.tgz +0 -0
- package/package.json +131 -0
- package/polkadot/asset/definitions.d.ts +25 -0
- package/polkadot/asset/definitions.d.ts.map +1 -0
- package/polkadot/asset/definitions.js +96 -0
- package/polkadot/asset/definitions.js.map +1 -0
- package/polkadot/asset/index.d.ts +2 -0
- package/polkadot/asset/index.d.ts.map +1 -0
- package/polkadot/asset/index.js +20 -0
- package/polkadot/asset/index.js.map +1 -0
- package/polkadot/asset/types.d.ts +2 -0
- package/polkadot/asset/types.d.ts.map +1 -0
- package/polkadot/asset/types.js +5 -0
- package/polkadot/asset/types.js.map +1 -0
- package/polkadot/augment-api-consts.d.ts +178 -0
- package/polkadot/augment-api-consts.d.ts.map +1 -0
- package/polkadot/augment-api-consts.js +5 -0
- package/polkadot/augment-api-consts.js.map +1 -0
- package/polkadot/augment-api-errors.d.ts +1638 -0
- package/polkadot/augment-api-errors.d.ts.map +1 -0
- package/polkadot/augment-api-errors.js +5 -0
- package/polkadot/augment-api-errors.js.map +1 -0
- package/polkadot/augment-api-events.d.ts +1671 -0
- package/polkadot/augment-api-events.d.ts.map +1 -0
- package/polkadot/augment-api-events.js +5 -0
- package/polkadot/augment-api-events.js.map +1 -0
- package/polkadot/augment-api-query.d.ts +1993 -0
- package/polkadot/augment-api-query.d.ts.map +1 -0
- package/polkadot/augment-api-query.js +5 -0
- package/polkadot/augment-api-query.js.map +1 -0
- package/polkadot/augment-api-rpc.d.ts +695 -0
- package/polkadot/augment-api-rpc.d.ts.map +1 -0
- package/polkadot/augment-api-rpc.js +5 -0
- package/polkadot/augment-api-rpc.js.map +1 -0
- package/polkadot/augment-api-tx.d.ts +5464 -0
- package/polkadot/augment-api-tx.d.ts.map +1 -0
- package/polkadot/augment-api-tx.js +5 -0
- package/polkadot/augment-api-tx.js.map +1 -0
- package/polkadot/augment-api.d.ts +8 -0
- package/polkadot/augment-api.d.ts.map +1 -0
- package/polkadot/augment-api.js +12 -0
- package/polkadot/augment-api.js.map +1 -0
- package/polkadot/augment-types.d.ts +3243 -0
- package/polkadot/augment-types.d.ts.map +1 -0
- package/polkadot/augment-types.js +5 -0
- package/polkadot/augment-types.js.map +1 -0
- package/polkadot/compliance/definitions.d.ts +16 -0
- package/polkadot/compliance/definitions.d.ts.map +1 -0
- package/polkadot/compliance/definitions.js +35 -0
- package/polkadot/compliance/definitions.js.map +1 -0
- package/polkadot/compliance/index.d.ts +2 -0
- package/polkadot/compliance/index.d.ts.map +1 -0
- package/polkadot/compliance/index.js +20 -0
- package/polkadot/compliance/index.js.map +1 -0
- package/polkadot/compliance/types.d.ts +2 -0
- package/polkadot/compliance/types.d.ts.map +1 -0
- package/polkadot/compliance/types.js +5 -0
- package/polkadot/compliance/types.js.map +1 -0
- package/polkadot/definitions.d.ts +8 -0
- package/polkadot/definitions.d.ts.map +1 -0
- package/polkadot/definitions.js +22 -0
- package/polkadot/definitions.js.map +1 -0
- package/polkadot/identity/definitions.d.ts +61 -0
- package/polkadot/identity/definitions.d.ts.map +1 -0
- package/polkadot/identity/definitions.js +120 -0
- package/polkadot/identity/definitions.js.map +1 -0
- package/polkadot/identity/index.d.ts +2 -0
- package/polkadot/identity/index.d.ts.map +1 -0
- package/polkadot/identity/index.js +20 -0
- package/polkadot/identity/index.js.map +1 -0
- package/polkadot/identity/types.d.ts +2 -0
- package/polkadot/identity/types.d.ts.map +1 -0
- package/polkadot/identity/types.js +5 -0
- package/polkadot/identity/types.js.map +1 -0
- package/polkadot/index.d.ts +2 -0
- package/polkadot/index.d.ts.map +1 -0
- package/polkadot/index.js +20 -0
- package/polkadot/index.js.map +1 -0
- package/polkadot/pips/definitions.d.ts +34 -0
- package/polkadot/pips/definitions.d.ts.map +1 -0
- package/polkadot/pips/definitions.js +57 -0
- package/polkadot/pips/definitions.js.map +1 -0
- package/polkadot/pips/index.d.ts +2 -0
- package/polkadot/pips/index.d.ts.map +1 -0
- package/polkadot/pips/index.js +20 -0
- package/polkadot/pips/index.js.map +1 -0
- package/polkadot/pips/types.d.ts +2 -0
- package/polkadot/pips/types.d.ts.map +1 -0
- package/polkadot/pips/types.js +5 -0
- package/polkadot/pips/types.js.map +1 -0
- package/polkadot/polymesh/definitions.d.ts +855 -0
- package/polkadot/polymesh/definitions.d.ts.map +1 -0
- package/polkadot/polymesh/definitions.js +1139 -0
- package/polkadot/polymesh/definitions.js.map +1 -0
- package/polkadot/polymesh/index.d.ts +2 -0
- package/polkadot/polymesh/index.d.ts.map +1 -0
- package/polkadot/polymesh/index.js +20 -0
- package/polkadot/polymesh/index.js.map +1 -0
- package/polkadot/polymesh/types.d.ts +1408 -0
- package/polkadot/polymesh/types.d.ts.map +1 -0
- package/polkadot/polymesh/types.js +5 -0
- package/polkadot/polymesh/types.js.map +1 -0
- package/polkadot/portfolio/definitions.d.ts +25 -0
- package/polkadot/portfolio/definitions.d.ts.map +1 -0
- package/polkadot/portfolio/definitions.js +31 -0
- package/polkadot/portfolio/definitions.js.map +1 -0
- package/polkadot/portfolio/index.d.ts +2 -0
- package/polkadot/portfolio/index.d.ts.map +1 -0
- package/polkadot/portfolio/index.js +20 -0
- package/polkadot/portfolio/index.js.map +1 -0
- package/polkadot/portfolio/types.d.ts +2 -0
- package/polkadot/portfolio/types.d.ts.map +1 -0
- package/polkadot/portfolio/types.js +5 -0
- package/polkadot/portfolio/types.js.map +1 -0
- package/polkadot/protocolFee/definitions.d.ts +16 -0
- package/polkadot/protocolFee/definitions.d.ts.map +1 -0
- package/polkadot/protocolFee/definitions.js +25 -0
- package/polkadot/protocolFee/definitions.js.map +1 -0
- package/polkadot/protocolFee/index.d.ts +2 -0
- package/polkadot/protocolFee/index.d.ts.map +1 -0
- package/polkadot/protocolFee/index.js +20 -0
- package/polkadot/protocolFee/index.js.map +1 -0
- package/polkadot/protocolFee/types.d.ts +2 -0
- package/polkadot/protocolFee/types.d.ts.map +1 -0
- package/polkadot/protocolFee/types.js +5 -0
- package/polkadot/protocolFee/types.js.map +1 -0
- package/polkadot/schema.d.ts +994 -0
- package/polkadot/schema.d.ts.map +1 -0
- package/polkadot/schema.js +1451 -0
- package/polkadot/schema.js.map +1 -0
- package/polkadot/staking/definitions.d.ts +16 -0
- package/polkadot/staking/definitions.d.ts.map +1 -0
- package/polkadot/staking/definitions.js +20 -0
- package/polkadot/staking/definitions.js.map +1 -0
- package/polkadot/staking/index.d.ts +2 -0
- package/polkadot/staking/index.d.ts.map +1 -0
- package/polkadot/staking/index.js +20 -0
- package/polkadot/staking/index.js.map +1 -0
- package/polkadot/staking/types.d.ts +2 -0
- package/polkadot/staking/types.d.ts.map +1 -0
- package/polkadot/staking/types.js +5 -0
- package/polkadot/staking/types.js.map +1 -0
- package/polkadot/types.d.ts +472 -0
- package/polkadot/types.d.ts.map +1 -0
- package/polkadot/types.js +531 -0
- package/polkadot/types.js.map +1 -0
- package/types/index.d.ts +1164 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +506 -0
- package/types/index.js.map +1 -0
- package/types/internal.d.ts +304 -0
- package/types/internal.d.ts.map +1 -0
- package/types/internal.js +34 -0
- package/types/internal.js.map +1 -0
- package/types/utils/index.d.ts +47 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/index.js +11 -0
- package/types/utils/index.js.map +1 -0
- package/utils/constants.d.ts +63 -0
- package/utils/constants.d.ts.map +1 -0
- package/utils/constants.js +109 -0
- package/utils/constants.js.map +1 -0
- package/utils/conversion.d.ts +584 -0
- package/utils/conversion.d.ts.map +1 -0
- package/utils/conversion.js +2649 -0
- package/utils/conversion.js.map +1 -0
- package/utils/index.d.ts +4 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/index.js +28 -0
- package/utils/index.js.map +1 -0
- package/utils/internal.d.ts +296 -0
- package/utils/internal.d.ts.map +1 -0
- package/utils/internal.js +786 -0
- package/utils/internal.js.map +1 -0
- package/utils/typeguards.d.ts +175 -0
- package/utils/typeguards.d.ts.map +1 -0
- package/utils/typeguards.js +312 -0
- package/utils/typeguards.js.map +1 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PolymeshTransactionBase = void 0;
|
|
13
|
+
const events_1 = require("events");
|
|
14
|
+
const internal_1 = require("../internal");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
const conversion_1 = require("../utils/conversion");
|
|
17
|
+
const internal_2 = require("../utils/internal");
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
var Event;
|
|
22
|
+
(function (Event) {
|
|
23
|
+
Event["StatusChange"] = "StatusChange";
|
|
24
|
+
})(Event || (Event = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Wrapper class for a Polymesh Transaction
|
|
27
|
+
*/
|
|
28
|
+
class PolymeshTransactionBase {
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
constructor(transactionSpec, context) {
|
|
33
|
+
/**
|
|
34
|
+
* current status of the transaction
|
|
35
|
+
*/
|
|
36
|
+
this.status = types_1.TransactionStatus.Idle;
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*
|
|
40
|
+
* wrappers for values that will exist after this transaction has executed
|
|
41
|
+
*/
|
|
42
|
+
this.postValues = [];
|
|
43
|
+
const { postTransactionValues, signingAddress, signer, isCritical, fee, paidForBy } = transactionSpec;
|
|
44
|
+
if (postTransactionValues) {
|
|
45
|
+
this.postValues = postTransactionValues;
|
|
46
|
+
}
|
|
47
|
+
this.emitter = new events_1.EventEmitter();
|
|
48
|
+
this.signingAddress = signingAddress;
|
|
49
|
+
this.signer = signer;
|
|
50
|
+
this.isCritical = isCritical;
|
|
51
|
+
this.protocolFee = fee;
|
|
52
|
+
this.context = context;
|
|
53
|
+
this.paidForBy = paidForBy;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Run the transaction and update its status
|
|
57
|
+
*/
|
|
58
|
+
run() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
const receipt = yield this.internalRun();
|
|
62
|
+
this.receipt = receipt;
|
|
63
|
+
yield Promise.all(this.postValues.map(postValue => postValue.run(receipt)));
|
|
64
|
+
this.updateStatus(types_1.TransactionStatus.Succeeded);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const error = err;
|
|
68
|
+
this.error = err;
|
|
69
|
+
switch (error.code) {
|
|
70
|
+
case types_1.ErrorCode.TransactionAborted: {
|
|
71
|
+
this.updateStatus(types_1.TransactionStatus.Aborted);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
case types_1.ErrorCode.TransactionRejectedByUser: {
|
|
75
|
+
this.updateStatus(types_1.TransactionStatus.Rejected);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case types_1.ErrorCode.TransactionReverted:
|
|
79
|
+
case types_1.ErrorCode.FatalError:
|
|
80
|
+
default: {
|
|
81
|
+
this.updateStatus(types_1.TransactionStatus.Failed);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @hidden
|
|
91
|
+
*
|
|
92
|
+
* Execute the underlying transaction, updating the status where applicable and
|
|
93
|
+
* throwing any pertinent errors
|
|
94
|
+
*/
|
|
95
|
+
internalRun() {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const { signingAddress, signer } = this;
|
|
98
|
+
this.updateStatus(types_1.TransactionStatus.Unapproved);
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
const txWithArgs = this.composeTx();
|
|
101
|
+
let settingBlockData = Promise.resolve();
|
|
102
|
+
// nonce: -1 takes pending transactions into consideration.
|
|
103
|
+
// More information can be found at: https://polkadot.js.org/docs/api/cookbook/tx/#how-do-i-take-the-pending-tx-pool-into-account-in-my-nonce
|
|
104
|
+
const gettingUnsub = txWithArgs.signAndSend(signingAddress, { nonce: -1, signer }, receipt => {
|
|
105
|
+
const { status } = receipt;
|
|
106
|
+
let isLastCallback = false;
|
|
107
|
+
let unsubscribing = Promise.resolve();
|
|
108
|
+
let extrinsicFailedEvent;
|
|
109
|
+
// isCompleted === isFinalized || isInBlock || isError
|
|
110
|
+
if (receipt.isCompleted) {
|
|
111
|
+
if (receipt.isInBlock) {
|
|
112
|
+
const blockHash = status.asInBlock;
|
|
113
|
+
/*
|
|
114
|
+
* this must be done to ensure that the block hash and number are set before the success event
|
|
115
|
+
* is emitted, and at the same time. We do not resolve or reject the containing promise until this
|
|
116
|
+
* one resolves
|
|
117
|
+
*/
|
|
118
|
+
settingBlockData = (0, internal_2.defusePromise)(this.context.polymeshApi.rpc.chain.getBlock(blockHash).then(({ block }) => {
|
|
119
|
+
this.blockHash = (0, conversion_1.hashToString)(blockHash);
|
|
120
|
+
this.blockNumber = (0, conversion_1.u32ToBigNumber)(block.header.number.unwrap());
|
|
121
|
+
}));
|
|
122
|
+
// if the extrinsic failed due to an on-chain error, we should handle it in a special way
|
|
123
|
+
extrinsicFailedEvent = receipt.findRecord('system', 'ExtrinsicFailed');
|
|
124
|
+
// extrinsic failed so we can unsubscribe
|
|
125
|
+
isLastCallback = !!extrinsicFailedEvent;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// isFinalized || isError so we know we can unsubscribe
|
|
129
|
+
isLastCallback = true;
|
|
130
|
+
}
|
|
131
|
+
if (isLastCallback) {
|
|
132
|
+
unsubscribing = gettingUnsub.then(unsub => {
|
|
133
|
+
unsub();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/*
|
|
137
|
+
* Promise chain that handles all sub-promises in this pass through the signAndSend callback.
|
|
138
|
+
* Primarily for consistent error handling
|
|
139
|
+
*/
|
|
140
|
+
let finishing = Promise.resolve();
|
|
141
|
+
if (extrinsicFailedEvent) {
|
|
142
|
+
const { event: { data }, } = extrinsicFailedEvent;
|
|
143
|
+
finishing = Promise.all([settingBlockData, unsubscribing]).then(() => {
|
|
144
|
+
this.handleExtrinsicFailure(resolve, reject, data[0]);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else if (receipt.isFinalized) {
|
|
148
|
+
finishing = Promise.all([settingBlockData, unsubscribing]).then(() => {
|
|
149
|
+
this.handleExtrinsicSuccess(resolve, reject, receipt);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
else if (receipt.isError) {
|
|
153
|
+
reject(new internal_1.PolymeshError({ code: types_1.ErrorCode.TransactionAborted }));
|
|
154
|
+
}
|
|
155
|
+
finishing.catch((err) => reject(err));
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
gettingUnsub
|
|
159
|
+
.then(() => {
|
|
160
|
+
// tx approved by signer
|
|
161
|
+
this.txHash = txWithArgs.hash.toString();
|
|
162
|
+
this.updateStatus(types_1.TransactionStatus.Running);
|
|
163
|
+
})
|
|
164
|
+
.catch((err) => {
|
|
165
|
+
let error;
|
|
166
|
+
/* istanbul ignore else */
|
|
167
|
+
if (err.message.indexOf('Cancelled') > -1) {
|
|
168
|
+
// tx rejected by signer
|
|
169
|
+
error = { code: types_1.ErrorCode.TransactionRejectedByUser };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
// unexpected error
|
|
173
|
+
error = { code: types_1.ErrorCode.UnexpectedError, message: err.message };
|
|
174
|
+
}
|
|
175
|
+
reject(new internal_1.PolymeshError(error));
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Subscribe to status changes
|
|
182
|
+
*
|
|
183
|
+
* @param listener - callback function that will be called whenever the status changes
|
|
184
|
+
*
|
|
185
|
+
* @returns unsubscribe function
|
|
186
|
+
*/
|
|
187
|
+
onStatusChange(listener) {
|
|
188
|
+
this.emitter.on(Event.StatusChange, listener);
|
|
189
|
+
return () => {
|
|
190
|
+
this.emitter.removeListener(Event.StatusChange, listener);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Retrieve the Account that would pay fees for the transaction if it was run at this moment, as well as the total amount that can be
|
|
195
|
+
* charged to it (allowance). A null allowance means that there is no limit to that amount
|
|
196
|
+
*
|
|
197
|
+
* A null return value signifies that the caller Account would pay the fees
|
|
198
|
+
*
|
|
199
|
+
* @note this value might change if, before running the transaction, the caller Account enters (or leaves)
|
|
200
|
+
* a subsidizer relationship
|
|
201
|
+
*/
|
|
202
|
+
getPayingAccount() {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
const { paidForBy, context } = this;
|
|
205
|
+
if (this.ignoresSubsidy()) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (paidForBy) {
|
|
209
|
+
const { account: primaryAccount } = yield paidForBy.getPrimaryAccount();
|
|
210
|
+
return {
|
|
211
|
+
type: types_1.PayingAccountType.Other,
|
|
212
|
+
account: primaryAccount,
|
|
213
|
+
allowance: null,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const subsidyWithAllowance = yield context.accountSubsidy();
|
|
217
|
+
if (!subsidyWithAllowance) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
const { subsidy: { subsidizer: account }, allowance, } = subsidyWithAllowance;
|
|
221
|
+
return {
|
|
222
|
+
type: types_1.PayingAccountType.Subsidy,
|
|
223
|
+
account,
|
|
224
|
+
allowance,
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get all (protocol and gas) fees associated with this transaction. Returns null
|
|
230
|
+
* if the transaction is not ready yet (this can happen if it depends on the execution of a
|
|
231
|
+
* previous transaction in the queue)
|
|
232
|
+
*
|
|
233
|
+
* @note this value might change if the transaction is run at a later time. This can be due to a governance vote
|
|
234
|
+
*/
|
|
235
|
+
getFees() {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
const { signingAddress } = this;
|
|
238
|
+
let { protocolFee: protocol } = this;
|
|
239
|
+
let composedTx;
|
|
240
|
+
try {
|
|
241
|
+
composedTx = this.composeTx();
|
|
242
|
+
}
|
|
243
|
+
catch (err) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
const paymentInfoPromise = composedTx.paymentInfo(signingAddress);
|
|
247
|
+
if (!protocol) {
|
|
248
|
+
protocol = yield this.getProtocolFees();
|
|
249
|
+
}
|
|
250
|
+
const { partialFee } = yield paymentInfoPromise;
|
|
251
|
+
return {
|
|
252
|
+
protocol,
|
|
253
|
+
gas: (0, conversion_1.balanceToBigNumber)(partialFee),
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @hidden
|
|
259
|
+
*/
|
|
260
|
+
updateStatus(status) {
|
|
261
|
+
this.status = status;
|
|
262
|
+
/* eslint-disable default-case */
|
|
263
|
+
switch (status) {
|
|
264
|
+
case types_1.TransactionStatus.Unapproved:
|
|
265
|
+
case types_1.TransactionStatus.Running:
|
|
266
|
+
case types_1.TransactionStatus.Succeeded: {
|
|
267
|
+
this.emitter.emit(Event.StatusChange, this);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
case types_1.TransactionStatus.Rejected:
|
|
271
|
+
case types_1.TransactionStatus.Aborted:
|
|
272
|
+
case types_1.TransactionStatus.Failed: {
|
|
273
|
+
this.emitter.emit(Event.StatusChange, this, this.error);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/* eslint-enable default-case */
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
*
|
|
281
|
+
* Return whether the transaction ignores any existing subsidizer relationships
|
|
282
|
+
* and is always paid by the caller
|
|
283
|
+
*/
|
|
284
|
+
ignoresSubsidy() {
|
|
285
|
+
/*
|
|
286
|
+
* since we don't know anything about the transaction, a safe default is
|
|
287
|
+
* to assume it doesn't ignore subsidies
|
|
288
|
+
*/
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* @hidden
|
|
293
|
+
*/
|
|
294
|
+
handleExtrinsicFailure(_resolve, reject, error, data) {
|
|
295
|
+
// get revert message from event
|
|
296
|
+
let message;
|
|
297
|
+
if (error.isModule) {
|
|
298
|
+
// known error
|
|
299
|
+
const mod = error.asModule;
|
|
300
|
+
const { section, name, docs } = mod.registry.findMetaError(mod);
|
|
301
|
+
message = `${section}.${name}: ${docs.join(' ')}`;
|
|
302
|
+
}
|
|
303
|
+
else if (error.isBadOrigin) {
|
|
304
|
+
message = 'Bad origin';
|
|
305
|
+
}
|
|
306
|
+
else if (error.isCannotLookup) {
|
|
307
|
+
message = 'Could not lookup information required to validate the transaction';
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
message = 'Unknown error';
|
|
311
|
+
}
|
|
312
|
+
reject(new internal_1.PolymeshError({ code: types_1.ErrorCode.TransactionReverted, message, data }));
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @hidden
|
|
316
|
+
*/
|
|
317
|
+
handleExtrinsicSuccess(resolve, _reject, receipt) {
|
|
318
|
+
resolve(receipt);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
exports.PolymeshTransactionBase = PolymeshTransactionBase;
|
|
322
|
+
//# sourceMappingURL=PolymeshTransactionBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolymeshTransactionBase.js","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,mCAAsC;AAEtC,0CAA8D;AAC9D,oCAA+F;AAE/F,oDAAsF;AACtF,gDAAiD;AAEjD;;GAEG;AACH,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,sCAA6B,CAAA;AAC/B,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAED;;GAEG;AACH,MAAsB,uBAAuB;IAoF3C;;OAEG;IACH,YAAY,eAA4C,EAAE,OAAgB;QAtF1E;;WAEG;QACI,WAAM,GAAsB,yBAAiB,CAAC,IAAI,CAAC;QAwC1D;;;;WAIG;QACO,eAAU,GAClB,EAAkD,CAAC;QAsCnD,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GACjF,eAAe,CAAC;QAElB,IAAI,qBAAqB,EAAE;YACzB,IAAI,CAAC,UAAU,GAAG,qBAAqB,CAAC;SACzC;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAY,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACU,GAAG;;YACd,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,IAAI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CACF;AAvbD,0DAubC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
2
|
+
import { ISubmittableResult } from '@polkadot/types/types';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
import { Context, PolymeshTransactionBase } from "../internal";
|
|
5
|
+
import { BatchTransactionSpec, MapTxData } from "../types/internal";
|
|
6
|
+
/**
|
|
7
|
+
* Wrapper class for a batch of Polymesh Transactions
|
|
8
|
+
*/
|
|
9
|
+
export declare class PolymeshTransactionBatch<Args extends unknown[][] = unknown[][], Values extends unknown[] = unknown[]> extends PolymeshTransactionBase<Values> {
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*
|
|
13
|
+
* unwrapped transaction data (available right before execution)
|
|
14
|
+
*/
|
|
15
|
+
private unwrappedTransactions?;
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*
|
|
19
|
+
* underlying transactions to be batched, together with their respective arguments
|
|
20
|
+
*/
|
|
21
|
+
private inputTransactions;
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
constructor(transactionSpec: BatchTransactionSpec<Args, Values>, context: Context);
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
private getUnwrappedTransactions;
|
|
30
|
+
/**
|
|
31
|
+
* transactions in the batch with their respective arguments
|
|
32
|
+
*/
|
|
33
|
+
get transactions(): MapTxData<Args>;
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
protected composeTx(): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
protected getProtocolFees(): Promise<BigNumber>;
|
|
42
|
+
/**
|
|
43
|
+
* @note batches can't be subsidized
|
|
44
|
+
*/
|
|
45
|
+
supportsSubsidy(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
protected handleExtrinsicSuccess(resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, reject: (reason?: unknown) => void, receipt: ISubmittableResult): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=PolymeshTransactionBatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolymeshTransactionBatch.d.ts","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,oBAAmB;AAC9D,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGV,0BAAyB;AAI1B;;GAEG;AACH,qBAAa,wBAAwB,CACnC,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EACtC,MAAM,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CACpC,SAAQ,uBAAuB,CAAC,MAAM,CAAC;IACvC;;;;OAIG;IACH,OAAO,CAAC,qBAAqB,CAAC,CAA0B;IAExD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB,CAAsB;IAE/C;;OAEG;gBACS,eAAe,EAAE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO;IAQjF;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAehC;;OAEG;IACH,IAAI,YAAY,IAAI,SAAS,CAAC,IAAI,CAAC,CAKlC;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,oBAAoB,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAc1E;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC;IAY/C;;OAEG;IACI,eAAe,IAAI,OAAO;IAIjC;;OAEG;cACgB,sBAAsB,CACvC,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAC9E,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,EAClC,OAAO,EAAE,kBAAkB,GAC1B,IAAI;CAgBR"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.PolymeshTransactionBatch = void 0;
|
|
27
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
28
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
29
|
+
const internal_1 = require("../internal");
|
|
30
|
+
const conversion_1 = require("../utils/conversion");
|
|
31
|
+
const internal_2 = require("../utils/internal");
|
|
32
|
+
/**
|
|
33
|
+
* Wrapper class for a batch of Polymesh Transactions
|
|
34
|
+
*/
|
|
35
|
+
class PolymeshTransactionBatch extends internal_1.PolymeshTransactionBase {
|
|
36
|
+
/**
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
constructor(transactionSpec, context) {
|
|
40
|
+
const { transactions } = transactionSpec, rest = __rest(transactionSpec, ["transactions"]);
|
|
41
|
+
super(rest, context);
|
|
42
|
+
this.inputTransactions = transactions;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
getUnwrappedTransactions() {
|
|
48
|
+
if (!this.unwrappedTransactions) {
|
|
49
|
+
this.unwrappedTransactions = this.inputTransactions.map(({ transaction, args, feeMultiplier }) => ({
|
|
50
|
+
tag: (0, conversion_1.transactionToTxTag)(transaction),
|
|
51
|
+
args: (0, internal_2.unwrapValues)(args),
|
|
52
|
+
feeMultiplier,
|
|
53
|
+
transaction,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
return this.unwrappedTransactions;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* transactions in the batch with their respective arguments
|
|
60
|
+
*/
|
|
61
|
+
get transactions() {
|
|
62
|
+
return this.getUnwrappedTransactions().map(({ tag, args }) => ({
|
|
63
|
+
tag,
|
|
64
|
+
args,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
composeTx() {
|
|
71
|
+
const { context: { polymeshApi: { tx: { utility }, }, }, } = this;
|
|
72
|
+
return utility.batchAtomic(this.getUnwrappedTransactions().map(({ transaction, args }) => transaction(...args)));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @hidden
|
|
76
|
+
*/
|
|
77
|
+
getProtocolFees() {
|
|
78
|
+
return bluebird_1.default.reduce(this.getUnwrappedTransactions(), (total, { tag, feeMultiplier = new bignumber_js_1.default(1) }) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const [{ fees }] = yield this.context.getProtocolFees({ tags: [tag] });
|
|
80
|
+
return total.plus(fees.multipliedBy(feeMultiplier));
|
|
81
|
+
}), new bignumber_js_1.default(0));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @note batches can't be subsidized
|
|
85
|
+
*/
|
|
86
|
+
supportsSubsidy() {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @hidden
|
|
91
|
+
*/
|
|
92
|
+
handleExtrinsicSuccess(resolve, reject, receipt) {
|
|
93
|
+
// If one of the transactions in the batch fails, this event gets emitted
|
|
94
|
+
const failed = receipt.findRecord('utility', 'BatchInterrupted');
|
|
95
|
+
if (failed) {
|
|
96
|
+
const { event: { data: failedData }, } = failed;
|
|
97
|
+
const failedIndex = (0, conversion_1.u32ToBigNumber)(failedData[0]).toNumber();
|
|
98
|
+
const dispatchError = failedData[1];
|
|
99
|
+
this.handleExtrinsicFailure(resolve, reject, dispatchError, { failedIndex });
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
resolve(receipt);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.PolymeshTransactionBatch = PolymeshTransactionBatch;
|
|
107
|
+
//# sourceMappingURL=PolymeshTransactionBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolymeshTransactionBatch.js","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBatch.ts"],"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,OAAO,CAAC,OAAO,CAAC,CAAC;SAClB;IACH,CAAC;CACF;AAvHD,4DAuHC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ISubmittableResult } from '@polkadot/types/types';
|
|
2
|
+
import { MaybePostTransactionValue } from "../types/internal";
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*
|
|
6
|
+
* Represents a value or method that doesn't exist at the moment, but will exist once a certain transaction
|
|
7
|
+
* has been run
|
|
8
|
+
*/
|
|
9
|
+
export declare class PostTransactionValue<Value> {
|
|
10
|
+
private _value?;
|
|
11
|
+
private resolved;
|
|
12
|
+
private resolver;
|
|
13
|
+
private runCondition;
|
|
14
|
+
/**
|
|
15
|
+
* Array of PostTransactionValues spawned by this one via `transform` or `merge`. We use this to keep track
|
|
16
|
+
*/
|
|
17
|
+
private children;
|
|
18
|
+
constructor(resolver: (receipt: ISubmittableResult) => Promise<Value> | Value, runCondition?: () => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* Run the resolver function and assign its result to this object
|
|
21
|
+
*/
|
|
22
|
+
run(receipt: ISubmittableResult): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve the resolved value
|
|
25
|
+
*
|
|
26
|
+
* @throws if the value is being accessed before the resolver function has run
|
|
27
|
+
*/
|
|
28
|
+
get value(): Value;
|
|
29
|
+
/**
|
|
30
|
+
* Add a new PostTransactionValue to the children array to be run when this one runs
|
|
31
|
+
*/
|
|
32
|
+
private addChild;
|
|
33
|
+
/**
|
|
34
|
+
* Return a new PostTransactionValue that resolves to the value of this one processed by
|
|
35
|
+
* the passed callback. The new PostTransactionValue is resolved when this one is resolved
|
|
36
|
+
*/
|
|
37
|
+
transform<NewValue>(callback: (val: Value) => NewValue): PostTransactionValue<NewValue>;
|
|
38
|
+
/**
|
|
39
|
+
* Merge this PostTransactionValue with another PostTransactionValue (or plain value), resulting in a new
|
|
40
|
+
* PostTransactionValue that resolves once these two are resolved. The resolved value is the result of passing the
|
|
41
|
+
* resolved values of both PostTransactionValues to the callback
|
|
42
|
+
*/
|
|
43
|
+
merge<PostValue, NewValue>(postValue: MaybePostTransactionValue<PostValue>, callback: (val: Value, pval: PostValue) => NewValue): PostTransactionValue<NewValue>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=PostTransactionValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostTransactionValue.d.ts","sourceRoot":"","sources":["../../src/base/PostTransactionValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,yBAAyB,EAAE,0BAAyB;AAE7D;;;;;GAKG;AACH,qBAAa,oBAAoB,CAAC,KAAK;IACrC,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEvB,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAA0D;IAE1E,OAAO,CAAC,YAAY,CAAgB;IAEpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAuC;gBAIrD,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,EACjE,YAAY,GAAE,MAAM,OAA6B;IAMnD;;OAEG;IACU,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5D;;;;OAIG;IACH,IAAW,KAAK,IAAI,KAAK,CAaxB;IAED;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;IACI,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,QAAQ,GAAG,oBAAoB,CAAC,QAAQ,CAAC;IAW9F;;;;OAIG;IACI,KAAK,CAAC,SAAS,EAAE,QAAQ,EAC9B,SAAS,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAE/C,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,QAAQ,GAClD,oBAAoB,CAAC,QAAQ,CAAC;CAsBlC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PostTransactionValue = void 0;
|
|
13
|
+
const internal_1 = require("../internal");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*
|
|
18
|
+
* Represents a value or method that doesn't exist at the moment, but will exist once a certain transaction
|
|
19
|
+
* has been run
|
|
20
|
+
*/
|
|
21
|
+
class PostTransactionValue {
|
|
22
|
+
// eslint-disable-next-line require-jsdoc
|
|
23
|
+
constructor(resolver, runCondition = () => true) {
|
|
24
|
+
this.resolved = false;
|
|
25
|
+
/**
|
|
26
|
+
* Array of PostTransactionValues spawned by this one via `transform` or `merge`. We use this to keep track
|
|
27
|
+
*/
|
|
28
|
+
this.children = [];
|
|
29
|
+
this.resolver = resolver;
|
|
30
|
+
this.runCondition = runCondition;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Run the resolver function and assign its result to this object
|
|
34
|
+
*/
|
|
35
|
+
run(receipt) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (!this.runCondition()) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const result = yield this.resolver(receipt);
|
|
41
|
+
this.resolved = true;
|
|
42
|
+
this._value = result;
|
|
43
|
+
yield Promise.all(this.children.map(child => child.run(receipt)));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve the resolved value
|
|
48
|
+
*
|
|
49
|
+
* @throws if the value is being accessed before the resolver function has run
|
|
50
|
+
*/
|
|
51
|
+
get value() {
|
|
52
|
+
const { _value: value, resolved } = this;
|
|
53
|
+
if (!resolved) {
|
|
54
|
+
throw new internal_1.PolymeshError({
|
|
55
|
+
code: types_1.ErrorCode.FatalError,
|
|
56
|
+
message: 'Post Transaction Value accessed before the corresponding transaction was executed',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Add a new PostTransactionValue to the children array to be run when this one runs
|
|
64
|
+
*/
|
|
65
|
+
addChild(child) {
|
|
66
|
+
this.children.push(child);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Return a new PostTransactionValue that resolves to the value of this one processed by
|
|
70
|
+
* the passed callback. The new PostTransactionValue is resolved when this one is resolved
|
|
71
|
+
*/
|
|
72
|
+
transform(callback) {
|
|
73
|
+
const newResolver = () => {
|
|
74
|
+
return callback(this.value);
|
|
75
|
+
};
|
|
76
|
+
const child = new PostTransactionValue(newResolver);
|
|
77
|
+
this.addChild(child);
|
|
78
|
+
return child;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Merge this PostTransactionValue with another PostTransactionValue (or plain value), resulting in a new
|
|
82
|
+
* PostTransactionValue that resolves once these two are resolved. The resolved value is the result of passing the
|
|
83
|
+
* resolved values of both PostTransactionValues to the callback
|
|
84
|
+
*/
|
|
85
|
+
merge(postValue,
|
|
86
|
+
// cSpell: disable-next-line
|
|
87
|
+
callback) {
|
|
88
|
+
let newResolver;
|
|
89
|
+
let runCondition;
|
|
90
|
+
// do nothing on .run unless both underlying values have been resolved
|
|
91
|
+
if (postValue instanceof PostTransactionValue) {
|
|
92
|
+
newResolver = () => callback(this.value, postValue.value);
|
|
93
|
+
runCondition = () => this.resolved && postValue.resolved;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
newResolver = () => callback(this.value, postValue);
|
|
97
|
+
runCondition = () => this.resolved;
|
|
98
|
+
}
|
|
99
|
+
const child = new PostTransactionValue(newResolver, runCondition);
|
|
100
|
+
this.addChild(child);
|
|
101
|
+
if (postValue instanceof PostTransactionValue) {
|
|
102
|
+
postValue.addChild(child);
|
|
103
|
+
}
|
|
104
|
+
return child;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.PostTransactionValue = PostTransactionValue;
|
|
108
|
+
//# sourceMappingURL=PostTransactionValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostTransactionValue.js","sourceRoot":"","sources":["../../src/base/PostTransactionValue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,0CAA2C;AAC3C,oCAAoC;AAGpC;;;;;GAKG;AACH,MAAa,oBAAoB;IAc/B,yCAAyC;IACzC,YACE,QAAiE,EACjE,eAA8B,GAAY,EAAE,CAAC,IAAI;QAd3C,aAAQ,GAAG,KAAK,CAAC;QAMzB;;WAEG;QACK,aAAQ,GAAoC,EAAE,CAAC;QAOrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;OAEG;IACU,GAAG,CAAC,OAA2B;;YAC1C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE;gBACxB,OAAO;aACR;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG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