@polymeshassociation/polymesh-sdk 16.0.0-alpha.1 → 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -6
- package/README.md +3 -3
- package/api/client/AccountManagement.d.ts +12 -3
- package/api/client/AccountManagement.d.ts.map +1 -1
- package/api/client/AccountManagement.js +14 -3
- package/api/client/AccountManagement.js.map +1 -1
- package/api/client/Network.d.ts +3 -3
- package/api/client/Network.d.ts.map +1 -1
- package/api/client/Network.js +7 -11
- package/api/client/Network.js.map +1 -1
- package/api/client/Polymesh.d.ts +3 -37
- package/api/client/Polymesh.d.ts.map +1 -1
- package/api/client/Polymesh.js +3 -4
- package/api/client/Polymesh.js.map +1 -1
- package/api/entities/Account.d.ts +5 -5
- package/api/entities/Account.d.ts.map +1 -1
- package/api/entities/Account.js +18 -10
- package/api/entities/Account.js.map +1 -1
- package/api/entities/Asset/Checkpoints/Schedules.d.ts +1 -1
- package/api/entities/Asset/Settlements.d.ts +2 -2
- package/api/entities/Asset/Settlements.js +2 -2
- package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts +0 -3
- package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/ClaimCount.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts +0 -3
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Count.d.ts +0 -3
- package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Count.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts +0 -3
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js +10 -11
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +1 -1
- package/api/entities/DividendDistribution/index.d.ts.map +1 -1
- package/api/entities/DividendDistribution/index.js +2 -2
- package/api/entities/DividendDistribution/index.js.map +1 -1
- package/api/entities/MultiSig/index.d.ts +26 -0
- package/api/entities/MultiSig/index.d.ts.map +1 -0
- package/api/entities/MultiSig/index.js +75 -0
- package/api/entities/MultiSig/index.js.map +1 -0
- package/api/entities/MultiSig/types.d.ts +7 -0
- package/api/entities/MultiSig/types.d.ts.map +1 -0
- package/api/entities/MultiSig/types.js +3 -0
- package/api/entities/MultiSig/types.js.map +1 -0
- package/api/entities/MultiSigProposal/index.d.ts +36 -0
- package/api/entities/MultiSigProposal/index.d.ts.map +1 -0
- package/api/entities/MultiSigProposal/index.js +93 -0
- package/api/entities/MultiSigProposal/index.js.map +1 -0
- package/api/entities/MultiSigProposal/types.d.ts +41 -0
- package/api/entities/MultiSigProposal/types.d.ts.map +1 -0
- package/api/entities/MultiSigProposal/types.js +13 -0
- package/api/entities/MultiSigProposal/types.js.map +1 -0
- package/api/entities/types.d.ts +4 -1
- package/api/entities/types.d.ts.map +1 -1
- package/api/entities/types.js +2 -0
- package/api/entities/types.js.map +1 -1
- package/api/procedures/addAssetRequirement.d.ts +2 -2
- package/api/procedures/addAssetRequirement.d.ts.map +1 -1
- package/api/procedures/addAssetRequirement.js +3 -3
- package/api/procedures/addAssetRequirement.js.map +1 -1
- package/api/procedures/addAssetStat.d.ts +2 -2
- package/api/procedures/addAssetStat.d.ts.map +1 -1
- package/api/procedures/addAssetStat.js +8 -6
- package/api/procedures/addAssetStat.js.map +1 -1
- package/api/procedures/addInstruction.d.ts +4 -4
- package/api/procedures/addInstruction.d.ts.map +1 -1
- package/api/procedures/addInstruction.js +8 -4
- package/api/procedures/addInstruction.js.map +1 -1
- package/api/procedures/addInvestorUniquenessClaim.d.ts +2 -2
- package/api/procedures/addInvestorUniquenessClaim.d.ts.map +1 -1
- package/api/procedures/addInvestorUniquenessClaim.js +4 -6
- package/api/procedures/addInvestorUniquenessClaim.js.map +1 -1
- package/api/procedures/addTransferRestriction.d.ts +2 -2
- package/api/procedures/addTransferRestriction.d.ts.map +1 -1
- package/api/procedures/addTransferRestriction.js +19 -16
- package/api/procedures/addTransferRestriction.js.map +1 -1
- package/api/procedures/claimClassicTicker.d.ts +1 -2
- package/api/procedures/claimClassicTicker.d.ts.map +1 -1
- package/api/procedures/claimClassicTicker.js +3 -3
- package/api/procedures/claimClassicTicker.js.map +1 -1
- package/api/procedures/claimDividends.d.ts +1 -2
- package/api/procedures/claimDividends.d.ts.map +1 -1
- package/api/procedures/claimDividends.js +2 -3
- package/api/procedures/claimDividends.js.map +1 -1
- package/api/procedures/closeOffering.d.ts +2 -2
- package/api/procedures/closeOffering.d.ts.map +1 -1
- package/api/procedures/closeOffering.js +2 -3
- package/api/procedures/closeOffering.js.map +1 -1
- package/api/procedures/configureDividendDistribution.d.ts +3 -3
- package/api/procedures/configureDividendDistribution.d.ts.map +1 -1
- package/api/procedures/configureDividendDistribution.js +4 -3
- package/api/procedures/configureDividendDistribution.js.map +1 -1
- package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts +2 -2
- package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts.map +1 -1
- package/api/procedures/consumeAddMultiSigSignerAuthorization.js +4 -3
- package/api/procedures/consumeAddMultiSigSignerAuthorization.js.map +1 -1
- package/api/procedures/consumeAuthorizationRequests.d.ts +2 -2
- package/api/procedures/consumeAuthorizationRequests.d.ts.map +1 -1
- package/api/procedures/consumeAuthorizationRequests.js +4 -8
- package/api/procedures/consumeAuthorizationRequests.js.map +1 -1
- package/api/procedures/consumeJoinOrRotateAuthorization.d.ts +2 -2
- package/api/procedures/consumeJoinOrRotateAuthorization.d.ts.map +1 -1
- package/api/procedures/consumeJoinOrRotateAuthorization.js +7 -8
- package/api/procedures/consumeJoinOrRotateAuthorization.js.map +1 -1
- package/api/procedures/controllerTransfer.d.ts +2 -2
- package/api/procedures/controllerTransfer.d.ts.map +1 -1
- package/api/procedures/controllerTransfer.js +2 -3
- package/api/procedures/controllerTransfer.js.map +1 -1
- package/api/procedures/createAsset.d.ts +2 -2
- package/api/procedures/createAsset.d.ts.map +1 -1
- package/api/procedures/createAsset.js +41 -21
- package/api/procedures/createAsset.js.map +1 -1
- package/api/procedures/createCheckpoint.d.ts +3 -3
- package/api/procedures/createCheckpoint.d.ts.map +1 -1
- package/api/procedures/createCheckpoint.js +4 -3
- package/api/procedures/createCheckpoint.js.map +1 -1
- package/api/procedures/createCheckpointSchedule.d.ts +3 -3
- package/api/procedures/createCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/createCheckpointSchedule.js +4 -3
- package/api/procedures/createCheckpointSchedule.js.map +1 -1
- package/api/procedures/createGroup.d.ts +3 -3
- package/api/procedures/createGroup.d.ts.map +1 -1
- package/api/procedures/createGroup.js +4 -3
- package/api/procedures/createGroup.js.map +1 -1
- package/api/procedures/createMultiSig.d.ts +13 -0
- package/api/procedures/createMultiSig.d.ts.map +1 -0
- package/api/procedures/createMultiSig.js +56 -0
- package/api/procedures/createMultiSig.js.map +1 -0
- package/api/procedures/createPortfolios.d.ts +2 -3
- package/api/procedures/createPortfolios.d.ts.map +1 -1
- package/api/procedures/createPortfolios.js +6 -4
- package/api/procedures/createPortfolios.js.map +1 -1
- package/api/procedures/createVenue.d.ts +2 -3
- package/api/procedures/createVenue.d.ts.map +1 -1
- package/api/procedures/createVenue.js +4 -3
- package/api/procedures/createVenue.js.map +1 -1
- package/api/procedures/deletePortfolio.d.ts +2 -2
- package/api/procedures/deletePortfolio.d.ts.map +1 -1
- package/api/procedures/deletePortfolio.js +2 -3
- package/api/procedures/deletePortfolio.js.map +1 -1
- package/api/procedures/investInOffering.d.ts +2 -2
- package/api/procedures/investInOffering.d.ts.map +1 -1
- package/api/procedures/investInOffering.js +2 -3
- package/api/procedures/investInOffering.js.map +1 -1
- package/api/procedures/inviteAccount.d.ts +2 -3
- package/api/procedures/inviteAccount.d.ts.map +1 -1
- package/api/procedures/inviteAccount.js +4 -3
- package/api/procedures/inviteAccount.js.map +1 -1
- package/api/procedures/inviteExternalAgent.d.ts +3 -3
- package/api/procedures/inviteExternalAgent.d.ts.map +1 -1
- package/api/procedures/inviteExternalAgent.js +10 -6
- package/api/procedures/inviteExternalAgent.js.map +1 -1
- package/api/procedures/issueTokens.d.ts +2 -2
- package/api/procedures/issueTokens.d.ts.map +1 -1
- package/api/procedures/issueTokens.js +3 -3
- package/api/procedures/issueTokens.js.map +1 -1
- package/api/procedures/launchOffering.d.ts +3 -3
- package/api/procedures/launchOffering.d.ts.map +1 -1
- package/api/procedures/launchOffering.js +4 -3
- package/api/procedures/launchOffering.js.map +1 -1
- package/api/procedures/leaveIdentity.d.ts +1 -2
- package/api/procedures/leaveIdentity.d.ts.map +1 -1
- package/api/procedures/leaveIdentity.js +1 -1
- package/api/procedures/leaveIdentity.js.map +1 -1
- package/api/procedures/linkCaDocs.d.ts +2 -2
- package/api/procedures/linkCaDocs.d.ts.map +1 -1
- package/api/procedures/linkCaDocs.js +2 -3
- package/api/procedures/linkCaDocs.js.map +1 -1
- package/api/procedures/modifyAllowance.d.ts +2 -2
- package/api/procedures/modifyAllowance.d.ts.map +1 -1
- package/api/procedures/modifyAllowance.js +2 -3
- package/api/procedures/modifyAllowance.js.map +1 -1
- package/api/procedures/modifyAsset.d.ts +2 -2
- package/api/procedures/modifyAsset.d.ts.map +1 -1
- package/api/procedures/modifyAsset.js +4 -3
- package/api/procedures/modifyAsset.js.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +2 -2
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.js +2 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -1
- package/api/procedures/modifyCaCheckpoint.d.ts +2 -2
- package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -1
- package/api/procedures/modifyCaCheckpoint.js +3 -19
- package/api/procedures/modifyCaCheckpoint.js.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.d.ts +2 -2
- package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.js +1 -1
- package/api/procedures/modifyCaDefaultConfig.js.map +1 -1
- package/api/procedures/modifyClaims.d.ts +2 -2
- package/api/procedures/modifyClaims.d.ts.map +1 -1
- package/api/procedures/modifyClaims.js +3 -2
- package/api/procedures/modifyClaims.js.map +1 -1
- package/api/procedures/modifyComplianceRequirement.d.ts +2 -2
- package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -1
- package/api/procedures/modifyComplianceRequirement.js +2 -3
- package/api/procedures/modifyComplianceRequirement.js.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.d.ts +2 -2
- package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.js +2 -3
- package/api/procedures/modifyCorporateActionsAgent.js.map +1 -1
- 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 +2 -2
- package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.js +10 -9
- package/api/procedures/modifyInstructionAffirmation.js.map +1 -1
- package/api/procedures/modifyOfferingTimes.d.ts +2 -2
- package/api/procedures/modifyOfferingTimes.d.ts.map +1 -1
- package/api/procedures/modifyOfferingTimes.js +2 -3
- package/api/procedures/modifyOfferingTimes.js.map +1 -1
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts +2 -2
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts.map +1 -1
- package/api/procedures/modifyPrimaryIssuanceAgent.js +2 -3
- package/api/procedures/modifyPrimaryIssuanceAgent.js.map +1 -1
- package/api/procedures/modifySignerPermissions.d.ts +2 -2
- package/api/procedures/modifySignerPermissions.d.ts.map +1 -1
- package/api/procedures/modifySignerPermissions.js +2 -3
- package/api/procedures/modifySignerPermissions.js.map +1 -1
- package/api/procedures/modifyVenue.d.ts +2 -2
- package/api/procedures/modifyVenue.d.ts.map +1 -1
- package/api/procedures/modifyVenue.js +1 -1
- package/api/procedures/modifyVenue.js.map +1 -1
- package/api/procedures/moveFunds.d.ts +2 -2
- package/api/procedures/moveFunds.d.ts.map +1 -1
- package/api/procedures/moveFunds.js +2 -3
- package/api/procedures/moveFunds.js.map +1 -1
- package/api/procedures/payDividends.d.ts +2 -2
- package/api/procedures/payDividends.d.ts.map +1 -1
- package/api/procedures/payDividends.js +2 -3
- package/api/procedures/payDividends.js.map +1 -1
- package/api/procedures/quitCustody.d.ts +2 -2
- package/api/procedures/quitCustody.d.ts.map +1 -1
- package/api/procedures/quitCustody.js +2 -3
- package/api/procedures/quitCustody.js.map +1 -1
- package/api/procedures/quitSubsidy.d.ts +2 -2
- package/api/procedures/quitSubsidy.d.ts.map +1 -1
- package/api/procedures/quitSubsidy.js +2 -3
- package/api/procedures/quitSubsidy.js.map +1 -1
- package/api/procedures/reclaimDividendDistributionFunds.d.ts +2 -2
- package/api/procedures/reclaimDividendDistributionFunds.d.ts.map +1 -1
- package/api/procedures/reclaimDividendDistributionFunds.js +2 -3
- package/api/procedures/reclaimDividendDistributionFunds.js.map +1 -1
- package/api/procedures/redeemTokens.d.ts +2 -2
- package/api/procedures/redeemTokens.d.ts.map +1 -1
- package/api/procedures/redeemTokens.js +2 -3
- package/api/procedures/redeemTokens.js.map +1 -1
- package/api/procedures/registerIdentity.d.ts +2 -3
- package/api/procedures/registerIdentity.d.ts.map +1 -1
- package/api/procedures/registerIdentity.js +4 -3
- package/api/procedures/registerIdentity.js.map +1 -1
- package/api/procedures/removeAssetRequirement.d.ts +2 -2
- package/api/procedures/removeAssetRequirement.d.ts.map +1 -1
- package/api/procedures/removeAssetRequirement.js +3 -3
- package/api/procedures/removeAssetRequirement.js.map +1 -1
- package/api/procedures/removeAssetStat.d.ts +2 -2
- package/api/procedures/removeAssetStat.d.ts.map +1 -1
- package/api/procedures/removeAssetStat.js +5 -7
- package/api/procedures/removeAssetStat.js.map +1 -1
- package/api/procedures/removeCheckpointSchedule.d.ts +2 -2
- package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/removeCheckpointSchedule.js +2 -3
- package/api/procedures/removeCheckpointSchedule.js.map +1 -1
- package/api/procedures/removeCorporateAction.d.ts +2 -2
- package/api/procedures/removeCorporateAction.d.ts.map +1 -1
- package/api/procedures/removeCorporateAction.js +2 -3
- package/api/procedures/removeCorporateAction.js.map +1 -1
- package/api/procedures/removeCorporateActionsAgent.d.ts +2 -2
- package/api/procedures/removeCorporateActionsAgent.d.ts.map +1 -1
- package/api/procedures/removeCorporateActionsAgent.js +2 -3
- package/api/procedures/removeCorporateActionsAgent.js.map +1 -1
- package/api/procedures/removeExternalAgent.d.ts +2 -2
- package/api/procedures/removeExternalAgent.d.ts.map +1 -1
- package/api/procedures/removeExternalAgent.js +2 -3
- package/api/procedures/removeExternalAgent.js.map +1 -1
- package/api/procedures/removePrimaryIssuanceAgent.d.ts +2 -2
- package/api/procedures/removePrimaryIssuanceAgent.d.ts.map +1 -1
- package/api/procedures/removePrimaryIssuanceAgent.js +2 -3
- package/api/procedures/removePrimaryIssuanceAgent.js.map +1 -1
- package/api/procedures/removeSecondaryAccounts.d.ts +1 -2
- package/api/procedures/removeSecondaryAccounts.d.ts.map +1 -1
- package/api/procedures/removeSecondaryAccounts.js +2 -3
- package/api/procedures/removeSecondaryAccounts.js.map +1 -1
- package/api/procedures/renamePortfolio.d.ts +2 -2
- package/api/procedures/renamePortfolio.d.ts.map +1 -1
- package/api/procedures/renamePortfolio.js +3 -3
- package/api/procedures/renamePortfolio.js.map +1 -1
- package/api/procedures/rescheduleInstruction.d.ts +1 -2
- package/api/procedures/rescheduleInstruction.d.ts.map +1 -1
- package/api/procedures/rescheduleInstruction.js +3 -3
- package/api/procedures/rescheduleInstruction.js.map +1 -1
- package/api/procedures/reserveTicker.d.ts +3 -3
- package/api/procedures/reserveTicker.d.ts.map +1 -1
- package/api/procedures/reserveTicker.js +4 -3
- package/api/procedures/reserveTicker.js.map +1 -1
- package/api/procedures/setAssetDocuments.d.ts +2 -2
- package/api/procedures/setAssetDocuments.d.ts.map +1 -1
- package/api/procedures/setAssetDocuments.js +2 -1
- package/api/procedures/setAssetDocuments.js.map +1 -1
- package/api/procedures/setAssetRequirements.d.ts +2 -2
- package/api/procedures/setAssetRequirements.d.ts.map +1 -1
- package/api/procedures/setAssetRequirements.js +10 -9
- package/api/procedures/setAssetRequirements.js.map +1 -1
- package/api/procedures/setCustodian.d.ts +3 -3
- package/api/procedures/setCustodian.d.ts.map +1 -1
- package/api/procedures/setCustodian.js +6 -3
- package/api/procedures/setCustodian.js.map +1 -1
- package/api/procedures/setGroupPermissions.d.ts +2 -2
- package/api/procedures/setGroupPermissions.d.ts.map +1 -1
- package/api/procedures/setGroupPermissions.js +2 -3
- package/api/procedures/setGroupPermissions.js.map +1 -1
- package/api/procedures/setPermissionGroup.d.ts +2 -2
- package/api/procedures/setPermissionGroup.d.ts.map +1 -1
- package/api/procedures/setPermissionGroup.js +7 -6
- package/api/procedures/setPermissionGroup.js.map +1 -1
- package/api/procedures/setTransferRestrictions.d.ts +3 -8
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +45 -118
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/subsidizeAccount.d.ts +2 -3
- package/api/procedures/subsidizeAccount.d.ts.map +1 -1
- package/api/procedures/subsidizeAccount.js +4 -3
- package/api/procedures/subsidizeAccount.js.map +1 -1
- package/api/procedures/toggleFreezeOffering.d.ts +2 -2
- package/api/procedures/toggleFreezeOffering.d.ts.map +1 -1
- package/api/procedures/toggleFreezeOffering.js +18 -17
- package/api/procedures/toggleFreezeOffering.js.map +1 -1
- package/api/procedures/toggleFreezeSecondaryAccounts.d.ts +2 -2
- package/api/procedures/toggleFreezeSecondaryAccounts.d.ts.map +1 -1
- package/api/procedures/toggleFreezeSecondaryAccounts.js +9 -7
- package/api/procedures/toggleFreezeSecondaryAccounts.js.map +1 -1
- package/api/procedures/toggleFreezeTransfers.d.ts +2 -2
- package/api/procedures/toggleFreezeTransfers.d.ts.map +1 -1
- package/api/procedures/toggleFreezeTransfers.js +13 -12
- package/api/procedures/toggleFreezeTransfers.js.map +1 -1
- package/api/procedures/togglePauseRequirements.d.ts +2 -2
- package/api/procedures/togglePauseRequirements.d.ts.map +1 -1
- package/api/procedures/togglePauseRequirements.js +3 -3
- package/api/procedures/togglePauseRequirements.js.map +1 -1
- package/api/procedures/transferAssetOwnership.d.ts +3 -3
- package/api/procedures/transferAssetOwnership.d.ts.map +1 -1
- package/api/procedures/transferAssetOwnership.js +4 -3
- package/api/procedures/transferAssetOwnership.js.map +1 -1
- package/api/procedures/transferPolyx.d.ts +2 -2
- package/api/procedures/transferPolyx.d.ts.map +1 -1
- package/api/procedures/transferPolyx.js +8 -8
- package/api/procedures/transferPolyx.js.map +1 -1
- package/api/procedures/transferTickerOwnership.d.ts +3 -3
- package/api/procedures/transferTickerOwnership.d.ts.map +1 -1
- package/api/procedures/transferTickerOwnership.js +4 -3
- package/api/procedures/transferTickerOwnership.js.map +1 -1
- package/api/procedures/types.d.ts +33 -12
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js +23 -1
- package/api/procedures/types.js.map +1 -1
- package/api/procedures/utils.d.ts +2 -1
- package/api/procedures/utils.d.ts.map +1 -1
- package/api/procedures/utils.js +8 -1
- package/api/procedures/utils.js.map +1 -1
- package/api/procedures/waivePermissions.d.ts +2 -2
- package/api/procedures/waivePermissions.d.ts.map +1 -1
- package/api/procedures/waivePermissions.js +2 -3
- package/api/procedures/waivePermissions.js.map +1 -1
- package/base/Context.d.ts +2 -15
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +3 -37
- package/base/Context.js.map +1 -1
- package/base/PolymeshError.js +1 -1
- package/base/PolymeshError.js.map +1 -1
- package/base/PolymeshTransaction.d.ts +19 -20
- package/base/PolymeshTransaction.d.ts.map +1 -1
- package/base/PolymeshTransaction.js +12 -19
- package/base/PolymeshTransaction.js.map +1 -1
- package/base/PolymeshTransactionBase.d.ts +35 -70
- package/base/PolymeshTransactionBase.d.ts.map +1 -1
- package/base/PolymeshTransactionBase.js +68 -237
- package/base/PolymeshTransactionBase.js.map +1 -1
- package/base/PolymeshTransactionBatch.d.ts +15 -43
- package/base/PolymeshTransactionBatch.d.ts.map +1 -1
- package/base/PolymeshTransactionBatch.js +18 -107
- package/base/PolymeshTransactionBatch.js.map +1 -1
- 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 +35 -10
- package/base/Procedure.d.ts.map +1 -1
- package/base/Procedure.js +92 -27
- package/base/Procedure.js.map +1 -1
- 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 +4 -2
- package/base/types.d.ts.map +1 -1
- package/internal.d.ts +6 -1
- package/internal.d.ts.map +1 -1
- package/internal.js +15 -5
- package/internal.js.map +1 -1
- package/middleware/queriesV2.d.ts.map +1 -1
- package/middleware/queriesV2.js +11 -7
- package/middleware/queriesV2.js.map +1 -1
- package/middleware/types.d.ts +524 -484
- package/middleware/types.d.ts.map +1 -1
- package/middleware/types.js +499 -459
- package/middleware/types.js.map +1 -1
- package/middleware/typesV2.d.ts +20 -4
- package/middleware/typesV2.d.ts.map +1 -1
- package/middleware/typesV2.js +9 -2
- package/middleware/typesV2.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-16.0.0-beta.1.tgz +0 -0
- package/package.json +6 -6
- package/types/index.d.ts +66 -75
- package/types/index.d.ts.map +1 -1
- package/types/index.js +25 -8
- package/types/index.js.map +1 -1
- package/types/internal.d.ts +104 -73
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js +8 -27
- package/types/internal.js.map +1 -1
- package/utils/conversion.d.ts +24 -8
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +99 -36
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +14 -32
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +53 -121
- package/utils/internal.js.map +1 -1
- package/utils/typeguards.d.ts +2 -2
- package/utils/typeguards.d.ts.map +1 -1
- package/utils/typeguards.js.map +1 -1
- package/api/procedures/createTransactionBatch.d.ts +0 -25
- package/api/procedures/createTransactionBatch.d.ts.map +0 -1
- package/api/procedures/createTransactionBatch.js +0 -118
- package/api/procedures/createTransactionBatch.js.map +0 -1
- package/npm-package/polymeshassociation-polymesh-sdk-16.0.0-alpha.1.tgz +0 -0
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
|
-
import {
|
|
3
|
+
import { DispatchError } from '@polkadot/types/interfaces';
|
|
4
4
|
import { ISubmittableResult, Signer as PolkadotSigner } from '@polkadot/types/types';
|
|
5
5
|
import BigNumber from 'bignumber.js';
|
|
6
6
|
import { EventEmitter } from 'events';
|
|
7
7
|
import { Context, Identity, PolymeshError } from "../internal";
|
|
8
|
-
import {
|
|
9
|
-
import { BaseTransactionSpec,
|
|
8
|
+
import { Fees, PayingAccount, TransactionStatus } from "../types";
|
|
9
|
+
import { BaseTransactionSpec, PostTransactionValueArray } from "../types/internal";
|
|
10
10
|
/**
|
|
11
11
|
* Wrapper class for a Polymesh Transaction
|
|
12
12
|
*/
|
|
13
|
-
export declare abstract class PolymeshTransactionBase<
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
static toTransactionSpec<R, T>(transaction: PolymeshTransactionBase<R, T>): BaseTransactionSpec<R, T>;
|
|
13
|
+
export declare abstract class PolymeshTransactionBase<Values extends unknown[] = unknown[]> {
|
|
18
14
|
/**
|
|
19
15
|
* current status of the transaction
|
|
20
16
|
*/
|
|
@@ -43,6 +39,10 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
43
39
|
* number of the block where this transaction resides (status: `Succeeded`, `Failed`)
|
|
44
40
|
*/
|
|
45
41
|
blockNumber?: BigNumber;
|
|
42
|
+
/**
|
|
43
|
+
* whether this transaction failing makes the entire transaction queue fail or not
|
|
44
|
+
*/
|
|
45
|
+
isCritical: boolean;
|
|
46
46
|
/**
|
|
47
47
|
* @hidden
|
|
48
48
|
*
|
|
@@ -53,9 +53,9 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
53
53
|
/**
|
|
54
54
|
* @hidden
|
|
55
55
|
*
|
|
56
|
-
*
|
|
56
|
+
* wrappers for values that will exist after this transaction has executed
|
|
57
57
|
*/
|
|
58
|
-
protected
|
|
58
|
+
protected postValues: PostTransactionValueArray<Values>;
|
|
59
59
|
/**
|
|
60
60
|
* @hidden
|
|
61
61
|
*
|
|
@@ -77,27 +77,20 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
77
77
|
/**
|
|
78
78
|
* @hidden
|
|
79
79
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
80
|
+
* used by procedures to set the fee manually in case the protocol op can't be
|
|
81
|
+
* dynamically generated from the transaction name, or a specific procedure has
|
|
82
|
+
* special rules for calculating them
|
|
82
83
|
*/
|
|
83
|
-
protected
|
|
84
|
+
protected protocolFee?: BigNumber;
|
|
84
85
|
protected context: Context;
|
|
85
86
|
/**
|
|
86
87
|
* @hidden
|
|
87
|
-
* whether the queue has run or not (prevents re-running)
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
constructor(transactionSpec: BaseTransactionSpec<Values>, context: Context);
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Run the transaction and update its status
|
|
92
92
|
*/
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Run the transaction, update its status and return a result if applicable.
|
|
96
|
-
* Certain transactions create Entities on the blockchain, and those Entities are returned
|
|
97
|
-
* for convenience. For example, when running a transaction that creates an Asset, the Asset itself
|
|
98
|
-
* is returned
|
|
99
|
-
*/
|
|
100
|
-
run(): Promise<TransformedReturnValue>;
|
|
93
|
+
run(): Promise<void>;
|
|
101
94
|
/**
|
|
102
95
|
* @hidden
|
|
103
96
|
*
|
|
@@ -112,34 +105,25 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
112
105
|
*
|
|
113
106
|
* @returns unsubscribe function
|
|
114
107
|
*/
|
|
115
|
-
onStatusChange(listener: (transaction:
|
|
116
|
-
/**
|
|
117
|
-
* Retrieve a breakdown of the fees required to run this transaction, as well as the Account responsible for paying them
|
|
118
|
-
*
|
|
119
|
-
* @note these values might be inaccurate if the transaction is run at a later time. This can be due to a governance vote or other
|
|
120
|
-
* chain related factors (like modifications to a specific subsidizer relationship or a chain upgrade)
|
|
121
|
-
*/
|
|
122
|
-
getTotalFees(): Promise<PayingAccountFees>;
|
|
108
|
+
onStatusChange(listener: (transaction: this) => void): () => void;
|
|
123
109
|
/**
|
|
124
|
-
*
|
|
110
|
+
* 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
|
|
111
|
+
* charged to it (allowance). A null allowance means that there is no limit to that amount
|
|
125
112
|
*
|
|
126
|
-
*
|
|
127
|
-
* If there is an error (timeout or middleware offline) it will be passed to this callback
|
|
113
|
+
* A null return value signifies that the caller Account would pay the fees
|
|
128
114
|
*
|
|
129
|
-
* @note this
|
|
130
|
-
*
|
|
131
|
-
* @throws if the middleware wasn't enabled when instantiating the SDK client
|
|
115
|
+
* @note this value might change if, before running the transaction, the caller Account enters (or leaves)
|
|
116
|
+
* a subsidizer relationship
|
|
132
117
|
*/
|
|
133
|
-
|
|
118
|
+
getPayingAccount(): Promise<PayingAccount | null>;
|
|
134
119
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* the event is emitted with an error
|
|
120
|
+
* Get all (protocol and gas) fees associated with this transaction. Returns null
|
|
121
|
+
* if the transaction is not ready yet (this can happen if it depends on the execution of a
|
|
122
|
+
* previous transaction in the queue)
|
|
139
123
|
*
|
|
140
|
-
* @note
|
|
124
|
+
* @note this value might change if the transaction is run at a later time. This can be due to a governance vote
|
|
141
125
|
*/
|
|
142
|
-
|
|
126
|
+
getFees(): Promise<Fees | null>;
|
|
143
127
|
/**
|
|
144
128
|
* @hidden
|
|
145
129
|
*/
|
|
@@ -149,7 +133,7 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
149
133
|
* AND the caller is being subsidized by a third party, the transaction can't be executed and trying
|
|
150
134
|
* to do so will result in an error
|
|
151
135
|
*
|
|
152
|
-
* @note this depends on the type of transaction itself (e.
|
|
136
|
+
* @note this depends on the type of transaction itself (i.e. `staking.bond` can't be subsidized, but `asset.createAsset` can)
|
|
153
137
|
*/
|
|
154
138
|
abstract supportsSubsidy(): boolean;
|
|
155
139
|
/**
|
|
@@ -165,38 +149,19 @@ export declare abstract class PolymeshTransactionBase<ReturnValue = void, Transf
|
|
|
165
149
|
* and is always paid by the caller
|
|
166
150
|
*/
|
|
167
151
|
protected ignoresSubsidy(): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Return this transaction's protocol fees. These are extra fees charged for
|
|
170
|
-
* specific operations on the chain. Not to be confused with network fees (which
|
|
171
|
-
* depend on the complexity of the operation), protocol fees are set by governance and/or
|
|
172
|
-
* chain upgrades
|
|
173
|
-
*/
|
|
174
|
-
abstract getProtocolFees(): Promise<BigNumber>;
|
|
175
|
-
/**
|
|
176
|
-
* @hidden
|
|
177
|
-
*/
|
|
178
|
-
protected handleExtrinsicFailure(_resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, reject: (reason?: unknown) => void, error: SpRuntimeDispatchError, data?: Record<string, unknown>): void;
|
|
179
152
|
/**
|
|
180
153
|
* @hidden
|
|
154
|
+
*
|
|
155
|
+
* Fetch and calculate this transaction's protocol fees
|
|
181
156
|
*/
|
|
182
|
-
protected
|
|
157
|
+
protected abstract getProtocolFees(): Promise<BigNumber>;
|
|
183
158
|
/**
|
|
184
159
|
* @hidden
|
|
185
|
-
*
|
|
186
|
-
* Check if balances and allowances (both third party and signing Account)
|
|
187
|
-
* are sufficient to cover this transaction's fees
|
|
188
160
|
*/
|
|
189
|
-
|
|
161
|
+
protected handleExtrinsicFailure(_resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, reject: (reason?: unknown) => void, error: DispatchError, data?: Record<string, unknown>): void;
|
|
190
162
|
/**
|
|
191
163
|
* @hidden
|
|
192
|
-
*
|
|
193
|
-
* 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
|
|
194
|
-
* charged to it (allowance) in case of a subsidy
|
|
195
|
-
*
|
|
196
|
-
* @note the paying Account might change if, before running the transaction, the caller Account enters (or leaves)
|
|
197
|
-
* a subsidizer relationship. A governance vote or chain upgrade could also cause the value to change between the time
|
|
198
|
-
* this method is called and the time the transaction is run
|
|
199
164
|
*/
|
|
200
|
-
|
|
165
|
+
protected handleExtrinsicSuccess(resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, _reject: (reason?: unknown) => void, receipt: ISubmittableResult): void;
|
|
201
166
|
}
|
|
202
167
|
//# sourceMappingURL=PolymeshTransactionBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolymeshTransactionBase.d.ts","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBase.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PolymeshTransactionBase.d.ts","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBase.ts"],"names":[],"mappings":"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"}
|
|
@@ -14,22 +14,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.PolymeshTransactionBase = void 0;
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
18
17
|
const events_1 = require("events");
|
|
19
|
-
const lodash_1 = require("lodash");
|
|
20
18
|
const internal_1 = require("../internal");
|
|
21
|
-
const queries_1 = require("../middleware/queries");
|
|
22
19
|
const types_1 = require("../types");
|
|
23
|
-
const internal_2 = require("../types/internal");
|
|
24
20
|
const conversion_1 = require("../utils/conversion");
|
|
25
|
-
const
|
|
21
|
+
const internal_2 = require("../utils/internal");
|
|
26
22
|
/**
|
|
27
23
|
* @hidden
|
|
28
24
|
*/
|
|
29
25
|
var Event;
|
|
30
26
|
(function (Event) {
|
|
31
27
|
Event["StatusChange"] = "StatusChange";
|
|
32
|
-
Event["ProcessedByMiddleware"] = "ProcessedByMiddleware";
|
|
33
28
|
})(Event || (Event = {}));
|
|
34
29
|
/**
|
|
35
30
|
* Wrapper class for a Polymesh Transaction
|
|
@@ -46,61 +41,31 @@ class PolymeshTransactionBase {
|
|
|
46
41
|
/**
|
|
47
42
|
* @hidden
|
|
48
43
|
*
|
|
49
|
-
*
|
|
44
|
+
* wrappers for values that will exist after this transaction has executed
|
|
50
45
|
*/
|
|
46
|
+
this.postValues = [];
|
|
47
|
+
const { postTransactionValues, signingAddress, signer, isCritical, fee, paidForBy } = transactionSpec;
|
|
48
|
+
if (postTransactionValues) {
|
|
49
|
+
this.postValues = postTransactionValues;
|
|
50
|
+
}
|
|
51
51
|
this.emitter = new events_1.EventEmitter();
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
* whether the queue has run or not (prevents re-running)
|
|
55
|
-
*/
|
|
56
|
-
this.hasRun = false;
|
|
57
|
-
const { resolver, transformer, signingAddress, signer, paidForBy } = transactionSpec;
|
|
58
52
|
this.signingAddress = signingAddress;
|
|
59
53
|
this.signer = signer;
|
|
54
|
+
this.isCritical = isCritical;
|
|
55
|
+
this.protocolFee = fee;
|
|
60
56
|
this.context = context;
|
|
61
57
|
this.paidForBy = paidForBy;
|
|
62
|
-
this.transformer = transformer;
|
|
63
|
-
this.resolver = resolver;
|
|
64
58
|
}
|
|
65
59
|
/**
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
static toTransactionSpec(transaction) {
|
|
69
|
-
const { resolver, transformer, paidForBy } = transaction;
|
|
70
|
-
return {
|
|
71
|
-
resolver,
|
|
72
|
-
transformer,
|
|
73
|
-
paidForBy,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Run the transaction, update its status and return a result if applicable.
|
|
78
|
-
* Certain transactions create Entities on the blockchain, and those Entities are returned
|
|
79
|
-
* for convenience. For example, when running a transaction that creates an Asset, the Asset itself
|
|
80
|
-
* is returned
|
|
60
|
+
* Run the transaction and update its status
|
|
81
61
|
*/
|
|
82
62
|
run() {
|
|
83
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
if (this.hasRun) {
|
|
85
|
-
throw new internal_1.PolymeshError({
|
|
86
|
-
code: types_1.ErrorCode.General,
|
|
87
|
-
message: 'Cannot re-run a Transaction',
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
64
|
try {
|
|
91
|
-
yield this.assertFeesCovered();
|
|
92
65
|
const receipt = yield this.internalRun();
|
|
93
66
|
this.receipt = receipt;
|
|
94
|
-
|
|
95
|
-
let value;
|
|
96
|
-
if ((0, internal_2.isResolverFunction)(resolver)) {
|
|
97
|
-
value = yield resolver(receipt);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
value = resolver;
|
|
101
|
-
}
|
|
67
|
+
yield Promise.all(this.postValues.map(postValue => postValue.run(receipt)));
|
|
102
68
|
this.updateStatus(types_1.TransactionStatus.Succeeded);
|
|
103
|
-
return transformer(value);
|
|
104
69
|
}
|
|
105
70
|
catch (err) {
|
|
106
71
|
const error = err;
|
|
@@ -123,16 +88,6 @@ class PolymeshTransactionBase {
|
|
|
123
88
|
}
|
|
124
89
|
throw error;
|
|
125
90
|
}
|
|
126
|
-
finally {
|
|
127
|
-
this.hasRun = true;
|
|
128
|
-
/*
|
|
129
|
-
* We do not await this promise because it is supposed to run in the background, and
|
|
130
|
-
* any errors encountered are emitted. If the user isn't listening, they shouldn't
|
|
131
|
-
* care about middleware (or other) errors anyway
|
|
132
|
-
*/
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
134
|
-
this.emitWhenMiddlewareIsSynced();
|
|
135
|
-
}
|
|
136
91
|
});
|
|
137
92
|
}
|
|
138
93
|
/**
|
|
@@ -143,13 +98,14 @@ class PolymeshTransactionBase {
|
|
|
143
98
|
*/
|
|
144
99
|
internalRun() {
|
|
145
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
const { signingAddress, signer
|
|
147
|
-
const nonce = context.getNonce().toNumber();
|
|
101
|
+
const { signingAddress, signer } = this;
|
|
148
102
|
this.updateStatus(types_1.TransactionStatus.Unapproved);
|
|
149
103
|
return new Promise((resolve, reject) => {
|
|
150
104
|
const txWithArgs = this.composeTx();
|
|
151
105
|
let settingBlockData = Promise.resolve();
|
|
152
|
-
|
|
106
|
+
// nonce: -1 takes pending transactions into consideration.
|
|
107
|
+
// 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
|
|
108
|
+
const gettingUnsub = txWithArgs.signAndSend(signingAddress, { nonce: -1, signer }, receipt => {
|
|
153
109
|
const { status } = receipt;
|
|
154
110
|
let isLastCallback = false;
|
|
155
111
|
let unsubscribing = Promise.resolve();
|
|
@@ -163,7 +119,7 @@ class PolymeshTransactionBase {
|
|
|
163
119
|
* is emitted, and at the same time. We do not resolve or reject the containing promise until this
|
|
164
120
|
* one resolves
|
|
165
121
|
*/
|
|
166
|
-
settingBlockData = (0,
|
|
122
|
+
settingBlockData = (0, internal_2.defusePromise)(this.context.polymeshApi.rpc.chain.getBlock(blockHash).then(({ block }) => {
|
|
167
123
|
this.blockHash = (0, conversion_1.hashToString)(blockHash);
|
|
168
124
|
this.blockNumber = (0, conversion_1.u32ToBigNumber)(block.header.number.unwrap());
|
|
169
125
|
// we know that the index has to be set by the time the transaction is included in a block
|
|
@@ -171,7 +127,7 @@ class PolymeshTransactionBase {
|
|
|
171
127
|
this.txIndex = new bignumber_js_1.default(receipt.txIndex);
|
|
172
128
|
}));
|
|
173
129
|
// if the extrinsic failed due to an on-chain error, we should handle it in a special way
|
|
174
|
-
|
|
130
|
+
extrinsicFailedEvent = receipt.findRecord('system', 'ExtrinsicFailed');
|
|
175
131
|
// extrinsic failed so we can unsubscribe
|
|
176
132
|
isLastCallback = !!extrinsicFailedEvent;
|
|
177
133
|
}
|
|
@@ -190,7 +146,7 @@ class PolymeshTransactionBase {
|
|
|
190
146
|
*/
|
|
191
147
|
let finishing = Promise.resolve();
|
|
192
148
|
if (extrinsicFailedEvent) {
|
|
193
|
-
const { data } = extrinsicFailedEvent;
|
|
149
|
+
const { event: { data }, } = extrinsicFailedEvent;
|
|
194
150
|
finishing = Promise.all([settingBlockData, unsubscribing]).then(() => {
|
|
195
151
|
this.handleExtrinsicFailure(resolve, reject, data[0]);
|
|
196
152
|
});
|
|
@@ -236,139 +192,96 @@ class PolymeshTransactionBase {
|
|
|
236
192
|
* @returns unsubscribe function
|
|
237
193
|
*/
|
|
238
194
|
onStatusChange(listener) {
|
|
239
|
-
|
|
240
|
-
emitter.on(Event.StatusChange, listener);
|
|
195
|
+
this.emitter.on(Event.StatusChange, listener);
|
|
241
196
|
return () => {
|
|
242
|
-
emitter.removeListener(Event.StatusChange, listener);
|
|
197
|
+
this.emitter.removeListener(Event.StatusChange, listener);
|
|
243
198
|
};
|
|
244
199
|
}
|
|
245
200
|
/**
|
|
246
|
-
* Retrieve
|
|
201
|
+
* 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
|
|
202
|
+
* charged to it (allowance). A null allowance means that there is no limit to that amount
|
|
203
|
+
*
|
|
204
|
+
* A null return value signifies that the caller Account would pay the fees
|
|
247
205
|
*
|
|
248
|
-
* @note
|
|
249
|
-
*
|
|
206
|
+
* @note this value might change if, before running the transaction, the caller Account enters (or leaves)
|
|
207
|
+
* a subsidizer relationship
|
|
250
208
|
*/
|
|
251
|
-
|
|
209
|
+
getPayingAccount() {
|
|
252
210
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
-
const {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
211
|
+
const { paidForBy, context } = this;
|
|
212
|
+
if (this.ignoresSubsidy()) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
if (paidForBy) {
|
|
216
|
+
const { account: primaryAccount } = yield paidForBy.getPrimaryAccount();
|
|
217
|
+
return {
|
|
218
|
+
type: types_1.PayingAccountType.Other,
|
|
219
|
+
account: primaryAccount,
|
|
220
|
+
allowance: null,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const subsidyWithAllowance = yield context.accountSubsidy();
|
|
224
|
+
if (!subsidyWithAllowance) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
const { subsidy: { subsidizer: account }, allowance, } = subsidyWithAllowance;
|
|
263
228
|
return {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
total: protocol.plus(gas),
|
|
268
|
-
},
|
|
269
|
-
payingAccountData: Object.assign(Object.assign({}, payingAccount), { balance }),
|
|
229
|
+
type: types_1.PayingAccountType.Subsidy,
|
|
230
|
+
account,
|
|
231
|
+
allowance,
|
|
270
232
|
};
|
|
271
233
|
});
|
|
272
234
|
}
|
|
273
235
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* If there is an error (timeout or middleware offline) it will be passed to this callback
|
|
278
|
-
*
|
|
279
|
-
* @note this event will be fired even if the queue fails
|
|
280
|
-
* @returns unsubscribe function
|
|
281
|
-
* @throws if the middleware wasn't enabled when instantiating the SDK client
|
|
282
|
-
*/
|
|
283
|
-
onProcessedByMiddleware(listener) {
|
|
284
|
-
const { context, emitter } = this;
|
|
285
|
-
if (!context.isMiddlewareEnabled()) {
|
|
286
|
-
throw new internal_1.PolymeshError({
|
|
287
|
-
code: types_1.ErrorCode.General,
|
|
288
|
-
message: 'Cannot subscribe without an enabled middleware connection',
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
emitter.on(Event.ProcessedByMiddleware, listener);
|
|
292
|
-
return () => {
|
|
293
|
-
emitter.removeListener(Event.ProcessedByMiddleware, listener);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Poll the middleware every 2 seconds to see if it has already processed the
|
|
298
|
-
* block that reflects the changes brought on by this transaction being run. If so,
|
|
299
|
-
* emit the corresponding event. After 5 retries (or if the middleware can't be reached),
|
|
300
|
-
* the event is emitted with an error
|
|
236
|
+
* Get all (protocol and gas) fees associated with this transaction. Returns null
|
|
237
|
+
* if the transaction is not ready yet (this can happen if it depends on the execution of a
|
|
238
|
+
* previous transaction in the queue)
|
|
301
239
|
*
|
|
302
|
-
* @note
|
|
240
|
+
* @note this value might change if the transaction is run at a later time. This can be due to a governance vote
|
|
303
241
|
*/
|
|
304
|
-
|
|
242
|
+
getFees() {
|
|
305
243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
|
-
const {
|
|
244
|
+
const { signingAddress } = this;
|
|
245
|
+
let { protocolFee: protocol } = this;
|
|
246
|
+
let composedTx;
|
|
307
247
|
try {
|
|
308
|
-
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
const blockNumber = yield context.getLatestBlock();
|
|
312
|
-
let done = false;
|
|
313
|
-
yield bluebird_1.default.each((0, lodash_1.range)(6), (i) => __awaiter(this, void 0, void 0, function* () {
|
|
314
|
-
if (done) {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
try {
|
|
318
|
-
const { data: { latestBlock: { id: processedBlock }, }, } = yield context.queryMiddleware((0, queries_1.latestProcessedBlock)());
|
|
319
|
-
if (blockNumber.lte(processedBlock)) {
|
|
320
|
-
done = true;
|
|
321
|
-
emitter.emit(Event.ProcessedByMiddleware);
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
catch (err) {
|
|
326
|
-
/*
|
|
327
|
-
* query errors are swallowed because we wish to query again if we haven't reached the
|
|
328
|
-
* maximum amount of retries
|
|
329
|
-
*/
|
|
330
|
-
}
|
|
331
|
-
if (i === 5) {
|
|
332
|
-
emitter.emit(Event.ProcessedByMiddleware, new internal_1.PolymeshError({
|
|
333
|
-
code: types_1.ErrorCode.MiddlewareError,
|
|
334
|
-
message: `Middleware has not synced after ${i} attempts`,
|
|
335
|
-
}));
|
|
336
|
-
}
|
|
337
|
-
return (0, internal_3.delay)(2000);
|
|
338
|
-
}));
|
|
248
|
+
composedTx = this.composeTx();
|
|
339
249
|
}
|
|
340
250
|
catch (err) {
|
|
341
|
-
|
|
342
|
-
emitter.emit(Event.ProcessedByMiddleware, new internal_1.PolymeshError({
|
|
343
|
-
code: types_1.ErrorCode.UnexpectedError,
|
|
344
|
-
message: err.message || 'Unexpected error',
|
|
345
|
-
}));
|
|
251
|
+
return null;
|
|
346
252
|
}
|
|
253
|
+
const paymentInfoPromise = composedTx.paymentInfo(signingAddress);
|
|
254
|
+
if (!protocol) {
|
|
255
|
+
protocol = yield this.getProtocolFees();
|
|
256
|
+
}
|
|
257
|
+
const { partialFee } = yield paymentInfoPromise;
|
|
258
|
+
return {
|
|
259
|
+
protocol,
|
|
260
|
+
gas: (0, conversion_1.balanceToBigNumber)(partialFee),
|
|
261
|
+
};
|
|
347
262
|
});
|
|
348
263
|
}
|
|
349
264
|
/**
|
|
350
265
|
* @hidden
|
|
351
266
|
*/
|
|
352
267
|
updateStatus(status) {
|
|
353
|
-
const { emitter } = this;
|
|
354
268
|
this.status = status;
|
|
355
269
|
/* eslint-disable default-case */
|
|
356
270
|
switch (status) {
|
|
357
271
|
case types_1.TransactionStatus.Unapproved:
|
|
358
272
|
case types_1.TransactionStatus.Running:
|
|
359
273
|
case types_1.TransactionStatus.Succeeded: {
|
|
360
|
-
emitter.emit(Event.StatusChange, this);
|
|
274
|
+
this.emitter.emit(Event.StatusChange, this);
|
|
361
275
|
return;
|
|
362
276
|
}
|
|
363
277
|
case types_1.TransactionStatus.Rejected:
|
|
364
278
|
case types_1.TransactionStatus.Aborted:
|
|
365
279
|
case types_1.TransactionStatus.Failed: {
|
|
366
|
-
emitter.emit(Event.StatusChange, this, this.error);
|
|
280
|
+
this.emitter.emit(Event.StatusChange, this, this.error);
|
|
367
281
|
}
|
|
368
282
|
}
|
|
369
283
|
/* eslint-enable default-case */
|
|
370
284
|
}
|
|
371
|
-
/* istanbul ignore next: there is no way of reaching this path currently */
|
|
372
285
|
/**
|
|
373
286
|
* @hidden
|
|
374
287
|
*
|
|
@@ -411,88 +324,6 @@ class PolymeshTransactionBase {
|
|
|
411
324
|
handleExtrinsicSuccess(resolve, _reject, receipt) {
|
|
412
325
|
resolve(receipt);
|
|
413
326
|
}
|
|
414
|
-
/**
|
|
415
|
-
* @hidden
|
|
416
|
-
*
|
|
417
|
-
* Check if balances and allowances (both third party and signing Account)
|
|
418
|
-
* are sufficient to cover this transaction's fees
|
|
419
|
-
*/
|
|
420
|
-
assertFeesCovered() {
|
|
421
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
422
|
-
const { fees: { total }, payingAccountData, } = yield this.getTotalFees();
|
|
423
|
-
const { type, balance } = payingAccountData;
|
|
424
|
-
if (type === types_1.PayingAccountType.Subsidy) {
|
|
425
|
-
const { allowance } = payingAccountData;
|
|
426
|
-
if (!this.supportsSubsidy()) {
|
|
427
|
-
throw new internal_1.PolymeshError({
|
|
428
|
-
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
429
|
-
message: 'This transaction cannot be run by a subsidized Account',
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
if (allowance.lt(total)) {
|
|
433
|
-
throw new internal_1.PolymeshError({
|
|
434
|
-
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
435
|
-
message: "Insufficient subsidy allowance to pay this transaction's fees",
|
|
436
|
-
data: {
|
|
437
|
-
allowance,
|
|
438
|
-
fees: total,
|
|
439
|
-
},
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
const accountDescriptions = {
|
|
444
|
-
[types_1.PayingAccountType.Caller]: 'caller',
|
|
445
|
-
[types_1.PayingAccountType.Other]: 'paying third party',
|
|
446
|
-
[types_1.PayingAccountType.Subsidy]: 'subsidizer',
|
|
447
|
-
};
|
|
448
|
-
if (balance.lt(total)) {
|
|
449
|
-
throw new internal_1.PolymeshError({
|
|
450
|
-
code: types_1.ErrorCode.InsufficientBalance,
|
|
451
|
-
message: `The ${accountDescriptions[type]} Account does not have enough POLYX balance to pay this transaction's fees`,
|
|
452
|
-
data: {
|
|
453
|
-
balance,
|
|
454
|
-
fees: total,
|
|
455
|
-
},
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* @hidden
|
|
462
|
-
*
|
|
463
|
-
* 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
|
|
464
|
-
* charged to it (allowance) in case of a subsidy
|
|
465
|
-
*
|
|
466
|
-
* @note the paying Account might change if, before running the transaction, the caller Account enters (or leaves)
|
|
467
|
-
* a subsidizer relationship. A governance vote or chain upgrade could also cause the value to change between the time
|
|
468
|
-
* this method is called and the time the transaction is run
|
|
469
|
-
*/
|
|
470
|
-
getPayingAccount() {
|
|
471
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
472
|
-
const { paidForBy, context } = this;
|
|
473
|
-
if (paidForBy) {
|
|
474
|
-
const { account: primaryAccount } = yield paidForBy.getPrimaryAccount();
|
|
475
|
-
return {
|
|
476
|
-
type: types_1.PayingAccountType.Other,
|
|
477
|
-
account: primaryAccount,
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
const subsidyWithAllowance = yield context.accountSubsidy();
|
|
481
|
-
if (!subsidyWithAllowance || this.ignoresSubsidy()) {
|
|
482
|
-
const caller = context.getSigningAccount();
|
|
483
|
-
return {
|
|
484
|
-
account: caller,
|
|
485
|
-
type: types_1.PayingAccountType.Caller,
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
const { subsidy: { subsidizer: account }, allowance, } = subsidyWithAllowance;
|
|
489
|
-
return {
|
|
490
|
-
type: types_1.PayingAccountType.Subsidy,
|
|
491
|
-
account,
|
|
492
|
-
allowance,
|
|
493
|
-
};
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
327
|
}
|
|
497
328
|
exports.PolymeshTransactionBase = PolymeshTransactionBase;
|
|
498
329
|
//# sourceMappingURL=PolymeshTransactionBase.js.map
|