@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
package/Claims.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Claims = void 0;
|
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
+
const lodash_1 = require("lodash");
|
|
18
|
+
const internal_1 = require("./internal");
|
|
19
|
+
const queries_1 = require("./middleware/queries");
|
|
20
|
+
const types_1 = require("./middleware/types");
|
|
21
|
+
const types_2 = require("./types");
|
|
22
|
+
const internal_2 = require("./types/internal");
|
|
23
|
+
const conversion_1 = require("./utils/conversion");
|
|
24
|
+
const internal_3 = require("./utils/internal");
|
|
25
|
+
/**
|
|
26
|
+
* Handles all Claims related functionality
|
|
27
|
+
*/
|
|
28
|
+
class Claims {
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
constructor(context) {
|
|
33
|
+
this.context = context;
|
|
34
|
+
this.addClaims = (0, internal_3.createProcedureMethod)({
|
|
35
|
+
getProcedureAndArgs: args => [
|
|
36
|
+
internal_1.modifyClaims,
|
|
37
|
+
Object.assign(Object.assign({}, args), { operation: internal_2.ClaimOperation.Add }),
|
|
38
|
+
],
|
|
39
|
+
}, context);
|
|
40
|
+
this.editClaims = (0, internal_3.createProcedureMethod)({
|
|
41
|
+
getProcedureAndArgs: args => [
|
|
42
|
+
internal_1.modifyClaims,
|
|
43
|
+
Object.assign(Object.assign({}, args), { operation: internal_2.ClaimOperation.Edit }),
|
|
44
|
+
],
|
|
45
|
+
}, context);
|
|
46
|
+
this.revokeClaims = (0, internal_3.createProcedureMethod)({
|
|
47
|
+
getProcedureAndArgs: args => [
|
|
48
|
+
internal_1.modifyClaims,
|
|
49
|
+
Object.assign(Object.assign({}, args), { operation: internal_2.ClaimOperation.Revoke }),
|
|
50
|
+
],
|
|
51
|
+
}, context);
|
|
52
|
+
this.addInvestorUniquenessClaim = (0, internal_3.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.addInvestorUniquenessClaim, args] }, context);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve all claims issued by an Identity
|
|
56
|
+
*
|
|
57
|
+
* @param opts.target - Identity (optional, defaults to the signing Identity)
|
|
58
|
+
* @param opts.includeExpired - whether to include expired claims. Defaults to true
|
|
59
|
+
*
|
|
60
|
+
* @note supports pagination
|
|
61
|
+
* @note uses the middleware
|
|
62
|
+
*/
|
|
63
|
+
getIssuedClaims(opts = {}) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const { context } = this;
|
|
66
|
+
const { target, includeExpired = true, size, start } = opts;
|
|
67
|
+
const did = yield (0, internal_3.getDid)(target, context);
|
|
68
|
+
return context.getIdentityClaimsFromMiddleware({
|
|
69
|
+
trustedClaimIssuers: [did],
|
|
70
|
+
includeExpired,
|
|
71
|
+
size,
|
|
72
|
+
start,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Retrieve a list of Identities with claims associated to them. Can be filtered using parameters
|
|
78
|
+
*
|
|
79
|
+
* @param opts.targets - Identities (or Identity IDs) for which to fetch claims (targets). Defaults to all targets
|
|
80
|
+
* @param opts.trustedClaimIssuers - Identity IDs of claim issuers. Defaults to all claim issuers
|
|
81
|
+
* @param opts.scope - scope of the claims to fetch. Defaults to any scope
|
|
82
|
+
* @param opts.claimTypes - types of the claims to fetch. Defaults to any type
|
|
83
|
+
* @param opts.includeExpired - whether to include expired claims. Defaults to true
|
|
84
|
+
* @param opts.size - page size
|
|
85
|
+
* @param opts.start - page offset
|
|
86
|
+
*
|
|
87
|
+
* @note supports pagination
|
|
88
|
+
* @note uses the middleware
|
|
89
|
+
*/
|
|
90
|
+
getIdentitiesWithClaims(opts = {}) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const { context } = this;
|
|
93
|
+
const { targets, trustedClaimIssuers, scope, claimTypes, includeExpired = true, size, start, } = opts;
|
|
94
|
+
const result = yield context.queryMiddleware((0, queries_1.didsWithClaims)({
|
|
95
|
+
dids: targets === null || targets === void 0 ? void 0 : targets.map(target => (0, conversion_1.signerToString)(target)),
|
|
96
|
+
scope: scope ? (0, conversion_1.scopeToMiddlewareScope)(scope) : undefined,
|
|
97
|
+
trustedClaimIssuers: trustedClaimIssuers === null || trustedClaimIssuers === void 0 ? void 0 : trustedClaimIssuers.map(trustedClaimIssuer => (0, conversion_1.signerToString)(trustedClaimIssuer)),
|
|
98
|
+
claimTypes: claimTypes === null || claimTypes === void 0 ? void 0 : claimTypes.map(ct => types_1.ClaimTypeEnum[ct]),
|
|
99
|
+
includeExpired,
|
|
100
|
+
count: size === null || size === void 0 ? void 0 : size.toNumber(),
|
|
101
|
+
skip: start === null || start === void 0 ? void 0 : start.toNumber(),
|
|
102
|
+
}));
|
|
103
|
+
const { data: { didsWithClaims: { items: didsWithClaimsList, totalCount }, }, } = result;
|
|
104
|
+
const count = new bignumber_js_1.default(totalCount);
|
|
105
|
+
const data = (0, conversion_1.toIdentityWithClaimsArray)(didsWithClaimsList, context);
|
|
106
|
+
const next = (0, internal_3.calculateNextKey)(count, size, start);
|
|
107
|
+
return {
|
|
108
|
+
data,
|
|
109
|
+
next,
|
|
110
|
+
count,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Retrieve all scopes in which claims have been made for the target Identity.
|
|
116
|
+
* If the scope is an asset DID, the corresponding ticker is returned as well
|
|
117
|
+
*
|
|
118
|
+
* @param opts.target - Identity for which to fetch claim scopes (optional, defaults to the signing Identity)
|
|
119
|
+
*/
|
|
120
|
+
getClaimScopes(opts = {}) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const { context } = this;
|
|
123
|
+
const { target } = opts;
|
|
124
|
+
const did = yield (0, internal_3.getDid)(target, context);
|
|
125
|
+
const identityClaimsFromChain = yield context.getIdentityClaimsFromChain({
|
|
126
|
+
targets: [did],
|
|
127
|
+
claimTypes: [
|
|
128
|
+
types_2.ClaimType.Accredited,
|
|
129
|
+
types_2.ClaimType.Affiliate,
|
|
130
|
+
types_2.ClaimType.Blocked,
|
|
131
|
+
types_2.ClaimType.BuyLockup,
|
|
132
|
+
types_2.ClaimType.Exempted,
|
|
133
|
+
types_2.ClaimType.InvestorUniqueness,
|
|
134
|
+
types_2.ClaimType.Jurisdiction,
|
|
135
|
+
types_2.ClaimType.KnowYourCustomer,
|
|
136
|
+
types_2.ClaimType.SellLockup,
|
|
137
|
+
],
|
|
138
|
+
trustedClaimIssuers: undefined,
|
|
139
|
+
includeExpired: true,
|
|
140
|
+
});
|
|
141
|
+
const claimScopeList = identityClaimsFromChain.map(({ claim }) => {
|
|
142
|
+
// only Scoped Claims were fetched so this assertion is reasonable
|
|
143
|
+
const { scope: { type, value }, } = claim;
|
|
144
|
+
let ticker;
|
|
145
|
+
if (type === types_2.ScopeType.Ticker) {
|
|
146
|
+
ticker = (0, internal_3.removePadding)(value);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
scope: { type, value: ticker !== null && ticker !== void 0 ? ticker : value },
|
|
150
|
+
ticker,
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
return (0, lodash_1.uniqWith)(claimScopeList, lodash_1.isEqual);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Retrieve the list of CDD claims for a target Identity
|
|
158
|
+
*
|
|
159
|
+
* @param opts.target - Identity for which to fetch CDD claims (optional, defaults to the signing Identity)
|
|
160
|
+
* @param opts.includeExpired - whether to include expired claims. Defaults to true
|
|
161
|
+
*/
|
|
162
|
+
getCddClaims(opts = {}) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
const { context } = this;
|
|
165
|
+
const { target, includeExpired = true } = opts;
|
|
166
|
+
const did = yield (0, internal_3.getDid)(target, context);
|
|
167
|
+
return context.getIdentityClaimsFromChain({
|
|
168
|
+
targets: [did],
|
|
169
|
+
claimTypes: [types_2.ClaimType.CustomerDueDiligence],
|
|
170
|
+
includeExpired,
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve the list of InvestorUniqueness claims for a target Identity
|
|
176
|
+
*
|
|
177
|
+
* @param opts.target - Identity for which to fetch CDD claims (optional, defaults to the signing Identity)
|
|
178
|
+
* @param opts.includeExpired - whether to include expired claims. Defaults to true
|
|
179
|
+
*/
|
|
180
|
+
getInvestorUniquenessClaims(opts = {}) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const { context } = this;
|
|
183
|
+
const { target, includeExpired = true } = opts;
|
|
184
|
+
const did = yield (0, internal_3.getDid)(target, context);
|
|
185
|
+
return context.getIdentityClaimsFromChain({
|
|
186
|
+
targets: [did],
|
|
187
|
+
claimTypes: [types_2.ClaimType.InvestorUniqueness],
|
|
188
|
+
includeExpired,
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Retrieve all claims issued about an Identity, grouped by claim issuer
|
|
194
|
+
*
|
|
195
|
+
* @param opts.target - Identity for which to fetch targeting claims (optional, defaults to the signing Identity)
|
|
196
|
+
* @param opts.includeExpired - whether to include expired claims. Defaults to true
|
|
197
|
+
*
|
|
198
|
+
* @note supports pagination
|
|
199
|
+
* @note uses the middleware (optional)
|
|
200
|
+
*/
|
|
201
|
+
getTargetingClaims(opts = {}) {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
const { context } = this;
|
|
204
|
+
const { target, trustedClaimIssuers, scope, includeExpired = true, size, start } = opts;
|
|
205
|
+
const did = yield (0, internal_3.getDid)(target, context);
|
|
206
|
+
const isMiddlewareAvailable = yield context.isMiddlewareAvailable();
|
|
207
|
+
if (isMiddlewareAvailable) {
|
|
208
|
+
const result = yield context.queryMiddleware((0, queries_1.issuerDidsWithClaimsByTarget)({
|
|
209
|
+
target: did,
|
|
210
|
+
scope: scope ? (0, conversion_1.scopeToMiddlewareScope)(scope) : undefined,
|
|
211
|
+
trustedClaimIssuers: trustedClaimIssuers === null || trustedClaimIssuers === void 0 ? void 0 : trustedClaimIssuers.map(trustedClaimIssuer => (0, conversion_1.signerToString)(trustedClaimIssuer)),
|
|
212
|
+
includeExpired,
|
|
213
|
+
count: size === null || size === void 0 ? void 0 : size.toNumber(),
|
|
214
|
+
skip: start === null || start === void 0 ? void 0 : start.toNumber(),
|
|
215
|
+
}));
|
|
216
|
+
const { data: { issuerDidsWithClaimsByTarget: { items: issuerDidsWithClaimsByTargetList, totalCount }, }, } = result;
|
|
217
|
+
const count = new bignumber_js_1.default(totalCount);
|
|
218
|
+
const data = (0, conversion_1.toIdentityWithClaimsArray)(issuerDidsWithClaimsByTargetList, context);
|
|
219
|
+
const next = (0, internal_3.calculateNextKey)(count, size, start);
|
|
220
|
+
return {
|
|
221
|
+
data,
|
|
222
|
+
next,
|
|
223
|
+
count,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const identityClaimsFromChain = yield context.getIdentityClaimsFromChain({
|
|
227
|
+
targets: [did],
|
|
228
|
+
trustedClaimIssuers: trustedClaimIssuers === null || trustedClaimIssuers === void 0 ? void 0 : trustedClaimIssuers.map(trustedClaimIssuer => (0, conversion_1.signerToString)(trustedClaimIssuer)),
|
|
229
|
+
includeExpired,
|
|
230
|
+
});
|
|
231
|
+
const issuers = (0, lodash_1.uniqBy)(identityClaimsFromChain.map(i => i.issuer), identity => identity.did);
|
|
232
|
+
const identitiesWithClaims = issuers.map(identity => {
|
|
233
|
+
return {
|
|
234
|
+
identity,
|
|
235
|
+
claims: (0, lodash_1.filter)(identityClaimsFromChain, ({ issuer }) => issuer.isEqual(identity)),
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
data: identitiesWithClaims,
|
|
240
|
+
next: null,
|
|
241
|
+
count: new bignumber_js_1.default(identitiesWithClaims.length),
|
|
242
|
+
};
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.Claims = Claims;
|
|
247
|
+
//# sourceMappingURL=Claims.js.map
|
package/Claims.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Claims.js","sourceRoot":"","sources":["../src/Claims.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,mCAA2D;AAE3D,yCAOoB;AACpB,kDAAoF;AACpF,8CAA0D;AAC1D,mCAYiB;AACjB,+CAAkD;AAElD,mDAI4B;AAC5B,+CAAkG;AAElG;;GAEG;AACH,MAAa,MAAM;IAGjB;;OAEG;IACH,YAAY,OAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,SAAS,GAAG,IAAA,gCAAqB,EAKpC;YACE,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC;gBAC3B,uBAAY;gBACZ,gCACK,IA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AAkB,CAAC,CACnC;gBACD,cAAc;aACf,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,IAAA,eAAM,EACpB,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAC1C,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CACzB,CAAC;YAEF,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAClD,OAAO;oBACL,QAAQ;oBACR,MAAM,EAAE,IAAA,eAAM,EAAC,uBAAuB,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;iBAClF,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,oBAAoB;gBAC1B,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI,sBAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC;aAClD,CAAC;QACJ,CAAC;KAAA;CACF;AAxXD,wBAwXC"}
|
package/Identities.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Context, Identity, NumberedPortfolio, RegisterIdentityParams } from "./internal";
|
|
2
|
+
import { ProcedureMethod } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Handles all Identity related functionality
|
|
5
|
+
*/
|
|
6
|
+
export declare class Identities {
|
|
7
|
+
private context;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
constructor(context: Context);
|
|
12
|
+
/**
|
|
13
|
+
* Register an Identity
|
|
14
|
+
*
|
|
15
|
+
* @note must be a CDD provider
|
|
16
|
+
* @note this may create {@link AuthorizationRequest | Authorization Requests} which have to be accepted by the `targetAccount`.
|
|
17
|
+
* An {@link Account} or {@link Identity} can fetch its pending Authorization Requests by calling {@link Authorizations.getReceived | authorizations.getReceived}.
|
|
18
|
+
* Also, an Account or Identity can directly fetch the details of an Authorization Request by calling {@link Authorizations.getOne | authorizations.getOne}
|
|
19
|
+
*
|
|
20
|
+
* @note required role:
|
|
21
|
+
* - Customer Due Diligence Provider
|
|
22
|
+
*/
|
|
23
|
+
registerIdentity: ProcedureMethod<RegisterIdentityParams, Identity>;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new Portfolio under the ownership of the signing Identity
|
|
26
|
+
*/
|
|
27
|
+
createPortfolio: ProcedureMethod<{
|
|
28
|
+
name: string;
|
|
29
|
+
}, NumberedPortfolio>;
|
|
30
|
+
/**
|
|
31
|
+
* Create an Identity instance from a DID
|
|
32
|
+
*
|
|
33
|
+
* @throws if there is no Identity with the passed DID
|
|
34
|
+
*/
|
|
35
|
+
getIdentity(args: {
|
|
36
|
+
did: string;
|
|
37
|
+
}): Promise<Identity>;
|
|
38
|
+
/**
|
|
39
|
+
* Return whether the supplied Identity/DID exists
|
|
40
|
+
*/
|
|
41
|
+
isIdentityValid(args: {
|
|
42
|
+
identity: Identity | string;
|
|
43
|
+
}): Promise<boolean>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=Identities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Identities.d.ts","sourceRoot":"","sources":["../src/Identities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,QAAQ,EACR,iBAAiB,EAEjB,sBAAsB,EACvB,mBAAmB;AACpB,OAAO,EAAE,eAAe,EAAE,gBAAgB;AAG1C;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAU;IAEzB;;OAEG;gBACS,OAAO,EAAE,OAAO;IAc5B;;;;;;;;;;OAUG;IACI,gBAAgB,EAAE,eAAe,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IAE3E;;OAEG;IACI,eAAe,EAAE,eAAe,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,iBAAiB,CAAC,CAAC;IAE7E;;;;OAIG;IACI,WAAW,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI5D;;OAEG;IACI,eAAe,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGhF"}
|
package/Identities.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Identities = void 0;
|
|
4
|
+
const internal_1 = require("./internal");
|
|
5
|
+
const internal_2 = require("./utils/internal");
|
|
6
|
+
/**
|
|
7
|
+
* Handles all Identity related functionality
|
|
8
|
+
*/
|
|
9
|
+
class Identities {
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
constructor(context) {
|
|
14
|
+
this.context = context;
|
|
15
|
+
this.registerIdentity = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.registerIdentity, args] }, context);
|
|
16
|
+
this.createPortfolio = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.createPortfolio, args] }, context);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create an Identity instance from a DID
|
|
20
|
+
*
|
|
21
|
+
* @throws if there is no Identity with the passed DID
|
|
22
|
+
*/
|
|
23
|
+
getIdentity(args) {
|
|
24
|
+
return this.context.getIdentity(args.did);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Return whether the supplied Identity/DID exists
|
|
28
|
+
*/
|
|
29
|
+
isIdentityValid(args) {
|
|
30
|
+
return (0, internal_2.asIdentity)(args.identity, this.context).exists();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Identities = Identities;
|
|
34
|
+
//# sourceMappingURL=Identities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Identities.js","sourceRoot":"","sources":["../src/Identities.ts"],"names":[],"mappings":";;;AAAA,yCAOoB;AAEpB,+CAAqE;AAErE;;GAEG;AACH,MAAa,UAAU;IAGrB;;OAEG;IACH,YAAY,OAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,gBAAgB,GAAG,IAAA,gCAAqB,EAC3C,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAgB,EAAE,IAAI,CAAC,EAAE,EACzD,OAAO,CACR,CAAC;QAEF,IAAI,CAAC,eAAe,GAAG,IAAA,gCAAqB,EAC1C,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAe,EAAE,IAAI,CAAC,EAAE,EACxD,OAAO,CACR,CAAC;IACJ,CAAC;IAoBD;;;;OAIG;IACI,WAAW,CAAC,IAAqB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,IAAqC;QAC1D,OAAO,IAAA,qBAAU,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1D,CAAC;CACF;AArDD,gCAqDC"}
|
package/Network.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { Account, Context, TransferPolyxParams } from "./internal";
|
|
3
|
+
import { EventIdEnum as EventId, ModuleIdEnum as ModuleId } from "./middleware/types";
|
|
4
|
+
import { EventIdentifier, ExtrinsicDataWithFees, NetworkProperties, ProcedureMethod, ProtocolFees, SubCallback, TxTag, UnsubCallback } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Handles all Network related functionality, including querying for historical events from middleware
|
|
7
|
+
*/
|
|
8
|
+
export declare class Network {
|
|
9
|
+
private context;
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
constructor(context: Context);
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve the number of the latest block in the chain
|
|
16
|
+
*/
|
|
17
|
+
getLatestBlock(): Promise<BigNumber>;
|
|
18
|
+
/**
|
|
19
|
+
* Fetch the current network version (i.e. 3.1.0)
|
|
20
|
+
*/
|
|
21
|
+
getVersion(): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve the chain's SS58 format
|
|
24
|
+
*/
|
|
25
|
+
getSs58Format(): BigNumber;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieve information for the current network
|
|
28
|
+
*/
|
|
29
|
+
getNetworkProperties(): Promise<NetworkProperties>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve the protocol fees associated with running specific transactions
|
|
32
|
+
*
|
|
33
|
+
* @param args.tags - list of transaction tags (i.e. [TxTags.asset.CreateAsset, TxTags.asset.RegisterTicker] or ["asset.createAsset", "asset.registerTicker"])
|
|
34
|
+
*/
|
|
35
|
+
getProtocolFees(args: {
|
|
36
|
+
tags: TxTag[];
|
|
37
|
+
}): Promise<ProtocolFees[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Get the treasury wallet address
|
|
40
|
+
*/
|
|
41
|
+
getTreasuryAccount(): Account;
|
|
42
|
+
/**
|
|
43
|
+
* Get the Treasury POLYX balance
|
|
44
|
+
*
|
|
45
|
+
* @note can be subscribed to
|
|
46
|
+
*/
|
|
47
|
+
getTreasuryBalance(): Promise<BigNumber>;
|
|
48
|
+
getTreasuryBalance(callback: SubCallback<BigNumber>): Promise<UnsubCallback>;
|
|
49
|
+
/**
|
|
50
|
+
* Transfer an amount of POLYX to a specified Account
|
|
51
|
+
*/
|
|
52
|
+
transferPolyx: ProcedureMethod<TransferPolyxParams, void>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve a single event by any of its indexed arguments. Can be filtered using parameters
|
|
55
|
+
*
|
|
56
|
+
* @param opts.moduleId - type of the module to fetch
|
|
57
|
+
* @param opts.eventId - type of the event to fetch
|
|
58
|
+
* @param opts.eventArg0 - event parameter value to filter by in position 0
|
|
59
|
+
* @param opts.eventArg1 - event parameter value to filter by in position 1
|
|
60
|
+
* @param opts.eventArg2 - event parameter value to filter by in position 2
|
|
61
|
+
*
|
|
62
|
+
* @note uses the middleware
|
|
63
|
+
*/
|
|
64
|
+
getEventByIndexedArgs(opts: {
|
|
65
|
+
moduleId: ModuleId;
|
|
66
|
+
eventId: EventId;
|
|
67
|
+
eventArg0?: string;
|
|
68
|
+
eventArg1?: string;
|
|
69
|
+
eventArg2?: string;
|
|
70
|
+
}): Promise<EventIdentifier | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Retrieve a list of events. Can be filtered using parameters
|
|
73
|
+
*
|
|
74
|
+
* @param opts.moduleId - type of the module to fetch
|
|
75
|
+
* @param opts.eventId - type of the event to fetch
|
|
76
|
+
* @param opts.eventArg0 - event parameter value to filter by in position 0
|
|
77
|
+
* @param opts.eventArg1 - event parameter value to filter by in position 1
|
|
78
|
+
* @param opts.eventArg2 - event parameter value to filter by in position 2
|
|
79
|
+
* @param opts.size - page size
|
|
80
|
+
* @param opts.start - page offset
|
|
81
|
+
*
|
|
82
|
+
* @note uses the middleware
|
|
83
|
+
*/
|
|
84
|
+
getEventsByIndexedArgs(opts: {
|
|
85
|
+
moduleId: ModuleId;
|
|
86
|
+
eventId: EventId;
|
|
87
|
+
eventArg0?: string;
|
|
88
|
+
eventArg1?: string;
|
|
89
|
+
eventArg2?: string;
|
|
90
|
+
size?: BigNumber;
|
|
91
|
+
start?: BigNumber;
|
|
92
|
+
}): Promise<EventIdentifier[] | null>;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieve a transaction by hash
|
|
95
|
+
*
|
|
96
|
+
* @param opts.txHash - hash of the transaction
|
|
97
|
+
*
|
|
98
|
+
* @note uses the middleware
|
|
99
|
+
*/
|
|
100
|
+
getTransactionByHash(opts: {
|
|
101
|
+
txHash: string;
|
|
102
|
+
}): Promise<ExtrinsicDataWithFees | null>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=Network.d.ts.map
|
package/Network.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Network.d.ts","sourceRoot":"","sources":["../src/Network.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAiB,mBAAmB,EAAE,mBAAmB;AAElF,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,YAAY,IAAI,QAAQ,EAAS,2BAA2B;AAC7F,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,KAAK,EACL,aAAa,EACd,gBAAgB;AAcjB;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAU;IAEzB;;OAEG;gBACS,OAAO,EAAE,OAAO;IAS5B;;OAEG;IACI,cAAc,IAAI,OAAO,CAAC,SAAS,CAAC;IAI3C;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C;;OAEG;IACI,aAAa,IAAI,SAAS;IAIjC;;OAEG;IACU,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAmB/D;;;;OAIG;IACI,eAAe,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,KAAK,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIxE;;OAEG;IACI,kBAAkB,IAAI,OAAO;IAQpC;;;;OAIG;IACI,kBAAkB,IAAI,OAAO,CAAC,SAAS,CAAC;IACxC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAmBnF;;OAEG;IACI,aAAa,EAAE,eAAe,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAEjE;;;;;;;;;;OAUG;IACU,qBAAqB,CAAC,IAAI,EAAE;QACvC,QAAQ,EAAE,QAAQ,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAoBnC;;;;;;;;;;;;OAYG;IACU,sBAAsB,CAAC,IAAI,EAAE;QACxC,QAAQ,EAAE,QAAQ,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,KAAK,CAAC,EAAE,SAAS,CAAC;KACnB,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IA6BrC;;;;;;OAMG;IACU,oBAAoB,CAAC,IAAI,EAAE;QACtC,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CA6E1C"}
|
package/Network.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Network = void 0;
|
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
+
const internal_1 = require("./internal");
|
|
18
|
+
const queries_1 = require("./middleware/queries");
|
|
19
|
+
const constants_1 = require("./utils/constants");
|
|
20
|
+
const conversion_1 = require("./utils/conversion");
|
|
21
|
+
const internal_2 = require("./utils/internal");
|
|
22
|
+
/**
|
|
23
|
+
* Handles all Network related functionality, including querying for historical events from middleware
|
|
24
|
+
*/
|
|
25
|
+
class Network {
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
constructor(context) {
|
|
30
|
+
this.context = context;
|
|
31
|
+
this.transferPolyx = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.transferPolyx, args] }, context);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve the number of the latest block in the chain
|
|
35
|
+
*/
|
|
36
|
+
getLatestBlock() {
|
|
37
|
+
return this.context.getLatestBlock();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Fetch the current network version (i.e. 3.1.0)
|
|
41
|
+
*/
|
|
42
|
+
getVersion() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return this.context.getNetworkVersion();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve the chain's SS58 format
|
|
49
|
+
*/
|
|
50
|
+
getSs58Format() {
|
|
51
|
+
return this.context.ss58Format;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve information for the current network
|
|
55
|
+
*/
|
|
56
|
+
getNetworkProperties() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const { context: { polymeshApi: { runtimeVersion: { specVersion }, rpc: { system: { chain }, }, }, }, } = this;
|
|
59
|
+
const name = yield chain();
|
|
60
|
+
return {
|
|
61
|
+
name: (0, conversion_1.textToString)(name),
|
|
62
|
+
version: (0, conversion_1.u32ToBigNumber)(specVersion),
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Retrieve the protocol fees associated with running specific transactions
|
|
68
|
+
*
|
|
69
|
+
* @param args.tags - list of transaction tags (i.e. [TxTags.asset.CreateAsset, TxTags.asset.RegisterTicker] or ["asset.createAsset", "asset.registerTicker"])
|
|
70
|
+
*/
|
|
71
|
+
getProtocolFees(args) {
|
|
72
|
+
return this.context.getProtocolFees(args);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the treasury wallet address
|
|
76
|
+
*/
|
|
77
|
+
getTreasuryAccount() {
|
|
78
|
+
const { context } = this;
|
|
79
|
+
return new internal_1.Account({ address: (0, conversion_1.moduleAddressToString)(constants_1.TREASURY_MODULE_ADDRESS, context) }, context);
|
|
80
|
+
}
|
|
81
|
+
// eslint-disable-next-line require-jsdoc
|
|
82
|
+
getTreasuryBalance(callback) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const account = this.getTreasuryAccount();
|
|
85
|
+
if (callback) {
|
|
86
|
+
return account.getBalance(({ free: freeBalance }) => {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises -- callback errors should be handled by the caller
|
|
88
|
+
callback(freeBalance);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const { free } = yield account.getBalance();
|
|
92
|
+
return free;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Retrieve a single event by any of its indexed arguments. Can be filtered using parameters
|
|
97
|
+
*
|
|
98
|
+
* @param opts.moduleId - type of the module to fetch
|
|
99
|
+
* @param opts.eventId - type of the event to fetch
|
|
100
|
+
* @param opts.eventArg0 - event parameter value to filter by in position 0
|
|
101
|
+
* @param opts.eventArg1 - event parameter value to filter by in position 1
|
|
102
|
+
* @param opts.eventArg2 - event parameter value to filter by in position 2
|
|
103
|
+
*
|
|
104
|
+
* @note uses the middleware
|
|
105
|
+
*/
|
|
106
|
+
getEventByIndexedArgs(opts) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const { context } = this;
|
|
109
|
+
const { moduleId, eventId, eventArg0, eventArg1, eventArg2 } = opts;
|
|
110
|
+
const { data: { eventByIndexedArgs: event }, } = yield context.queryMiddleware((0, queries_1.eventByIndexedArgs)({
|
|
111
|
+
moduleId,
|
|
112
|
+
eventId,
|
|
113
|
+
eventArg0,
|
|
114
|
+
eventArg1,
|
|
115
|
+
eventArg2,
|
|
116
|
+
}));
|
|
117
|
+
return (0, internal_2.optionize)(conversion_1.middlewareEventToEventIdentifier)(event);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Retrieve a list of events. Can be filtered using parameters
|
|
122
|
+
*
|
|
123
|
+
* @param opts.moduleId - type of the module to fetch
|
|
124
|
+
* @param opts.eventId - type of the event to fetch
|
|
125
|
+
* @param opts.eventArg0 - event parameter value to filter by in position 0
|
|
126
|
+
* @param opts.eventArg1 - event parameter value to filter by in position 1
|
|
127
|
+
* @param opts.eventArg2 - event parameter value to filter by in position 2
|
|
128
|
+
* @param opts.size - page size
|
|
129
|
+
* @param opts.start - page offset
|
|
130
|
+
*
|
|
131
|
+
* @note uses the middleware
|
|
132
|
+
*/
|
|
133
|
+
getEventsByIndexedArgs(opts) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
const { context } = this;
|
|
136
|
+
const { moduleId, eventId, eventArg0, eventArg1, eventArg2, size, start } = opts;
|
|
137
|
+
const result = yield context.queryMiddleware((0, queries_1.eventsByIndexedArgs)({
|
|
138
|
+
moduleId,
|
|
139
|
+
eventId,
|
|
140
|
+
eventArg0,
|
|
141
|
+
eventArg1,
|
|
142
|
+
eventArg2,
|
|
143
|
+
count: size === null || size === void 0 ? void 0 : size.toNumber(),
|
|
144
|
+
skip: start === null || start === void 0 ? void 0 : start.toNumber(),
|
|
145
|
+
}));
|
|
146
|
+
const { data: { eventsByIndexedArgs: events }, } = result;
|
|
147
|
+
if (events) {
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
149
|
+
return events.map(event => (0, conversion_1.middlewareEventToEventIdentifier)(event));
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Retrieve a transaction by hash
|
|
156
|
+
*
|
|
157
|
+
* @param opts.txHash - hash of the transaction
|
|
158
|
+
*
|
|
159
|
+
* @note uses the middleware
|
|
160
|
+
*/
|
|
161
|
+
getTransactionByHash(opts) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const { context: { polymeshApi: { rpc: { chain: { getBlock }, payment: { queryInfo }, }, }, }, context, } = this;
|
|
164
|
+
const { txHash: transactionHash } = opts;
|
|
165
|
+
const result = yield context.queryMiddleware((0, queries_1.transactionByHash)({
|
|
166
|
+
transactionHash,
|
|
167
|
+
}));
|
|
168
|
+
const { data: { transactionByHash: transaction }, } = result;
|
|
169
|
+
if (transaction) {
|
|
170
|
+
const { block_id: blockNumber, extrinsic_idx: extrinsicIdx, address: rawAddress, nonce, module_id: moduleId, call_id: callId, params, success: txSuccess, spec_version_id: specVersionId, extrinsic_hash: extrinsicHash, block, } = transaction;
|
|
171
|
+
const txTag = (0, conversion_1.extrinsicIdentifierToTxTag)({ moduleId, callId });
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
173
|
+
const blockHash = block.hash;
|
|
174
|
+
const rawBlockHash = (0, conversion_1.stringToBlockHash)(blockHash, context);
|
|
175
|
+
const { block: { extrinsics }, } = yield getBlock(rawBlockHash);
|
|
176
|
+
const [{ partialFee }, [{ fees: protocolFees }]] = yield Promise.all([
|
|
177
|
+
queryInfo(extrinsics[extrinsicIdx].toHex(), rawBlockHash),
|
|
178
|
+
context.getProtocolFees({ tags: [txTag], blockHash }),
|
|
179
|
+
]);
|
|
180
|
+
return {
|
|
181
|
+
blockNumber: new bignumber_js_1.default(blockNumber),
|
|
182
|
+
blockHash,
|
|
183
|
+
extrinsicIdx: new bignumber_js_1.default(extrinsicIdx),
|
|
184
|
+
address: rawAddress !== null && rawAddress !== void 0 ? rawAddress : null,
|
|
185
|
+
nonce: nonce ? new bignumber_js_1.default(nonce) : null,
|
|
186
|
+
txTag,
|
|
187
|
+
params,
|
|
188
|
+
success: !!txSuccess,
|
|
189
|
+
specVersionId: new bignumber_js_1.default(specVersionId),
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
191
|
+
extrinsicHash: extrinsicHash,
|
|
192
|
+
fee: {
|
|
193
|
+
gas: (0, conversion_1.balanceToBigNumber)(partialFee),
|
|
194
|
+
protocol: protocolFees,
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.Network = Network;
|
|
203
|
+
//# sourceMappingURL=Network.js.map
|