@polymeshassociation/polymesh-sdk 23.0.0-alpha.3 → 23.0.0-alpha.31
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 +3 -3
- package/README.md +49 -7
- package/api/client/Assets.d.ts +30 -7
- package/api/client/Assets.d.ts.map +1 -1
- package/api/client/Assets.js +56 -10
- package/api/client/Assets.js.map +1 -1
- package/api/client/Claims.d.ts +21 -1
- package/api/client/Claims.d.ts.map +1 -1
- package/api/client/Claims.js +33 -2
- package/api/client/Claims.js.map +1 -1
- package/api/client/Network.d.ts +1 -1
- package/api/client/Network.d.ts.map +1 -1
- package/api/client/Network.js +2 -1
- package/api/client/Network.js.map +1 -1
- package/api/entities/Account/MultiSig/index.d.ts.map +1 -1
- package/api/entities/Account/MultiSig/index.js +2 -5
- package/api/entities/Account/MultiSig/index.js.map +1 -1
- package/api/entities/Account/helpers.d.ts +3 -2
- package/api/entities/Account/helpers.d.ts.map +1 -1
- package/api/entities/Account/helpers.js.map +1 -1
- package/api/entities/Account/index.d.ts.map +1 -1
- package/api/entities/Account/index.js +20 -16
- package/api/entities/Account/index.js.map +1 -1
- package/api/entities/Account/types.d.ts +1 -1
- package/api/entities/Asset/Base/BaseAsset.d.ts +82 -0
- package/api/entities/Asset/Base/BaseAsset.d.ts.map +1 -0
- package/api/entities/Asset/Base/BaseAsset.js +174 -0
- package/api/entities/Asset/Base/BaseAsset.js.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/Requirements.d.ts +10 -10
- package/api/entities/Asset/Base/Compliance/Requirements.d.ts.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/Requirements.js +3 -3
- package/api/entities/Asset/Base/Compliance/Requirements.js.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/TrustedClaimIssuers.d.ts +7 -7
- package/api/entities/Asset/Base/Compliance/TrustedClaimIssuers.d.ts.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/TrustedClaimIssuers.js +4 -4
- package/api/entities/Asset/Base/Compliance/TrustedClaimIssuers.js.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/index.d.ts +3 -3
- package/api/entities/Asset/Base/Compliance/index.d.ts.map +1 -0
- package/api/entities/Asset/{Compliance → Base/Compliance}/index.js +1 -1
- package/api/entities/Asset/Base/Compliance/index.js.map +1 -0
- package/api/entities/Asset/{Documents.d.ts → Base/Documents/index.d.ts} +7 -8
- package/api/entities/Asset/Base/Documents/index.d.ts.map +1 -0
- package/api/entities/Asset/{Documents.js → Base/Documents/index.js} +4 -4
- package/api/entities/Asset/Base/Documents/index.js.map +1 -0
- package/api/entities/Asset/{Metadata.d.ts → Base/Metadata/index.d.ts} +11 -5
- package/api/entities/Asset/Base/Metadata/index.d.ts.map +1 -0
- package/api/entities/Asset/{Metadata.js → Base/Metadata/index.js} +17 -5
- package/api/entities/Asset/Base/Metadata/index.js.map +1 -0
- package/api/entities/Asset/{Permissions.d.ts → Base/Permissions/index.d.ts} +5 -5
- package/api/entities/Asset/Base/Permissions/index.d.ts.map +1 -0
- package/api/entities/Asset/{Permissions.js → Base/Permissions/index.js} +5 -5
- package/api/entities/Asset/Base/Permissions/index.js.map +1 -0
- package/api/entities/Asset/Base/Settlements/index.d.ts +85 -0
- package/api/entities/Asset/Base/Settlements/index.d.ts.map +1 -0
- package/api/entities/Asset/Base/Settlements/index.js +141 -0
- package/api/entities/Asset/Base/Settlements/index.js.map +1 -0
- package/api/entities/Asset/Base/index.d.ts +2 -0
- package/api/entities/Asset/Base/index.d.ts.map +1 -0
- package/api/entities/Asset/Base/index.js +18 -0
- package/api/entities/Asset/Base/index.js.map +1 -0
- package/api/entities/Asset/{AssetHolders.d.ts → Fungible/AssetHolders/index.d.ts} +4 -4
- package/api/entities/Asset/Fungible/AssetHolders/index.d.ts.map +1 -0
- package/api/entities/Asset/{AssetHolders.js → Fungible/AssetHolders/index.js} +4 -4
- package/api/entities/Asset/Fungible/AssetHolders/index.js.map +1 -0
- package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/Schedules.d.ts +4 -4
- package/api/entities/Asset/Fungible/Checkpoints/Schedules.d.ts.map +1 -0
- package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/Schedules.js +4 -4
- package/api/entities/Asset/Fungible/Checkpoints/Schedules.js.map +1 -0
- package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/index.d.ts +4 -4
- package/api/entities/Asset/Fungible/Checkpoints/index.d.ts.map +1 -0
- package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/index.js +5 -5
- package/api/entities/Asset/Fungible/Checkpoints/index.js.map +1 -0
- package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/types.d.ts +1 -1
- package/api/entities/Asset/Fungible/Checkpoints/types.d.ts.map +1 -0
- package/api/entities/Asset/Fungible/Checkpoints/types.js.map +1 -0
- package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/Distributions.d.ts +4 -4
- package/api/entities/Asset/Fungible/CorporateActions/Distributions.d.ts.map +1 -0
- package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/Distributions.js +4 -4
- package/api/entities/Asset/Fungible/CorporateActions/Distributions.js.map +1 -0
- package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/index.d.ts +4 -4
- package/api/entities/Asset/Fungible/CorporateActions/index.d.ts.map +1 -0
- package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/index.js +3 -3
- package/api/entities/Asset/Fungible/CorporateActions/index.js.map +1 -0
- package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/types.d.ts +1 -1
- package/api/entities/Asset/Fungible/CorporateActions/types.d.ts.map +1 -0
- package/api/entities/Asset/Fungible/CorporateActions/types.js.map +1 -0
- package/api/entities/Asset/{Issuance.d.ts → Fungible/Issuance/index.d.ts} +6 -6
- package/api/entities/Asset/Fungible/Issuance/index.d.ts.map +1 -0
- package/api/entities/Asset/{Issuance.js → Fungible/Issuance/index.js} +3 -3
- package/api/entities/Asset/Fungible/Issuance/index.js.map +1 -0
- package/api/entities/Asset/{Offerings.d.ts → Fungible/Offerings/index.d.ts} +5 -5
- package/api/entities/Asset/Fungible/Offerings/index.d.ts.map +1 -0
- package/api/entities/Asset/{Offerings.js → Fungible/Offerings/index.js} +5 -5
- package/api/entities/Asset/Fungible/Offerings/index.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimCount.d.ts +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimCount.js +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimPercentage.d.ts +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimPercentage.js +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Count.d.ts +5 -5
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Count.js +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Percentage.d.ts +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Percentage.js +2 -2
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/TransferRestrictionBase.d.ts +4 -4
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/TransferRestrictionBase.js +4 -4
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/index.d.ts +3 -3
- package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts.map +1 -0
- package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/index.js +1 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/index.js.map +1 -0
- package/api/entities/Asset/Fungible/index.d.ts +88 -0
- package/api/entities/Asset/Fungible/index.d.ts.map +1 -0
- package/api/entities/Asset/Fungible/index.js +159 -0
- package/api/entities/Asset/Fungible/index.js.map +1 -0
- package/api/entities/Asset/NonFungible/Nft.d.ts +110 -0
- package/api/entities/Asset/NonFungible/Nft.d.ts.map +1 -0
- package/api/entities/Asset/NonFungible/Nft.js +243 -0
- package/api/entities/Asset/NonFungible/Nft.js.map +1 -0
- package/api/entities/Asset/NonFungible/NftCollection.d.ts +69 -0
- package/api/entities/Asset/NonFungible/NftCollection.d.ts.map +1 -0
- package/api/entities/Asset/NonFungible/NftCollection.js +185 -0
- package/api/entities/Asset/NonFungible/NftCollection.js.map +1 -0
- package/api/entities/Asset/NonFungible/index.d.ts +3 -0
- package/api/entities/Asset/NonFungible/index.d.ts.map +1 -0
- package/api/entities/Asset/NonFungible/index.js +19 -0
- package/api/entities/Asset/NonFungible/index.js.map +1 -0
- package/api/entities/Asset/index.d.ts +4 -158
- package/api/entities/Asset/index.d.ts.map +1 -1
- package/api/entities/Asset/index.js +17 -270
- package/api/entities/Asset/index.js.map +1 -1
- package/api/entities/Asset/types.d.ts +48 -6
- package/api/entities/Asset/types.d.ts.map +1 -1
- package/api/entities/Asset/types.js +2 -2
- package/api/entities/Asset/types.js.map +1 -1
- package/api/entities/Checkpoint.d.ts +2 -2
- package/api/entities/Checkpoint.d.ts.map +1 -1
- package/api/entities/Checkpoint.js +1 -1
- package/api/entities/Checkpoint.js.map +1 -1
- package/api/entities/CheckpointSchedule/index.d.ts +2 -2
- package/api/entities/CheckpointSchedule/index.d.ts.map +1 -1
- package/api/entities/CheckpointSchedule/index.js +1 -1
- package/api/entities/CheckpointSchedule/index.js.map +1 -1
- package/api/entities/CorporateActionBase/index.d.ts +2 -2
- package/api/entities/CorporateActionBase/index.d.ts.map +1 -1
- package/api/entities/CorporateActionBase/index.js +1 -1
- package/api/entities/CorporateActionBase/index.js.map +1 -1
- package/api/entities/DefaultTrustedClaimIssuer.d.ts +2 -2
- package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -1
- package/api/entities/DefaultTrustedClaimIssuer.js +1 -1
- package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -1
- package/api/entities/Identity/AssetPermissions.d.ts +8 -8
- package/api/entities/Identity/AssetPermissions.d.ts.map +1 -1
- package/api/entities/Identity/AssetPermissions.js +2 -2
- package/api/entities/Identity/AssetPermissions.js.map +1 -1
- package/api/entities/Identity/index.d.ts +20 -5
- package/api/entities/Identity/index.d.ts.map +1 -1
- package/api/entities/Identity/index.js +39 -2
- package/api/entities/Identity/index.js.map +1 -1
- package/api/entities/Instruction/index.d.ts.map +1 -1
- package/api/entities/Instruction/index.js +30 -21
- package/api/entities/Instruction/index.js.map +1 -1
- package/api/entities/Instruction/types.d.ts +11 -4
- package/api/entities/Instruction/types.d.ts.map +1 -1
- package/api/entities/Instruction/types.js.map +1 -1
- package/api/entities/MetadataEntry/index.d.ts +2 -2
- package/api/entities/MetadataEntry/index.d.ts.map +1 -1
- package/api/entities/MetadataEntry/index.js +1 -1
- package/api/entities/MetadataEntry/index.js.map +1 -1
- package/api/entities/MultiSigProposal/index.d.ts +36 -2
- package/api/entities/MultiSigProposal/index.d.ts.map +1 -1
- package/api/entities/MultiSigProposal/index.js +91 -10
- package/api/entities/MultiSigProposal/index.js.map +1 -1
- package/api/entities/MultiSigProposal/types.d.ts +15 -2
- package/api/entities/MultiSigProposal/types.d.ts.map +1 -1
- package/api/entities/MultiSigProposal/types.js +6 -1
- package/api/entities/MultiSigProposal/types.js.map +1 -1
- package/api/entities/Offering/index.d.ts +2 -2
- package/api/entities/Offering/index.d.ts.map +1 -1
- package/api/entities/Offering/index.js +1 -1
- package/api/entities/Offering/index.js.map +1 -1
- package/api/entities/PermissionGroup.d.ts +2 -2
- package/api/entities/PermissionGroup.d.ts.map +1 -1
- package/api/entities/PermissionGroup.js +1 -1
- package/api/entities/PermissionGroup.js.map +1 -1
- package/api/entities/Portfolio/index.d.ts +13 -5
- package/api/entities/Portfolio/index.d.ts.map +1 -1
- package/api/entities/Portfolio/index.js +70 -10
- package/api/entities/Portfolio/index.js.map +1 -1
- package/api/entities/Portfolio/types.d.ts +21 -6
- package/api/entities/Portfolio/types.d.ts.map +1 -1
- package/api/entities/TickerReservation/index.d.ts +2 -2
- package/api/entities/TickerReservation/index.d.ts.map +1 -1
- package/api/entities/Venue/types.d.ts +1 -1
- package/api/entities/common/namespaces/Authorizations.d.ts +2 -1
- package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -1
- package/api/entities/common/namespaces/Authorizations.js.map +1 -1
- package/api/entities/types.d.ts +5 -2
- package/api/entities/types.d.ts.map +1 -1
- package/api/entities/types.js.map +1 -1
- package/api/procedures/addAssetRequirement.d.ts +4 -4
- 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.map +1 -1
- package/api/procedures/addAssetStat.js +1 -1
- package/api/procedures/addAssetStat.js.map +1 -1
- package/api/procedures/addInstruction.d.ts.map +1 -1
- package/api/procedures/addInstruction.js +76 -17
- package/api/procedures/addInstruction.js.map +1 -1
- package/api/procedures/addTransferRestriction.d.ts.map +1 -1
- package/api/procedures/addTransferRestriction.js +1 -1
- package/api/procedures/addTransferRestriction.js.map +1 -1
- package/api/procedures/closeOffering.d.ts.map +1 -1
- package/api/procedures/closeOffering.js +1 -1
- package/api/procedures/closeOffering.js.map +1 -1
- package/api/procedures/configureDividendDistribution.d.ts.map +1 -1
- package/api/procedures/configureDividendDistribution.js +1 -1
- package/api/procedures/configureDividendDistribution.js.map +1 -1
- package/api/procedures/controllerTransfer.d.ts.map +1 -1
- package/api/procedures/controllerTransfer.js +2 -2
- package/api/procedures/controllerTransfer.js.map +1 -1
- package/api/procedures/createAsset.d.ts +5 -5
- package/api/procedures/createAsset.d.ts.map +1 -1
- package/api/procedures/createAsset.js +4 -20
- package/api/procedures/createAsset.js.map +1 -1
- package/api/procedures/createCheckpoint.d.ts.map +1 -1
- package/api/procedures/createCheckpoint.js +1 -1
- package/api/procedures/createCheckpoint.js.map +1 -1
- package/api/procedures/createCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/createCheckpointSchedule.js +1 -1
- package/api/procedures/createCheckpointSchedule.js.map +1 -1
- package/api/procedures/createGroup.d.ts +2 -2
- package/api/procedures/createGroup.d.ts.map +1 -1
- package/api/procedures/createGroup.js +1 -1
- package/api/procedures/createGroup.js.map +1 -1
- package/api/procedures/createNftCollection.d.ts +41 -0
- package/api/procedures/createNftCollection.d.ts.map +1 -0
- package/api/procedures/createNftCollection.js +248 -0
- package/api/procedures/createNftCollection.js.map +1 -0
- package/api/procedures/createTransactionBatch.d.ts.map +1 -1
- package/api/procedures/createTransactionBatch.js +1 -1
- package/api/procedures/createTransactionBatch.js.map +1 -1
- package/api/procedures/evaluateMultiSigProposal.d.ts +19 -0
- package/api/procedures/evaluateMultiSigProposal.d.ts.map +1 -0
- package/api/procedures/evaluateMultiSigProposal.js +92 -0
- package/api/procedures/evaluateMultiSigProposal.js.map +1 -0
- package/api/procedures/inviteExternalAgent.d.ts +2 -2
- package/api/procedures/inviteExternalAgent.d.ts.map +1 -1
- package/api/procedures/inviteExternalAgent.js +1 -1
- package/api/procedures/inviteExternalAgent.js.map +1 -1
- package/api/procedures/issueNft.d.ts +35 -0
- package/api/procedures/issueNft.d.ts.map +1 -0
- package/api/procedures/issueNft.js +98 -0
- package/api/procedures/issueNft.js.map +1 -0
- package/api/procedures/issueTokens.d.ts +6 -6
- package/api/procedures/issueTokens.d.ts.map +1 -1
- package/api/procedures/issueTokens.js +1 -1
- package/api/procedures/issueTokens.js.map +1 -1
- package/api/procedures/launchOffering.d.ts.map +1 -1
- package/api/procedures/launchOffering.js +1 -1
- package/api/procedures/launchOffering.js.map +1 -1
- package/api/procedures/linkCaDocs.d.ts.map +1 -1
- package/api/procedures/linkCaDocs.js +1 -1
- package/api/procedures/linkCaDocs.js.map +1 -1
- package/api/procedures/modifyAsset.d.ts +4 -4
- package/api/procedures/modifyAsset.d.ts.map +1 -1
- package/api/procedures/modifyAsset.js +2 -2
- package/api/procedures/modifyAsset.js.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +4 -4
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.js +2 -2
- package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -1
- package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -1
- package/api/procedures/modifyCaCheckpoint.js +1 -1
- package/api/procedures/modifyCaCheckpoint.js.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.js +2 -2
- package/api/procedures/modifyCaDefaultConfig.js.map +1 -1
- package/api/procedures/modifyClaims.d.ts.map +1 -1
- package/api/procedures/modifyClaims.js +7 -21
- package/api/procedures/modifyClaims.js.map +1 -1
- package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -1
- package/api/procedures/modifyComplianceRequirement.js +2 -2
- package/api/procedures/modifyComplianceRequirement.js.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.js +2 -2
- package/api/procedures/modifyCorporateActionsAgent.js.map +1 -1
- package/api/procedures/modifyOfferingTimes.d.ts.map +1 -1
- package/api/procedures/modifyOfferingTimes.js +1 -1
- package/api/procedures/modifyOfferingTimes.js.map +1 -1
- package/api/procedures/moveFunds.d.ts.map +1 -1
- package/api/procedures/moveFunds.js +82 -16
- package/api/procedures/moveFunds.js.map +1 -1
- package/api/procedures/reclaimDividendDistributionFunds.d.ts.map +1 -1
- package/api/procedures/reclaimDividendDistributionFunds.js +1 -1
- package/api/procedures/reclaimDividendDistributionFunds.js.map +1 -1
- package/api/procedures/redeemNft.d.ts +31 -0
- package/api/procedures/redeemNft.d.ts.map +1 -0
- package/api/procedures/redeemNft.js +87 -0
- package/api/procedures/redeemNft.js.map +1 -0
- package/api/procedures/redeemTokens.d.ts.map +1 -1
- package/api/procedures/redeemTokens.js +2 -2
- package/api/procedures/redeemTokens.js.map +1 -1
- package/api/procedures/registerCustomClaimType.d.ts +22 -0
- package/api/procedures/registerCustomClaimType.d.ts.map +1 -0
- package/api/procedures/registerCustomClaimType.js +69 -0
- package/api/procedures/registerCustomClaimType.js.map +1 -0
- package/api/procedures/registerMetadata.d.ts.map +1 -1
- package/api/procedures/registerMetadata.js +1 -1
- package/api/procedures/registerMetadata.js.map +1 -1
- package/api/procedures/removeAssetRequirement.d.ts +4 -4
- package/api/procedures/removeAssetRequirement.d.ts.map +1 -1
- package/api/procedures/removeAssetRequirement.js +2 -2
- package/api/procedures/removeAssetRequirement.js.map +1 -1
- package/api/procedures/removeAssetStat.d.ts.map +1 -1
- package/api/procedures/removeAssetStat.js +1 -1
- package/api/procedures/removeAssetStat.js.map +1 -1
- package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/removeCheckpointSchedule.js +1 -1
- package/api/procedures/removeCheckpointSchedule.js.map +1 -1
- package/api/procedures/removeCorporateAction.js +1 -1
- package/api/procedures/removeCorporateAction.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 +1 -1
- package/api/procedures/removeExternalAgent.js.map +1 -1
- package/api/procedures/setAssetDocuments.d.ts +5 -5
- package/api/procedures/setAssetDocuments.d.ts.map +1 -1
- package/api/procedures/setAssetDocuments.js +2 -2
- package/api/procedures/setAssetDocuments.js.map +1 -1
- package/api/procedures/setAssetRequirements.d.ts +4 -4
- package/api/procedures/setAssetRequirements.d.ts.map +1 -1
- package/api/procedures/setAssetRequirements.js +4 -4
- package/api/procedures/setAssetRequirements.js.map +1 -1
- package/api/procedures/setMetadata.d.ts.map +1 -1
- package/api/procedures/setMetadata.js +1 -1
- package/api/procedures/setMetadata.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 +1 -1
- package/api/procedures/setPermissionGroup.js.map +1 -1
- package/api/procedures/setTransferRestrictions.d.ts +1 -1
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +2 -2
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/setVenueFiltering.d.ts.map +1 -1
- package/api/procedures/setVenueFiltering.js +1 -1
- package/api/procedures/setVenueFiltering.js.map +1 -1
- package/api/procedures/toggleFreezeOffering.d.ts.map +1 -1
- package/api/procedures/toggleFreezeOffering.js +1 -1
- package/api/procedures/toggleFreezeOffering.js.map +1 -1
- package/api/procedures/toggleFreezeTransfers.d.ts +4 -4
- package/api/procedures/toggleFreezeTransfers.d.ts.map +1 -1
- package/api/procedures/toggleFreezeTransfers.js +4 -4
- package/api/procedures/toggleFreezeTransfers.js.map +1 -1
- package/api/procedures/togglePauseRequirements.d.ts +4 -4
- package/api/procedures/togglePauseRequirements.d.ts.map +1 -1
- package/api/procedures/togglePauseRequirements.js +2 -2
- package/api/procedures/togglePauseRequirements.js.map +1 -1
- package/api/procedures/transferAssetOwnership.d.ts.map +1 -1
- package/api/procedures/transferAssetOwnership.js +1 -1
- package/api/procedures/transferAssetOwnership.js.map +1 -1
- package/api/procedures/types.d.ts +82 -13
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js.map +1 -1
- package/api/procedures/utils.d.ts +10 -4
- package/api/procedures/utils.d.ts.map +1 -1
- package/api/procedures/utils.js +19 -2
- 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 +1 -1
- package/api/procedures/waivePermissions.js.map +1 -1
- package/base/Context.d.ts +2 -2
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +24 -24
- package/base/Context.js.map +1 -1
- package/base/PolymeshTransactionBatch.js +2 -2
- package/base/PolymeshTransactionBatch.js.map +1 -1
- package/base/Procedure.js.map +1 -1
- package/generated/types.d.ts +5 -1
- package/generated/types.d.ts.map +1 -1
- package/generated/types.js +4 -0
- package/generated/types.js.map +1 -1
- package/internal.d.ts +6 -2
- package/internal.d.ts.map +1 -1
- package/internal.js +16 -5
- package/internal.js.map +1 -1
- package/middleware/queries.d.ts +19 -2
- package/middleware/queries.d.ts.map +1 -1
- package/middleware/queries.js +104 -6
- package/middleware/queries.js.map +1 -1
- package/middleware/types.d.ts +68950 -15292
- package/middleware/types.d.ts.map +1 -1
- package/middleware/types.js +36222 -999
- package/middleware/types.js.map +1 -1
- package/middleware/typesV1.d.ts +1 -1
- package/middleware/typesV1.d.ts.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-23.0.0-alpha.31.tgz +0 -0
- package/package.json +2 -2
- package/polkadot/augment-api-errors.d.ts +4 -18
- package/polkadot/augment-api-errors.d.ts.map +1 -1
- package/polkadot/augment-api-events.d.ts +0 -6
- package/polkadot/augment-api-events.d.ts.map +1 -1
- package/polkadot/augment-api-query.d.ts +33 -26
- package/polkadot/augment-api-query.d.ts.map +1 -1
- package/polkadot/augment-api-tx.d.ts +123 -51
- package/polkadot/augment-api-tx.d.ts.map +1 -1
- package/polkadot/lookup.d.ts +246 -248
- package/polkadot/lookup.d.ts.map +1 -1
- package/polkadot/lookup.js +248 -253
- package/polkadot/lookup.js.map +1 -1
- package/polkadot/registry.d.ts +3 -5
- package/polkadot/registry.d.ts.map +1 -1
- package/polkadot/types-lookup.d.ts +251 -248
- package/polkadot/types-lookup.d.ts.map +1 -1
- package/types/index.d.ts +55 -12
- package/types/index.d.ts.map +1 -1
- package/types/index.js +24 -2
- package/types/index.js.map +1 -1
- package/types/internal.d.ts +7 -2
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js.map +1 -1
- package/utils/constants.d.ts +16 -0
- package/utils/constants.d.ts.map +1 -1
- package/utils/constants.js +17 -1
- package/utils/constants.js.map +1 -1
- package/utils/conversion.d.ts +74 -17
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +514 -365
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +60 -7
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +200 -63
- package/utils/internal.js.map +1 -1
- package/utils/typeguards.d.ts +34 -6
- package/utils/typeguards.d.ts.map +1 -1
- package/utils/typeguards.js +52 -8
- package/utils/typeguards.js.map +1 -1
- package/api/entities/Asset/AssetHolders.d.ts.map +0 -1
- package/api/entities/Asset/AssetHolders.js.map +0 -1
- package/api/entities/Asset/Checkpoints/Schedules.d.ts.map +0 -1
- package/api/entities/Asset/Checkpoints/Schedules.js.map +0 -1
- package/api/entities/Asset/Checkpoints/index.d.ts.map +0 -1
- package/api/entities/Asset/Checkpoints/index.js.map +0 -1
- package/api/entities/Asset/Checkpoints/types.d.ts.map +0 -1
- package/api/entities/Asset/Checkpoints/types.js.map +0 -1
- package/api/entities/Asset/Compliance/Requirements.d.ts.map +0 -1
- package/api/entities/Asset/Compliance/Requirements.js.map +0 -1
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts.map +0 -1
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.js.map +0 -1
- package/api/entities/Asset/Compliance/index.d.ts.map +0 -1
- package/api/entities/Asset/Compliance/index.js.map +0 -1
- package/api/entities/Asset/CorporateActions/Distributions.d.ts.map +0 -1
- package/api/entities/Asset/CorporateActions/Distributions.js.map +0 -1
- package/api/entities/Asset/CorporateActions/index.d.ts.map +0 -1
- package/api/entities/Asset/CorporateActions/index.js.map +0 -1
- package/api/entities/Asset/CorporateActions/types.d.ts.map +0 -1
- package/api/entities/Asset/CorporateActions/types.js.map +0 -1
- package/api/entities/Asset/Documents.d.ts.map +0 -1
- package/api/entities/Asset/Documents.js.map +0 -1
- package/api/entities/Asset/Issuance.d.ts.map +0 -1
- package/api/entities/Asset/Issuance.js.map +0 -1
- package/api/entities/Asset/Metadata.d.ts.map +0 -1
- package/api/entities/Asset/Metadata.js.map +0 -1
- package/api/entities/Asset/Offerings.d.ts.map +0 -1
- package/api/entities/Asset/Offerings.js.map +0 -1
- package/api/entities/Asset/Permissions.d.ts.map +0 -1
- package/api/entities/Asset/Permissions.js.map +0 -1
- package/api/entities/Asset/Settlements.d.ts +0 -29
- package/api/entities/Asset/Settlements.d.ts.map +0 -1
- package/api/entities/Asset/Settlements.js +0 -70
- package/api/entities/Asset/Settlements.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/ClaimCount.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/Count.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +0 -1
- package/api/entities/Asset/TransferRestrictions/index.d.ts.map +0 -1
- package/api/entities/Asset/TransferRestrictions/index.js.map +0 -1
- package/middleware/enums.d.ts +0 -3
- package/middleware/enums.d.ts.map +0 -1
- package/middleware/enums.js +0 -38
- package/middleware/enums.js.map +0 -1
- package/npm-package/polymeshassociation-polymesh-sdk-23.0.0-alpha.3.tgz +0 -0
- /package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/types.js +0 -0
- /package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/types.js +0 -0
package/utils/conversion.js
CHANGED
|
@@ -18,9 +18,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.u32ToBigNumber = exports.bigNumberToU32 = exports.meshPermissionsToPermissions = exports.extrinsicPermissionsToTransactionPermissions = exports.permissionsToMeshPermissions = exports.transactionPermissionsToExtrinsicPermissions = exports.transactionPermissionsToTxGroups = exports.txGroupToTxTags = exports.textToString = exports.stringToText = exports.portfolioToPortfolioKind = exports.portfolioIdToMeshPortfolioId = exports.portfolioLikeToPortfolio = exports.portfolioIdToPortfolio = exports.portfolioLikeToPortfolioId = exports.portfolioToPortfolioId = exports.meshPortfolioIdToPortfolio = exports.claimPercentageToClaimPercentageRestrictionValue = exports.claimCountToClaimCountRestrictionValue = exports.meshClaimToInputStatClaim = exports.permillToBigNumber = exports.percentageToPermill = exports.bigNumberToU128 = exports.bigNumberToU64 = exports.u128ToBigNumber = exports.u64ToBigNumber = exports.signerToString = exports.signerToSignatory = exports.signerValueToSigner = exports.signerToSignerValue = exports.signatoryToSignerValue = exports.signerValueToSignatory = exports.identityIdToString = exports.stringToIdentityId = exports.stringToBlockHash = exports.stringToHash = exports.hashToString = exports.accountIdToString = exports.stringToAccountId = exports.momentToDate = exports.dateToMoment = exports.stringToU8aFixed = exports.tickerToString = exports.stringToTickerKey = exports.stringToTicker = exports.bytesToString = exports.stringToBytes = exports.boolToBoolean = exports.booleanToBool = exports.tickerToDid = void 0;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.middlewareAuthorizationDataToAuthorization = exports.middlewarePermissionsDataToPermissions = exports.datesToScheduleCheckpoints = exports.middlewareAgentGroupDataToPermissionGroup = exports.
|
|
21
|
+
exports.txTagToExtrinsicIdentifier = exports.extrinsicIdentifierToTxTag = exports.txTagToProtocolOp = exports.complianceRequirementToRequirement = exports.complianceRequirementResultToRequirementCompliance = exports.requirementToComplianceRequirement = exports.trustedClaimIssuerToTrustedIssuer = exports.trustedIssuerToTrustedClaimIssuer = exports.meshClaimTypeToClaimType = exports.stringToTargetIdentity = exports.statsClaimToStatClaimInputType = exports.meshClaimToClaim = exports.middlewareEventDetailsToEventIdentifier = exports.scopeToMiddlewareScope = exports.middlewareScopeToScope = exports.claimToMeshClaim = exports.cddIdToString = exports.stringToCddId = exports.meshScopeToScope = exports.scopeToMeshScope = exports.canTransferResultToTransferStatus = exports.cddStatusToBoolean = exports.documentToAssetDocument = exports.assetDocumentToDocument = exports.documentHashToString = exports.stringToDocumentHash = exports.assetIdentifierToSecurityIdentifier = exports.securityIdentifierToAssetIdentifier = exports.isFigiValid = exports.isLeiValid = exports.isCusipValid = exports.isIsinValid = exports.fundingRoundToAssetFundingRound = exports.nameToAssetName = exports.posRatioToBigNumber = exports.assetTypeToKnownOrId = exports.internalNftTypeToNftType = exports.internalAssetTypeToAssetType = exports.u8ToTransferStatus = exports.stringToMemo = exports.authorizationDataToAuthorization = exports.agentGroupToPermissionGroup = exports.balanceToBigNumber = exports.bigNumberToBalance = exports.authorizationTypeToMeshAuthorizationType = exports.authorizationToAuthorizationData = exports.agentGroupToPermissionGroupIdentifier = exports.permissionGroupIdentifierToAgentGroup = exports.u8ToBigNumber = exports.u16ToBigNumber = void 0;
|
|
22
|
+
exports.createStat2ndKey = exports.transferRestrictionTypeToStatOpType = exports.statTypeToStatOpType = exports.meshStatToStatType = exports.statUpdatesToBtreeStatUpdate = exports.keyAndValueToStatUpdate = exports.transferConditionsToBtreeTransferConditions = exports.statisticStatTypesToBtreeStatType = exports.sortStatsByClaimType = exports.statisticsOpTypeToStatType = exports.corporateActionParamsToMeshCorporateActionArgs = exports.corporateActionIdentifierToCaId = exports.distributionToDividendDistributionParams = exports.caTaxWithholdingsToMeshTaxWithholdings = exports.targetsToTargetIdentities = exports.targetIdentitiesToCorporateActionTargets = exports.checkpointToRecordDateSpec = exports.corporateActionKindToCaKind = exports.meshCorporateActionToCorporateActionParams = exports.fundraiserToOfferingDetails = exports.fundraiserTierToTier = exports.middlewarePortfolioToPortfolio = exports.permissionsLikeToPermissions = exports.offeringTierToPriceTier = exports.granularCanTransferResultToTransferBreakdown = exports.nftDispatchErrorToTransferError = exports.transferConditionToTransferRestriction = exports.identitiesToBtreeSet = exports.transferRestrictionToPolymeshTransferCondition = exports.claimIssuerToMeshClaimIssuer = exports.claimTypeToMeshClaimType = exports.nftMovementToPortfolioFund = exports.fungibleMovementToPortfolioFund = exports.nftToMeshNft = exports.toIdentityWithClaimsArray = exports.middlewareClaimToClaimData = exports.endConditionToSettlementType = exports.meshSettlementTypeToEndCondition = exports.meshAffirmationStatusToAffirmationStatus = exports.meshInstructionStatusToInstructionStatus = exports.venueTypeToMeshVenueType = exports.meshVenueTypeToVenueType = exports.secondaryAccountToMeshSecondaryKey = exports.transactionToTxTag = exports.transactionHexToTxTag = exports.coerceHexToString = exports.addressToKey = exports.keyToAddress = exports.moduleAddressToString = exports.assetComplianceResultToCompliance = void 0;
|
|
23
|
+
exports.nftInputToNftMetadataVec = exports.nftInputToNftMetadataAttribute = exports.meshNftToNftId = exports.meshMetadataKeyToMetadataKey = exports.collectionKeysToMetadataKeys = exports.middlewareAuthorizationDataToAuthorization = exports.middlewarePermissionsDataToPermissions = exports.datesToScheduleCheckpoints = exports.middlewareAgentGroupDataToPermissionGroup = exports.legToNonFungibleLeg = exports.legToFungibleLeg = exports.middlewarePortfolioDataToPortfolio = exports.expiryToMoment = exports.middlewareInstructionToHistoricInstruction = exports.instructionMemoToString = exports.metadataValueDetailToMeshMetadataValueDetail = exports.metadataValueToMeshMetadataValue = exports.meshMetadataValueToMetadataValue = exports.metadataToMeshMetadataKey = exports.meshMetadataSpecToMetadataSpec = exports.metadataSpecToMeshMetadataSpec = exports.meshProposalStatusToProposalStatus = exports.inputStatTypeToMeshStatType = exports.countStatInputToStatUpdates = exports.claimCountStatInputToStatUpdates = exports.toExemptKey = exports.complianceConditionsToBtreeSet = exports.sortTransferRestrictionByClaimValue = void 0;
|
|
24
24
|
const util_1 = require("@polkadot/util");
|
|
25
25
|
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
26
26
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
@@ -29,9 +29,9 @@ const lodash_1 = require("lodash");
|
|
|
29
29
|
const utils_1 = require("../api/procedures/utils");
|
|
30
30
|
const utils_2 = require("../generated/utils");
|
|
31
31
|
const internal_1 = require("../internal");
|
|
32
|
-
const
|
|
32
|
+
const types_1 = require("../middleware/types");
|
|
33
33
|
const typesV1_1 = require("../middleware/typesV1");
|
|
34
|
-
const
|
|
34
|
+
const types_2 = require("../types");
|
|
35
35
|
const internal_2 = require("../types/internal");
|
|
36
36
|
const utils_3 = require("../types/utils");
|
|
37
37
|
const constants_1 = require("./constants");
|
|
@@ -189,9 +189,9 @@ function createSignerValue(type, value) {
|
|
|
189
189
|
*/
|
|
190
190
|
function signatoryToSignerValue(signatory) {
|
|
191
191
|
if (signatory.isAccount) {
|
|
192
|
-
return createSignerValue(
|
|
192
|
+
return createSignerValue(types_2.SignerType.Account, accountIdToString(signatory.asAccount));
|
|
193
193
|
}
|
|
194
|
-
return createSignerValue(
|
|
194
|
+
return createSignerValue(types_2.SignerType.Identity, identityIdToString(signatory.asIdentity));
|
|
195
195
|
}
|
|
196
196
|
exports.signatoryToSignerValue = signatoryToSignerValue;
|
|
197
197
|
/**
|
|
@@ -199,9 +199,9 @@ exports.signatoryToSignerValue = signatoryToSignerValue;
|
|
|
199
199
|
*/
|
|
200
200
|
function signerToSignerValue(signer) {
|
|
201
201
|
if (signer instanceof internal_1.Account) {
|
|
202
|
-
return createSignerValue(
|
|
202
|
+
return createSignerValue(types_2.SignerType.Account, signer.address);
|
|
203
203
|
}
|
|
204
|
-
return createSignerValue(
|
|
204
|
+
return createSignerValue(types_2.SignerType.Identity, signer.did);
|
|
205
205
|
}
|
|
206
206
|
exports.signerToSignerValue = signerToSignerValue;
|
|
207
207
|
/**
|
|
@@ -209,7 +209,7 @@ exports.signerToSignerValue = signerToSignerValue;
|
|
|
209
209
|
*/
|
|
210
210
|
function signerValueToSigner(signerValue, context) {
|
|
211
211
|
const { type, value } = signerValue;
|
|
212
|
-
if (type ===
|
|
212
|
+
if (type === types_2.SignerType.Account) {
|
|
213
213
|
return new internal_1.Account({ address: value }, context);
|
|
214
214
|
}
|
|
215
215
|
return new internal_1.Identity({ did: value }, context);
|
|
@@ -271,7 +271,7 @@ function percentageToPermill(value, context) {
|
|
|
271
271
|
(0, internal_3.assertIsPositive)(value);
|
|
272
272
|
if (value.gt(100)) {
|
|
273
273
|
throw new internal_1.PolymeshError({
|
|
274
|
-
code:
|
|
274
|
+
code: types_2.ErrorCode.ValidationError,
|
|
275
275
|
message: "Percentage shouldn't exceed 100",
|
|
276
276
|
});
|
|
277
277
|
}
|
|
@@ -293,19 +293,19 @@ exports.permillToBigNumber = permillToBigNumber;
|
|
|
293
293
|
function meshClaimToInputStatClaim(claim) {
|
|
294
294
|
if (claim.isAccredited) {
|
|
295
295
|
return {
|
|
296
|
-
type:
|
|
296
|
+
type: types_2.ClaimType.Accredited,
|
|
297
297
|
accredited: boolToBoolean(claim.asAccredited),
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
else if (claim.isAffiliate) {
|
|
301
301
|
return {
|
|
302
|
-
type:
|
|
302
|
+
type: types_2.ClaimType.Affiliate,
|
|
303
303
|
affiliate: boolToBoolean(claim.asAffiliate),
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
else {
|
|
307
307
|
return {
|
|
308
|
-
type:
|
|
308
|
+
type: types_2.ClaimType.Jurisdiction,
|
|
309
309
|
countryCode: claim.asJurisdiction.isSome
|
|
310
310
|
? (0, utils_2.meshCountryCodeToCountryCode)(claim.asJurisdiction.unwrap())
|
|
311
311
|
: undefined,
|
|
@@ -449,89 +449,89 @@ exports.textToString = textToString;
|
|
|
449
449
|
*/
|
|
450
450
|
function txGroupToTxTags(group) {
|
|
451
451
|
switch (group) {
|
|
452
|
-
case
|
|
452
|
+
case types_2.TxGroup.PortfolioManagement: {
|
|
453
453
|
return [
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
454
|
+
types_2.TxTags.identity.AddInvestorUniquenessClaim,
|
|
455
|
+
types_2.TxTags.portfolio.MovePortfolioFunds,
|
|
456
|
+
types_2.TxTags.settlement.AddInstruction,
|
|
457
|
+
types_2.TxTags.settlement.AddInstructionWithMemo,
|
|
458
|
+
types_2.TxTags.settlement.AddAndAffirmInstruction,
|
|
459
|
+
types_2.TxTags.settlement.AddAndAffirmInstructionWithMemo,
|
|
460
|
+
types_2.TxTags.settlement.AffirmInstruction,
|
|
461
|
+
types_2.TxTags.settlement.RejectInstruction,
|
|
462
|
+
types_2.TxTags.settlement.CreateVenue,
|
|
463
463
|
];
|
|
464
464
|
}
|
|
465
|
-
case
|
|
465
|
+
case types_2.TxGroup.AssetManagement: {
|
|
466
466
|
return [
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
467
|
+
types_2.TxTags.asset.MakeDivisible,
|
|
468
|
+
types_2.TxTags.asset.RenameAsset,
|
|
469
|
+
types_2.TxTags.asset.SetFundingRound,
|
|
470
|
+
types_2.TxTags.asset.AddDocuments,
|
|
471
|
+
types_2.TxTags.asset.RemoveDocuments,
|
|
472
472
|
];
|
|
473
473
|
}
|
|
474
|
-
case
|
|
474
|
+
case types_2.TxGroup.AdvancedAssetManagement: {
|
|
475
475
|
return [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
types_2.TxTags.asset.Freeze,
|
|
477
|
+
types_2.TxTags.asset.Unfreeze,
|
|
478
|
+
types_2.TxTags.identity.AddAuthorization,
|
|
479
|
+
types_2.TxTags.identity.RemoveAuthorization,
|
|
480
480
|
];
|
|
481
481
|
}
|
|
482
|
-
case
|
|
482
|
+
case types_2.TxGroup.Distribution: {
|
|
483
483
|
return [
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
484
|
+
types_2.TxTags.identity.AddInvestorUniquenessClaim,
|
|
485
|
+
types_2.TxTags.settlement.CreateVenue,
|
|
486
|
+
types_2.TxTags.settlement.AddInstruction,
|
|
487
|
+
types_2.TxTags.settlement.AddInstructionWithMemo,
|
|
488
|
+
types_2.TxTags.settlement.AddAndAffirmInstruction,
|
|
489
|
+
types_2.TxTags.settlement.AddAndAffirmInstructionWithMemo,
|
|
490
490
|
];
|
|
491
491
|
}
|
|
492
|
-
case
|
|
493
|
-
return [
|
|
492
|
+
case types_2.TxGroup.Issuance: {
|
|
493
|
+
return [types_2.TxTags.asset.Issue];
|
|
494
494
|
}
|
|
495
|
-
case
|
|
495
|
+
case types_2.TxGroup.TrustedClaimIssuersManagement: {
|
|
496
496
|
return [
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
types_2.TxTags.complianceManager.AddDefaultTrustedClaimIssuer,
|
|
498
|
+
types_2.TxTags.complianceManager.RemoveDefaultTrustedClaimIssuer,
|
|
499
499
|
];
|
|
500
500
|
}
|
|
501
|
-
case
|
|
502
|
-
return [
|
|
501
|
+
case types_2.TxGroup.ClaimsManagement: {
|
|
502
|
+
return [types_2.TxTags.identity.AddClaim, types_2.TxTags.identity.RevokeClaim];
|
|
503
503
|
}
|
|
504
|
-
case
|
|
504
|
+
case types_2.TxGroup.ComplianceRequirementsManagement: {
|
|
505
505
|
return [
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
506
|
+
types_2.TxTags.complianceManager.AddComplianceRequirement,
|
|
507
|
+
types_2.TxTags.complianceManager.RemoveComplianceRequirement,
|
|
508
|
+
types_2.TxTags.complianceManager.PauseAssetCompliance,
|
|
509
|
+
types_2.TxTags.complianceManager.ResumeAssetCompliance,
|
|
510
|
+
types_2.TxTags.complianceManager.ResetAssetCompliance,
|
|
511
511
|
];
|
|
512
512
|
}
|
|
513
|
-
case
|
|
513
|
+
case types_2.TxGroup.CorporateActionsManagement: {
|
|
514
514
|
return [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
515
|
+
types_2.TxTags.checkpoint.CreateSchedule,
|
|
516
|
+
types_2.TxTags.checkpoint.RemoveSchedule,
|
|
517
|
+
types_2.TxTags.checkpoint.CreateCheckpoint,
|
|
518
|
+
types_2.TxTags.corporateAction.InitiateCorporateAction,
|
|
519
|
+
types_2.TxTags.capitalDistribution.Distribute,
|
|
520
|
+
types_2.TxTags.capitalDistribution.Claim,
|
|
521
|
+
types_2.TxTags.identity.AddInvestorUniquenessClaim,
|
|
522
522
|
];
|
|
523
523
|
}
|
|
524
|
-
case
|
|
524
|
+
case types_2.TxGroup.StoManagement: {
|
|
525
525
|
return [
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
526
|
+
types_2.TxTags.sto.CreateFundraiser,
|
|
527
|
+
types_2.TxTags.sto.FreezeFundraiser,
|
|
528
|
+
types_2.TxTags.sto.Invest,
|
|
529
|
+
types_2.TxTags.sto.ModifyFundraiserWindow,
|
|
530
|
+
types_2.TxTags.sto.Stop,
|
|
531
|
+
types_2.TxTags.sto.UnfreezeFundraiser,
|
|
532
|
+
types_2.TxTags.identity.AddInvestorUniquenessClaim,
|
|
533
|
+
types_2.TxTags.asset.Issue,
|
|
534
|
+
types_2.TxTags.settlement.CreateVenue,
|
|
535
535
|
];
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -550,7 +550,7 @@ function transactionPermissionsToTxGroups(permissions) {
|
|
|
550
550
|
const { values: transactionValues, type, exceptions = [] } = permissions;
|
|
551
551
|
let includedTags;
|
|
552
552
|
let excludedTags;
|
|
553
|
-
if (type ===
|
|
553
|
+
if (type === types_2.PermissionType.Include) {
|
|
554
554
|
includedTags = transactionValues;
|
|
555
555
|
excludedTags = exceptions;
|
|
556
556
|
}
|
|
@@ -558,7 +558,7 @@ function transactionPermissionsToTxGroups(permissions) {
|
|
|
558
558
|
includedTags = exceptions;
|
|
559
559
|
excludedTags = transactionValues;
|
|
560
560
|
}
|
|
561
|
-
return (0, lodash_1.values)(
|
|
561
|
+
return (0, lodash_1.values)(types_2.TxGroup)
|
|
562
562
|
.sort()
|
|
563
563
|
.filter(group => {
|
|
564
564
|
const tagsInGroup = txGroupToTxTags(group);
|
|
@@ -594,7 +594,7 @@ function initExtrinsicDict(txValues, message) {
|
|
|
594
594
|
let pallet = extrinsicDict[palletName];
|
|
595
595
|
if (pallet === null) {
|
|
596
596
|
throw new internal_1.PolymeshError({
|
|
597
|
-
code:
|
|
597
|
+
code: types_2.ErrorCode.ValidationError,
|
|
598
598
|
message,
|
|
599
599
|
data: {
|
|
600
600
|
module: palletName,
|
|
@@ -626,7 +626,7 @@ function buildPalletPermissions(transactions) {
|
|
|
626
626
|
const pallet = extrinsicDict[palletName];
|
|
627
627
|
if (pallet === undefined) {
|
|
628
628
|
throw new internal_1.PolymeshError({
|
|
629
|
-
code:
|
|
629
|
+
code: types_2.ErrorCode.ValidationError,
|
|
630
630
|
message: 'Attempting to add a transaction permission exception without its corresponding module being included/excluded',
|
|
631
631
|
});
|
|
632
632
|
}
|
|
@@ -638,7 +638,7 @@ function buildPalletPermissions(transactions) {
|
|
|
638
638
|
}
|
|
639
639
|
else {
|
|
640
640
|
throw new internal_1.PolymeshError({
|
|
641
|
-
code:
|
|
641
|
+
code: types_2.ErrorCode.ValidationError,
|
|
642
642
|
message: 'Cannot simultaneously include and exclude transactions belonging to the same module',
|
|
643
643
|
});
|
|
644
644
|
}
|
|
@@ -668,7 +668,7 @@ function buildPalletPermissions(transactions) {
|
|
|
668
668
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
669
669
|
};
|
|
670
670
|
});
|
|
671
|
-
if (type ===
|
|
671
|
+
if (type === types_2.PermissionType.Include) {
|
|
672
672
|
extrinsic = {
|
|
673
673
|
These: pallets,
|
|
674
674
|
};
|
|
@@ -698,7 +698,7 @@ function permissionsToMeshPermissions(permissions, context) {
|
|
|
698
698
|
const { values: assetValues, type } = assets;
|
|
699
699
|
assetValues.sort(({ ticker: tickerA }, { ticker: tickerB }) => tickerA.localeCompare(tickerB));
|
|
700
700
|
const tickers = assetValues.map(({ ticker }) => stringToTicker(ticker, context));
|
|
701
|
-
if (type ===
|
|
701
|
+
if (type === types_2.PermissionType.Include) {
|
|
702
702
|
asset = {
|
|
703
703
|
These: tickers,
|
|
704
704
|
};
|
|
@@ -713,7 +713,7 @@ function permissionsToMeshPermissions(permissions, context) {
|
|
|
713
713
|
if (portfolios) {
|
|
714
714
|
const { values: portfolioValues, type } = portfolios;
|
|
715
715
|
const portfolioIds = portfolioValues.map(pValue => portfolioIdToMeshPortfolioId(portfolioToPortfolioId(pValue), context));
|
|
716
|
-
if (type ===
|
|
716
|
+
if (type === types_2.PermissionType.Include) {
|
|
717
717
|
portfolio = {
|
|
718
718
|
These: portfolioIds,
|
|
719
719
|
};
|
|
@@ -742,11 +742,11 @@ function extrinsicPermissionsToTransactionPermissions(permissions) {
|
|
|
742
742
|
let extrinsicType;
|
|
743
743
|
let pallets;
|
|
744
744
|
if (permissions.isThese) {
|
|
745
|
-
extrinsicType =
|
|
745
|
+
extrinsicType = types_2.PermissionType.Include;
|
|
746
746
|
pallets = permissions.asThese;
|
|
747
747
|
}
|
|
748
748
|
else if (permissions.isExcept) {
|
|
749
|
-
extrinsicType =
|
|
749
|
+
extrinsicType = types_2.PermissionType.Exclude;
|
|
750
750
|
pallets = permissions.asExcept;
|
|
751
751
|
}
|
|
752
752
|
let txValues = [];
|
|
@@ -794,16 +794,16 @@ function meshPermissionsToPermissions(permissions, context) {
|
|
|
794
794
|
let assetsType;
|
|
795
795
|
let assetsPermissions;
|
|
796
796
|
if (asset.isThese) {
|
|
797
|
-
assetsType =
|
|
797
|
+
assetsType = types_2.PermissionType.Include;
|
|
798
798
|
assetsPermissions = asset.asThese;
|
|
799
799
|
}
|
|
800
800
|
else if (asset.isExcept) {
|
|
801
|
-
assetsType =
|
|
801
|
+
assetsType = types_2.PermissionType.Exclude;
|
|
802
802
|
assetsPermissions = asset.asExcept;
|
|
803
803
|
}
|
|
804
804
|
if (assetsPermissions) {
|
|
805
805
|
assets = {
|
|
806
|
-
values: [...assetsPermissions].map(ticker => new internal_1.
|
|
806
|
+
values: [...assetsPermissions].map(ticker => new internal_1.FungibleAsset({ ticker: tickerToString(ticker) }, context)),
|
|
807
807
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
808
808
|
type: assetsType,
|
|
809
809
|
};
|
|
@@ -812,11 +812,11 @@ function meshPermissionsToPermissions(permissions, context) {
|
|
|
812
812
|
let portfoliosType;
|
|
813
813
|
let portfolioIds;
|
|
814
814
|
if (portfolio.isThese) {
|
|
815
|
-
portfoliosType =
|
|
815
|
+
portfoliosType = types_2.PermissionType.Include;
|
|
816
816
|
portfolioIds = portfolio.asThese;
|
|
817
817
|
}
|
|
818
818
|
else if (portfolio.isExcept) {
|
|
819
|
-
portfoliosType =
|
|
819
|
+
portfoliosType = types_2.PermissionType.Exclude;
|
|
820
820
|
portfolioIds = portfolio.asExcept;
|
|
821
821
|
}
|
|
822
822
|
if (portfolioIds) {
|
|
@@ -878,16 +878,16 @@ exports.permissionGroupIdentifierToAgentGroup = permissionGroupIdentifierToAgent
|
|
|
878
878
|
*/
|
|
879
879
|
function agentGroupToPermissionGroupIdentifier(agentGroup) {
|
|
880
880
|
if (agentGroup.isFull) {
|
|
881
|
-
return
|
|
881
|
+
return types_2.PermissionGroupType.Full;
|
|
882
882
|
}
|
|
883
883
|
else if (agentGroup.isExceptMeta) {
|
|
884
|
-
return
|
|
884
|
+
return types_2.PermissionGroupType.ExceptMeta;
|
|
885
885
|
}
|
|
886
886
|
else if (agentGroup.isPolymeshV1CAA) {
|
|
887
|
-
return
|
|
887
|
+
return types_2.PermissionGroupType.PolymeshV1Caa;
|
|
888
888
|
}
|
|
889
889
|
else if (agentGroup.isPolymeshV1PIA) {
|
|
890
|
-
return
|
|
890
|
+
return types_2.PermissionGroupType.PolymeshV1Pia;
|
|
891
891
|
}
|
|
892
892
|
else {
|
|
893
893
|
return { custom: u32ToBigNumber(agentGroup.asCustom) };
|
|
@@ -900,26 +900,26 @@ exports.agentGroupToPermissionGroupIdentifier = agentGroupToPermissionGroupIdent
|
|
|
900
900
|
function authorizationToAuthorizationData(auth, context) {
|
|
901
901
|
let value;
|
|
902
902
|
const { type } = auth;
|
|
903
|
-
if (type ===
|
|
903
|
+
if (type === types_2.AuthorizationType.AttestPrimaryKeyRotation) {
|
|
904
904
|
value = stringToIdentityId(auth.value.did, context);
|
|
905
905
|
}
|
|
906
|
-
else if (type ===
|
|
906
|
+
else if (type === types_2.AuthorizationType.RotatePrimaryKey) {
|
|
907
907
|
value = null;
|
|
908
908
|
}
|
|
909
|
-
else if (type ===
|
|
909
|
+
else if (type === types_2.AuthorizationType.JoinIdentity) {
|
|
910
910
|
value = permissionsToMeshPermissions(auth.value, context);
|
|
911
911
|
}
|
|
912
|
-
else if (type ===
|
|
912
|
+
else if (type === types_2.AuthorizationType.PortfolioCustody) {
|
|
913
913
|
value = portfolioIdToMeshPortfolioId(portfolioToPortfolioId(auth.value), context);
|
|
914
914
|
}
|
|
915
|
-
else if (auth.type ===
|
|
916
|
-
auth.type ===
|
|
915
|
+
else if (auth.type === types_2.AuthorizationType.TransferAssetOwnership ||
|
|
916
|
+
auth.type === types_2.AuthorizationType.TransferTicker) {
|
|
917
917
|
value = stringToTicker(auth.value, context);
|
|
918
918
|
}
|
|
919
|
-
else if (type ===
|
|
919
|
+
else if (type === types_2.AuthorizationType.RotatePrimaryKeyToSecondary) {
|
|
920
920
|
value = permissionsToMeshPermissions(auth.value, context);
|
|
921
921
|
}
|
|
922
|
-
else if (type ===
|
|
922
|
+
else if (type === types_2.AuthorizationType.BecomeAgent) {
|
|
923
923
|
const ticker = stringToTicker(auth.value.asset.ticker, context);
|
|
924
924
|
if (auth.value instanceof internal_1.CustomPermissionGroup) {
|
|
925
925
|
const { id } = auth.value;
|
|
@@ -953,7 +953,7 @@ function bigNumberToBalance(value, context, divisible = true) {
|
|
|
953
953
|
(0, internal_3.assertIsPositive)(value);
|
|
954
954
|
if (value.isGreaterThan(constants_1.MAX_BALANCE)) {
|
|
955
955
|
throw new internal_1.PolymeshError({
|
|
956
|
-
code:
|
|
956
|
+
code: types_2.ErrorCode.ValidationError,
|
|
957
957
|
message: 'The value exceeds the maximum possible balance',
|
|
958
958
|
data: {
|
|
959
959
|
currentValue: value,
|
|
@@ -964,7 +964,7 @@ function bigNumberToBalance(value, context, divisible = true) {
|
|
|
964
964
|
if (divisible) {
|
|
965
965
|
if (((_a = value.decimalPlaces()) !== null && _a !== void 0 ? _a : 0) > constants_1.MAX_DECIMALS) {
|
|
966
966
|
throw new internal_1.PolymeshError({
|
|
967
|
-
code:
|
|
967
|
+
code: types_2.ErrorCode.ValidationError,
|
|
968
968
|
message: 'The value has more decimal places than allowed',
|
|
969
969
|
data: {
|
|
970
970
|
currentValue: value,
|
|
@@ -976,7 +976,7 @@ function bigNumberToBalance(value, context, divisible = true) {
|
|
|
976
976
|
else {
|
|
977
977
|
if (value.decimalPlaces()) {
|
|
978
978
|
throw new internal_1.PolymeshError({
|
|
979
|
-
code:
|
|
979
|
+
code: types_2.ErrorCode.ValidationError,
|
|
980
980
|
message: 'The value has decimals but the Asset is indivisible',
|
|
981
981
|
});
|
|
982
982
|
}
|
|
@@ -996,10 +996,10 @@ exports.balanceToBigNumber = balanceToBigNumber;
|
|
|
996
996
|
*/
|
|
997
997
|
function assemblePermissionGroup(permissionGroupIdentifier, ticker, context) {
|
|
998
998
|
switch (permissionGroupIdentifier) {
|
|
999
|
-
case
|
|
1000
|
-
case
|
|
1001
|
-
case
|
|
1002
|
-
case
|
|
999
|
+
case types_2.PermissionGroupType.ExceptMeta:
|
|
1000
|
+
case types_2.PermissionGroupType.Full:
|
|
1001
|
+
case types_2.PermissionGroupType.PolymeshV1Caa:
|
|
1002
|
+
case types_2.PermissionGroupType.PolymeshV1Pia: {
|
|
1003
1003
|
return new internal_1.KnownPermissionGroup({ type: permissionGroupIdentifier, ticker }, context);
|
|
1004
1004
|
}
|
|
1005
1005
|
default: {
|
|
@@ -1022,7 +1022,7 @@ exports.agentGroupToPermissionGroup = agentGroupToPermissionGroup;
|
|
|
1022
1022
|
function authorizationDataToAuthorization(auth, context) {
|
|
1023
1023
|
if (auth.isAttestPrimaryKeyRotation) {
|
|
1024
1024
|
return {
|
|
1025
|
-
type:
|
|
1025
|
+
type: types_2.AuthorizationType.AttestPrimaryKeyRotation,
|
|
1026
1026
|
value: new internal_1.Identity({
|
|
1027
1027
|
did: identityIdToString(auth.asAttestPrimaryKeyRotation),
|
|
1028
1028
|
}, context),
|
|
@@ -1030,43 +1030,43 @@ function authorizationDataToAuthorization(auth, context) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
if (auth.isRotatePrimaryKey) {
|
|
1032
1032
|
return {
|
|
1033
|
-
type:
|
|
1033
|
+
type: types_2.AuthorizationType.RotatePrimaryKey,
|
|
1034
1034
|
};
|
|
1035
1035
|
}
|
|
1036
1036
|
if (auth.isTransferTicker) {
|
|
1037
1037
|
return {
|
|
1038
|
-
type:
|
|
1038
|
+
type: types_2.AuthorizationType.TransferTicker,
|
|
1039
1039
|
value: tickerToString(auth.asTransferTicker),
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
1042
|
if (auth.isAddMultiSigSigner) {
|
|
1043
1043
|
return {
|
|
1044
|
-
type:
|
|
1044
|
+
type: types_2.AuthorizationType.AddMultiSigSigner,
|
|
1045
1045
|
value: accountIdToString(auth.asAddMultiSigSigner),
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
1048
|
if (auth.isTransferAssetOwnership) {
|
|
1049
1049
|
return {
|
|
1050
|
-
type:
|
|
1050
|
+
type: types_2.AuthorizationType.TransferAssetOwnership,
|
|
1051
1051
|
value: tickerToString(auth.asTransferAssetOwnership),
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
1054
|
if (auth.isPortfolioCustody) {
|
|
1055
1055
|
return {
|
|
1056
|
-
type:
|
|
1056
|
+
type: types_2.AuthorizationType.PortfolioCustody,
|
|
1057
1057
|
value: meshPortfolioIdToPortfolio(auth.asPortfolioCustody, context),
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
1060
|
if (auth.isJoinIdentity) {
|
|
1061
1061
|
return {
|
|
1062
|
-
type:
|
|
1062
|
+
type: types_2.AuthorizationType.JoinIdentity,
|
|
1063
1063
|
value: meshPermissionsToPermissions(auth.asJoinIdentity, context),
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
1066
|
if (auth.isAddRelayerPayingKey) {
|
|
1067
1067
|
const [userKey, payingKey, polyxLimit] = auth.asAddRelayerPayingKey;
|
|
1068
1068
|
return {
|
|
1069
|
-
type:
|
|
1069
|
+
type: types_2.AuthorizationType.AddRelayerPayingKey,
|
|
1070
1070
|
value: {
|
|
1071
1071
|
beneficiary: new internal_1.Account({ address: accountIdToString(userKey) }, context),
|
|
1072
1072
|
subsidizer: new internal_1.Account({ address: accountIdToString(payingKey) }, context),
|
|
@@ -1077,18 +1077,18 @@ function authorizationDataToAuthorization(auth, context) {
|
|
|
1077
1077
|
if (auth.isBecomeAgent) {
|
|
1078
1078
|
const [ticker, agentGroup] = auth.asBecomeAgent;
|
|
1079
1079
|
return {
|
|
1080
|
-
type:
|
|
1080
|
+
type: types_2.AuthorizationType.BecomeAgent,
|
|
1081
1081
|
value: agentGroupToPermissionGroup(agentGroup, tickerToString(ticker), context),
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
1084
|
if (auth.isRotatePrimaryKeyToSecondary) {
|
|
1085
1085
|
return {
|
|
1086
|
-
type:
|
|
1086
|
+
type: types_2.AuthorizationType.RotatePrimaryKeyToSecondary,
|
|
1087
1087
|
value: meshPermissionsToPermissions(auth.asRotatePrimaryKeyToSecondary, context),
|
|
1088
1088
|
};
|
|
1089
1089
|
}
|
|
1090
1090
|
throw new internal_1.PolymeshError({
|
|
1091
|
-
code:
|
|
1091
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
1092
1092
|
message: 'Unsupported Authorization Type. Please contact the Polymesh team',
|
|
1093
1093
|
data: {
|
|
1094
1094
|
auth: JSON.stringify(auth, null, 2),
|
|
@@ -1102,7 +1102,7 @@ exports.authorizationDataToAuthorization = authorizationDataToAuthorization;
|
|
|
1102
1102
|
function assertMemoValid(value) {
|
|
1103
1103
|
if (value.length > constants_1.MAX_MEMO_LENGTH) {
|
|
1104
1104
|
throw new internal_1.PolymeshError({
|
|
1105
|
-
code:
|
|
1105
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1106
1106
|
message: 'Max memo length exceeded',
|
|
1107
1107
|
data: {
|
|
1108
1108
|
maxLength: constants_1.MAX_MEMO_LENGTH,
|
|
@@ -1125,71 +1125,71 @@ function u8ToTransferStatus(status) {
|
|
|
1125
1125
|
const code = status.toNumber();
|
|
1126
1126
|
switch (code) {
|
|
1127
1127
|
case 81: {
|
|
1128
|
-
return
|
|
1128
|
+
return types_2.TransferStatus.Success;
|
|
1129
1129
|
}
|
|
1130
1130
|
case 82: {
|
|
1131
|
-
return
|
|
1131
|
+
return types_2.TransferStatus.InsufficientBalance;
|
|
1132
1132
|
}
|
|
1133
1133
|
case 83: {
|
|
1134
|
-
return
|
|
1134
|
+
return types_2.TransferStatus.InsufficientAllowance;
|
|
1135
1135
|
}
|
|
1136
1136
|
case 84: {
|
|
1137
|
-
return
|
|
1137
|
+
return types_2.TransferStatus.TransfersHalted;
|
|
1138
1138
|
}
|
|
1139
1139
|
case 85: {
|
|
1140
|
-
return
|
|
1140
|
+
return types_2.TransferStatus.FundsLocked;
|
|
1141
1141
|
}
|
|
1142
1142
|
case 86: {
|
|
1143
|
-
return
|
|
1143
|
+
return types_2.TransferStatus.InvalidSenderAddress;
|
|
1144
1144
|
}
|
|
1145
1145
|
case 87: {
|
|
1146
|
-
return
|
|
1146
|
+
return types_2.TransferStatus.InvalidReceiverAddress;
|
|
1147
1147
|
}
|
|
1148
1148
|
case 88: {
|
|
1149
|
-
return
|
|
1149
|
+
return types_2.TransferStatus.InvalidOperator;
|
|
1150
1150
|
}
|
|
1151
1151
|
case 160: {
|
|
1152
|
-
return
|
|
1152
|
+
return types_2.TransferStatus.InvalidSenderIdentity;
|
|
1153
1153
|
}
|
|
1154
1154
|
case 161: {
|
|
1155
|
-
return
|
|
1155
|
+
return types_2.TransferStatus.InvalidReceiverIdentity;
|
|
1156
1156
|
}
|
|
1157
1157
|
case 162: {
|
|
1158
|
-
return
|
|
1158
|
+
return types_2.TransferStatus.ComplianceFailure;
|
|
1159
1159
|
}
|
|
1160
1160
|
case 163: {
|
|
1161
|
-
return
|
|
1161
|
+
return types_2.TransferStatus.SmartExtensionFailure;
|
|
1162
1162
|
}
|
|
1163
1163
|
case 164: {
|
|
1164
|
-
return
|
|
1164
|
+
return types_2.TransferStatus.InvalidGranularity;
|
|
1165
1165
|
}
|
|
1166
1166
|
case 165: {
|
|
1167
|
-
return
|
|
1167
|
+
return types_2.TransferStatus.VolumeLimitReached;
|
|
1168
1168
|
}
|
|
1169
1169
|
case 166: {
|
|
1170
|
-
return
|
|
1170
|
+
return types_2.TransferStatus.BlockedTransaction;
|
|
1171
1171
|
}
|
|
1172
1172
|
case 168: {
|
|
1173
|
-
return
|
|
1173
|
+
return types_2.TransferStatus.FundsLimitReached;
|
|
1174
1174
|
}
|
|
1175
1175
|
case 169: {
|
|
1176
|
-
return
|
|
1176
|
+
return types_2.TransferStatus.PortfolioFailure;
|
|
1177
1177
|
}
|
|
1178
1178
|
case 170: {
|
|
1179
|
-
return
|
|
1179
|
+
return types_2.TransferStatus.CustodianError;
|
|
1180
1180
|
}
|
|
1181
1181
|
case 171: {
|
|
1182
|
-
return
|
|
1182
|
+
return types_2.TransferStatus.ScopeClaimMissing;
|
|
1183
1183
|
}
|
|
1184
1184
|
case 172: {
|
|
1185
|
-
return
|
|
1185
|
+
return types_2.TransferStatus.TransferRestrictionFailure;
|
|
1186
1186
|
}
|
|
1187
1187
|
case 80: {
|
|
1188
|
-
return
|
|
1188
|
+
return types_2.TransferStatus.Failure;
|
|
1189
1189
|
}
|
|
1190
1190
|
default: {
|
|
1191
1191
|
throw new internal_1.PolymeshError({
|
|
1192
|
-
code:
|
|
1192
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
1193
1193
|
message: `Unsupported status code "${status.toString()}". Please report this issue to the Polymesh team`,
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
@@ -1203,41 +1203,63 @@ function internalAssetTypeToAssetType(type, context) {
|
|
|
1203
1203
|
return context.createType('PolymeshPrimitivesAssetAssetType', type);
|
|
1204
1204
|
}
|
|
1205
1205
|
exports.internalAssetTypeToAssetType = internalAssetTypeToAssetType;
|
|
1206
|
+
/**
|
|
1207
|
+
* @hidden
|
|
1208
|
+
*/
|
|
1209
|
+
function internalNftTypeToNftType(type, context) {
|
|
1210
|
+
return context.createType('PolymeshPrimitivesAssetNonFungibleType', type);
|
|
1211
|
+
}
|
|
1212
|
+
exports.internalNftTypeToNftType = internalNftTypeToNftType;
|
|
1206
1213
|
/**
|
|
1207
1214
|
* @hidden
|
|
1208
1215
|
*/
|
|
1209
1216
|
function assetTypeToKnownOrId(assetType) {
|
|
1217
|
+
if (assetType.isNonFungible) {
|
|
1218
|
+
const type = 'NonFungible';
|
|
1219
|
+
const rawNftType = assetType.asNonFungible;
|
|
1220
|
+
if (rawNftType.isDerivative) {
|
|
1221
|
+
return { type, value: types_2.KnownNftType.Derivative };
|
|
1222
|
+
}
|
|
1223
|
+
else if (rawNftType.isFixedIncome) {
|
|
1224
|
+
return { type, value: types_2.KnownNftType.FixedIncome };
|
|
1225
|
+
}
|
|
1226
|
+
else if (rawNftType.isInvoice) {
|
|
1227
|
+
return { type, value: types_2.KnownNftType.Invoice };
|
|
1228
|
+
}
|
|
1229
|
+
return { type, value: u32ToBigNumber(rawNftType.asCustom) };
|
|
1230
|
+
}
|
|
1231
|
+
const type = 'Fungible';
|
|
1210
1232
|
if (assetType.isEquityCommon) {
|
|
1211
|
-
return
|
|
1233
|
+
return { type, value: types_2.KnownAssetType.EquityCommon };
|
|
1212
1234
|
}
|
|
1213
1235
|
if (assetType.isEquityPreferred) {
|
|
1214
|
-
return
|
|
1236
|
+
return { type, value: types_2.KnownAssetType.EquityPreferred };
|
|
1215
1237
|
}
|
|
1216
1238
|
if (assetType.isCommodity) {
|
|
1217
|
-
return
|
|
1239
|
+
return { type, value: types_2.KnownAssetType.Commodity };
|
|
1218
1240
|
}
|
|
1219
1241
|
if (assetType.isFixedIncome) {
|
|
1220
|
-
return
|
|
1242
|
+
return { type, value: types_2.KnownAssetType.FixedIncome };
|
|
1221
1243
|
}
|
|
1222
1244
|
if (assetType.isReit) {
|
|
1223
|
-
return
|
|
1245
|
+
return { type, value: types_2.KnownAssetType.Reit };
|
|
1224
1246
|
}
|
|
1225
1247
|
if (assetType.isFund) {
|
|
1226
|
-
return
|
|
1248
|
+
return { type, value: types_2.KnownAssetType.Fund };
|
|
1227
1249
|
}
|
|
1228
1250
|
if (assetType.isRevenueShareAgreement) {
|
|
1229
|
-
return
|
|
1251
|
+
return { type, value: types_2.KnownAssetType.RevenueShareAgreement };
|
|
1230
1252
|
}
|
|
1231
1253
|
if (assetType.isStructuredProduct) {
|
|
1232
|
-
return
|
|
1254
|
+
return { type, value: types_2.KnownAssetType.StructuredProduct };
|
|
1233
1255
|
}
|
|
1234
1256
|
if (assetType.isDerivative) {
|
|
1235
|
-
return
|
|
1257
|
+
return { type, value: types_2.KnownAssetType.Derivative };
|
|
1236
1258
|
}
|
|
1237
1259
|
if (assetType.isStableCoin) {
|
|
1238
|
-
return
|
|
1260
|
+
return { type, value: types_2.KnownAssetType.StableCoin };
|
|
1239
1261
|
}
|
|
1240
|
-
return u32ToBigNumber(assetType.asCustom);
|
|
1262
|
+
return { type, value: u32ToBigNumber(assetType.asCustom) };
|
|
1241
1263
|
}
|
|
1242
1264
|
exports.assetTypeToKnownOrId = assetTypeToKnownOrId;
|
|
1243
1265
|
/**
|
|
@@ -1256,7 +1278,7 @@ function nameToAssetName(value, context) {
|
|
|
1256
1278
|
const nameMaxLength = u32ToBigNumber(assetNameMaxLength);
|
|
1257
1279
|
if (nameMaxLength.lt(value.length)) {
|
|
1258
1280
|
throw new internal_1.PolymeshError({
|
|
1259
|
-
code:
|
|
1281
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1260
1282
|
message: 'Asset name length exceeded',
|
|
1261
1283
|
data: {
|
|
1262
1284
|
maxLength: nameMaxLength,
|
|
@@ -1274,7 +1296,7 @@ function fundingRoundToAssetFundingRound(value, context) {
|
|
|
1274
1296
|
const nameMaxLength = u32ToBigNumber(fundingRoundNameMaxLength);
|
|
1275
1297
|
if (nameMaxLength.lt(value.length)) {
|
|
1276
1298
|
throw new internal_1.PolymeshError({
|
|
1277
|
-
code:
|
|
1299
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1278
1300
|
message: 'Asset funding round name length exceeded',
|
|
1279
1301
|
data: {
|
|
1280
1302
|
maxLength: nameMaxLength,
|
|
@@ -1394,19 +1416,19 @@ function securityIdentifierToAssetIdentifier(identifier, context) {
|
|
|
1394
1416
|
const { type, value } = identifier;
|
|
1395
1417
|
let error = false;
|
|
1396
1418
|
switch (type) {
|
|
1397
|
-
case
|
|
1419
|
+
case types_2.SecurityIdentifierType.Isin: {
|
|
1398
1420
|
if (!isIsinValid(value)) {
|
|
1399
1421
|
error = true;
|
|
1400
1422
|
}
|
|
1401
1423
|
break;
|
|
1402
1424
|
}
|
|
1403
|
-
case
|
|
1425
|
+
case types_2.SecurityIdentifierType.Lei: {
|
|
1404
1426
|
if (!isLeiValid(value)) {
|
|
1405
1427
|
error = true;
|
|
1406
1428
|
}
|
|
1407
1429
|
break;
|
|
1408
1430
|
}
|
|
1409
|
-
case
|
|
1431
|
+
case types_2.SecurityIdentifierType.Figi: {
|
|
1410
1432
|
if (!isFigiValid(value)) {
|
|
1411
1433
|
error = true;
|
|
1412
1434
|
}
|
|
@@ -1421,7 +1443,7 @@ function securityIdentifierToAssetIdentifier(identifier, context) {
|
|
|
1421
1443
|
}
|
|
1422
1444
|
if (error) {
|
|
1423
1445
|
throw new internal_1.PolymeshError({
|
|
1424
|
-
code:
|
|
1446
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1425
1447
|
message: `Invalid security identifier ${value} of type ${type}`,
|
|
1426
1448
|
});
|
|
1427
1449
|
}
|
|
@@ -1434,30 +1456,30 @@ exports.securityIdentifierToAssetIdentifier = securityIdentifierToAssetIdentifie
|
|
|
1434
1456
|
function assetIdentifierToSecurityIdentifier(identifier) {
|
|
1435
1457
|
if (identifier.isCusip) {
|
|
1436
1458
|
return {
|
|
1437
|
-
type:
|
|
1459
|
+
type: types_2.SecurityIdentifierType.Cusip,
|
|
1438
1460
|
value: (0, util_1.u8aToString)(identifier.asCusip),
|
|
1439
1461
|
};
|
|
1440
1462
|
}
|
|
1441
1463
|
if (identifier.isIsin) {
|
|
1442
1464
|
return {
|
|
1443
|
-
type:
|
|
1465
|
+
type: types_2.SecurityIdentifierType.Isin,
|
|
1444
1466
|
value: (0, util_1.u8aToString)(identifier.asIsin),
|
|
1445
1467
|
};
|
|
1446
1468
|
}
|
|
1447
1469
|
if (identifier.isCins) {
|
|
1448
1470
|
return {
|
|
1449
|
-
type:
|
|
1471
|
+
type: types_2.SecurityIdentifierType.Cins,
|
|
1450
1472
|
value: (0, util_1.u8aToString)(identifier.asCins),
|
|
1451
1473
|
};
|
|
1452
1474
|
}
|
|
1453
1475
|
if (identifier.isFigi) {
|
|
1454
1476
|
return {
|
|
1455
|
-
type:
|
|
1477
|
+
type: types_2.SecurityIdentifierType.Figi,
|
|
1456
1478
|
value: (0, util_1.u8aToString)(identifier.asFigi),
|
|
1457
1479
|
};
|
|
1458
1480
|
}
|
|
1459
1481
|
return {
|
|
1460
|
-
type:
|
|
1482
|
+
type: types_2.SecurityIdentifierType.Lei,
|
|
1461
1483
|
value: (0, util_1.u8aToString)(identifier.asLei),
|
|
1462
1484
|
};
|
|
1463
1485
|
}
|
|
@@ -1471,7 +1493,7 @@ function stringToDocumentHash(docHash, context) {
|
|
|
1471
1493
|
}
|
|
1472
1494
|
if (!(0, util_1.isHex)(docHash, -1, true)) {
|
|
1473
1495
|
throw new internal_1.PolymeshError({
|
|
1474
|
-
code:
|
|
1496
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1475
1497
|
message: 'Document hash must be a hexadecimal string prefixed by 0x',
|
|
1476
1498
|
});
|
|
1477
1499
|
}
|
|
@@ -1484,7 +1506,7 @@ function stringToDocumentHash(docHash, context) {
|
|
|
1484
1506
|
const type = hashTypes.find(({ maxLength: max }) => length <= max);
|
|
1485
1507
|
if (!type) {
|
|
1486
1508
|
throw new internal_1.PolymeshError({
|
|
1487
|
-
code:
|
|
1509
|
+
code: types_2.ErrorCode.ValidationError,
|
|
1488
1510
|
message: 'Document hash exceeds max length',
|
|
1489
1511
|
});
|
|
1490
1512
|
}
|
|
@@ -1577,7 +1599,7 @@ exports.cddStatusToBoolean = cddStatusToBoolean;
|
|
|
1577
1599
|
function canTransferResultToTransferStatus(canTransferResult) {
|
|
1578
1600
|
if (canTransferResult.isErr) {
|
|
1579
1601
|
throw new internal_1.PolymeshError({
|
|
1580
|
-
code:
|
|
1602
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
1581
1603
|
message: `Error while checking transfer validity: ${bytesToString(canTransferResult.asErr)}`,
|
|
1582
1604
|
});
|
|
1583
1605
|
}
|
|
@@ -1591,10 +1613,10 @@ function scopeToMeshScope(scope, context) {
|
|
|
1591
1613
|
const { type, value } = scope;
|
|
1592
1614
|
let scopeValue;
|
|
1593
1615
|
switch (type) {
|
|
1594
|
-
case
|
|
1616
|
+
case types_2.ScopeType.Ticker:
|
|
1595
1617
|
scopeValue = stringToTicker(value, context);
|
|
1596
1618
|
break;
|
|
1597
|
-
case
|
|
1619
|
+
case types_2.ScopeType.Identity:
|
|
1598
1620
|
scopeValue = stringToIdentityId(value, context);
|
|
1599
1621
|
break;
|
|
1600
1622
|
default:
|
|
@@ -1612,18 +1634,18 @@ exports.scopeToMeshScope = scopeToMeshScope;
|
|
|
1612
1634
|
function meshScopeToScope(scope) {
|
|
1613
1635
|
if (scope.isTicker) {
|
|
1614
1636
|
return {
|
|
1615
|
-
type:
|
|
1637
|
+
type: types_2.ScopeType.Ticker,
|
|
1616
1638
|
value: tickerToString(scope.asTicker),
|
|
1617
1639
|
};
|
|
1618
1640
|
}
|
|
1619
1641
|
if (scope.isIdentity) {
|
|
1620
1642
|
return {
|
|
1621
|
-
type:
|
|
1643
|
+
type: types_2.ScopeType.Identity,
|
|
1622
1644
|
value: identityIdToString(scope.asIdentity),
|
|
1623
1645
|
};
|
|
1624
1646
|
}
|
|
1625
1647
|
return {
|
|
1626
|
-
type:
|
|
1648
|
+
type: types_2.ScopeType.Custom,
|
|
1627
1649
|
value: (0, util_1.u8aToString)(scope.asCustom),
|
|
1628
1650
|
};
|
|
1629
1651
|
}
|
|
@@ -1648,15 +1670,20 @@ exports.cddIdToString = cddIdToString;
|
|
|
1648
1670
|
function claimToMeshClaim(claim, context) {
|
|
1649
1671
|
let value;
|
|
1650
1672
|
switch (claim.type) {
|
|
1651
|
-
case
|
|
1673
|
+
case types_2.ClaimType.CustomerDueDiligence: {
|
|
1652
1674
|
value = stringToCddId(claim.id, context);
|
|
1653
1675
|
break;
|
|
1654
1676
|
}
|
|
1655
|
-
case
|
|
1677
|
+
case types_2.ClaimType.Jurisdiction: {
|
|
1656
1678
|
const { code, scope } = claim;
|
|
1657
1679
|
value = (0, utils_3.tuple)(code, scopeToMeshScope(scope, context));
|
|
1658
1680
|
break;
|
|
1659
1681
|
}
|
|
1682
|
+
case types_2.ClaimType.Custom: {
|
|
1683
|
+
const { customClaimTypeId, scope } = claim;
|
|
1684
|
+
value = (0, utils_3.tuple)(bigNumberToU32(customClaimTypeId, context), scopeToMeshScope(scope, context));
|
|
1685
|
+
break;
|
|
1686
|
+
}
|
|
1660
1687
|
default: {
|
|
1661
1688
|
value = scopeToMeshScope(claim.scope, context);
|
|
1662
1689
|
}
|
|
@@ -1671,13 +1698,13 @@ function middlewareScopeToScope(scope) {
|
|
|
1671
1698
|
const { type, value } = scope;
|
|
1672
1699
|
switch (type) {
|
|
1673
1700
|
case typesV1_1.ClaimScopeTypeEnum.Ticker:
|
|
1674
|
-
return { type:
|
|
1701
|
+
return { type: types_2.ScopeType.Ticker, value: (0, internal_3.removePadding)(value) };
|
|
1675
1702
|
case typesV1_1.ClaimScopeTypeEnum.Identity:
|
|
1676
1703
|
case typesV1_1.ClaimScopeTypeEnum.Custom:
|
|
1677
1704
|
return { type: scope.type, value };
|
|
1678
1705
|
}
|
|
1679
1706
|
throw new internal_1.PolymeshError({
|
|
1680
|
-
code:
|
|
1707
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
1681
1708
|
message: 'Unsupported Scope Type. Please contact the Polymesh team',
|
|
1682
1709
|
data: {
|
|
1683
1710
|
scope,
|
|
@@ -1691,13 +1718,13 @@ exports.middlewareScopeToScope = middlewareScopeToScope;
|
|
|
1691
1718
|
function scopeToMiddlewareScope(scope, padTicker = true) {
|
|
1692
1719
|
const { type, value } = scope;
|
|
1693
1720
|
switch (type) {
|
|
1694
|
-
case
|
|
1721
|
+
case types_2.ScopeType.Ticker:
|
|
1695
1722
|
return {
|
|
1696
1723
|
type: typesV1_1.ClaimScopeTypeEnum.Ticker,
|
|
1697
1724
|
value: padTicker ? (0, lodash_1.padEnd)(value, 12, '\0') : value,
|
|
1698
1725
|
};
|
|
1699
|
-
case
|
|
1700
|
-
case
|
|
1726
|
+
case types_2.ScopeType.Identity:
|
|
1727
|
+
case types_2.ScopeType.Custom:
|
|
1701
1728
|
return { type: typesV1_1.ClaimScopeTypeEnum[scope.type], value };
|
|
1702
1729
|
}
|
|
1703
1730
|
}
|
|
@@ -1722,55 +1749,55 @@ function meshClaimToClaim(claim) {
|
|
|
1722
1749
|
if (claim.isJurisdiction) {
|
|
1723
1750
|
const [code, scope] = claim.asJurisdiction;
|
|
1724
1751
|
return {
|
|
1725
|
-
type:
|
|
1752
|
+
type: types_2.ClaimType.Jurisdiction,
|
|
1726
1753
|
code: (0, utils_2.meshCountryCodeToCountryCode)(code),
|
|
1727
1754
|
scope: meshScopeToScope(scope),
|
|
1728
1755
|
};
|
|
1729
1756
|
}
|
|
1730
1757
|
if (claim.isAccredited) {
|
|
1731
1758
|
return {
|
|
1732
|
-
type:
|
|
1759
|
+
type: types_2.ClaimType.Accredited,
|
|
1733
1760
|
scope: meshScopeToScope(claim.asAccredited),
|
|
1734
1761
|
};
|
|
1735
1762
|
}
|
|
1736
1763
|
if (claim.isAffiliate) {
|
|
1737
1764
|
return {
|
|
1738
|
-
type:
|
|
1765
|
+
type: types_2.ClaimType.Affiliate,
|
|
1739
1766
|
scope: meshScopeToScope(claim.asAffiliate),
|
|
1740
1767
|
};
|
|
1741
1768
|
}
|
|
1742
1769
|
if (claim.isBuyLockup) {
|
|
1743
1770
|
return {
|
|
1744
|
-
type:
|
|
1771
|
+
type: types_2.ClaimType.BuyLockup,
|
|
1745
1772
|
scope: meshScopeToScope(claim.asBuyLockup),
|
|
1746
1773
|
};
|
|
1747
1774
|
}
|
|
1748
1775
|
if (claim.isSellLockup) {
|
|
1749
1776
|
return {
|
|
1750
|
-
type:
|
|
1777
|
+
type: types_2.ClaimType.SellLockup,
|
|
1751
1778
|
scope: meshScopeToScope(claim.asSellLockup),
|
|
1752
1779
|
};
|
|
1753
1780
|
}
|
|
1754
1781
|
if (claim.isCustomerDueDiligence) {
|
|
1755
1782
|
return {
|
|
1756
|
-
type:
|
|
1783
|
+
type: types_2.ClaimType.CustomerDueDiligence,
|
|
1757
1784
|
id: cddIdToString(claim.asCustomerDueDiligence),
|
|
1758
1785
|
};
|
|
1759
1786
|
}
|
|
1760
1787
|
if (claim.isKnowYourCustomer) {
|
|
1761
1788
|
return {
|
|
1762
|
-
type:
|
|
1789
|
+
type: types_2.ClaimType.KnowYourCustomer,
|
|
1763
1790
|
scope: meshScopeToScope(claim.asKnowYourCustomer),
|
|
1764
1791
|
};
|
|
1765
1792
|
}
|
|
1766
1793
|
if (claim.isExempted) {
|
|
1767
1794
|
return {
|
|
1768
|
-
type:
|
|
1795
|
+
type: types_2.ClaimType.Exempted,
|
|
1769
1796
|
scope: meshScopeToScope(claim.asExempted),
|
|
1770
1797
|
};
|
|
1771
1798
|
}
|
|
1772
1799
|
return {
|
|
1773
|
-
type:
|
|
1800
|
+
type: types_2.ClaimType.Blocked,
|
|
1774
1801
|
scope: meshScopeToScope(claim.asBlocked),
|
|
1775
1802
|
};
|
|
1776
1803
|
}
|
|
@@ -1781,14 +1808,14 @@ exports.meshClaimToClaim = meshClaimToClaim;
|
|
|
1781
1808
|
function statsClaimToStatClaimInputType(claim) {
|
|
1782
1809
|
if (claim.isJurisdiction) {
|
|
1783
1810
|
return {
|
|
1784
|
-
type:
|
|
1811
|
+
type: types_2.ClaimType.Jurisdiction,
|
|
1785
1812
|
};
|
|
1786
1813
|
}
|
|
1787
1814
|
else if (claim.isAccredited) {
|
|
1788
|
-
return { type:
|
|
1815
|
+
return { type: types_2.ClaimType.Accredited };
|
|
1789
1816
|
}
|
|
1790
1817
|
else {
|
|
1791
|
-
return { type:
|
|
1818
|
+
return { type: types_2.ClaimType.Affiliate };
|
|
1792
1819
|
}
|
|
1793
1820
|
}
|
|
1794
1821
|
exports.statsClaimToStatClaimInputType = statsClaimToStatClaimInputType;
|
|
@@ -1806,30 +1833,30 @@ exports.stringToTargetIdentity = stringToTargetIdentity;
|
|
|
1806
1833
|
*/
|
|
1807
1834
|
function meshClaimTypeToClaimType(claimType) {
|
|
1808
1835
|
if (claimType.isJurisdiction) {
|
|
1809
|
-
return
|
|
1836
|
+
return types_2.ClaimType.Jurisdiction;
|
|
1810
1837
|
}
|
|
1811
1838
|
if (claimType.isAccredited) {
|
|
1812
|
-
return
|
|
1839
|
+
return types_2.ClaimType.Accredited;
|
|
1813
1840
|
}
|
|
1814
1841
|
if (claimType.isAffiliate) {
|
|
1815
|
-
return
|
|
1842
|
+
return types_2.ClaimType.Affiliate;
|
|
1816
1843
|
}
|
|
1817
1844
|
if (claimType.isBuyLockup) {
|
|
1818
|
-
return
|
|
1845
|
+
return types_2.ClaimType.BuyLockup;
|
|
1819
1846
|
}
|
|
1820
1847
|
if (claimType.isSellLockup) {
|
|
1821
|
-
return
|
|
1848
|
+
return types_2.ClaimType.SellLockup;
|
|
1822
1849
|
}
|
|
1823
1850
|
if (claimType.isCustomerDueDiligence) {
|
|
1824
|
-
return
|
|
1851
|
+
return types_2.ClaimType.CustomerDueDiligence;
|
|
1825
1852
|
}
|
|
1826
1853
|
if (claimType.isKnowYourCustomer) {
|
|
1827
|
-
return
|
|
1854
|
+
return types_2.ClaimType.KnowYourCustomer;
|
|
1828
1855
|
}
|
|
1829
1856
|
if (claimType.isExempted) {
|
|
1830
|
-
return
|
|
1857
|
+
return types_2.ClaimType.Exempted;
|
|
1831
1858
|
}
|
|
1832
|
-
return
|
|
1859
|
+
return types_2.ClaimType.Blocked;
|
|
1833
1860
|
}
|
|
1834
1861
|
exports.meshClaimTypeToClaimType = meshClaimTypeToClaimType;
|
|
1835
1862
|
/**
|
|
@@ -1890,7 +1917,7 @@ function requirementToComplianceRequirement(requirement, context) {
|
|
|
1890
1917
|
}
|
|
1891
1918
|
else {
|
|
1892
1919
|
// IsExternalAgent does not exist as a condition type in Polymesh, it's SDK sugar
|
|
1893
|
-
type =
|
|
1920
|
+
type = types_2.ConditionType.IsIdentity;
|
|
1894
1921
|
conditionContent = stringToTargetIdentity(null, context);
|
|
1895
1922
|
}
|
|
1896
1923
|
const { target, trustedClaimIssuers = [] } = condition;
|
|
@@ -1900,10 +1927,10 @@ function requirementToComplianceRequirement(requirement, context) {
|
|
|
1900
1927
|
},
|
|
1901
1928
|
issuers: trustedClaimIssuers.map(issuer => trustedClaimIssuerToTrustedIssuer(issuer, context)),
|
|
1902
1929
|
});
|
|
1903
|
-
if ([
|
|
1930
|
+
if ([types_2.ConditionTarget.Both, types_2.ConditionTarget.Receiver].includes(target)) {
|
|
1904
1931
|
receiverConditions.push(meshCondition);
|
|
1905
1932
|
}
|
|
1906
|
-
if ([
|
|
1933
|
+
if ([types_2.ConditionTarget.Both, types_2.ConditionTarget.Sender].includes(target)) {
|
|
1907
1934
|
senderConditions.push(meshCondition);
|
|
1908
1935
|
}
|
|
1909
1936
|
});
|
|
@@ -1920,19 +1947,19 @@ exports.requirementToComplianceRequirement = requirementToComplianceRequirement;
|
|
|
1920
1947
|
function meshConditionTypeToCondition(meshConditionType, context) {
|
|
1921
1948
|
if (meshConditionType.isIsPresent) {
|
|
1922
1949
|
return {
|
|
1923
|
-
type:
|
|
1950
|
+
type: types_2.ConditionType.IsPresent,
|
|
1924
1951
|
claim: meshClaimToClaim(meshConditionType.asIsPresent),
|
|
1925
1952
|
};
|
|
1926
1953
|
}
|
|
1927
1954
|
if (meshConditionType.isIsAbsent) {
|
|
1928
1955
|
return {
|
|
1929
|
-
type:
|
|
1956
|
+
type: types_2.ConditionType.IsAbsent,
|
|
1930
1957
|
claim: meshClaimToClaim(meshConditionType.asIsAbsent),
|
|
1931
1958
|
};
|
|
1932
1959
|
}
|
|
1933
1960
|
if (meshConditionType.isIsAnyOf) {
|
|
1934
1961
|
return {
|
|
1935
|
-
type:
|
|
1962
|
+
type: types_2.ConditionType.IsAnyOf,
|
|
1936
1963
|
claims: meshConditionType.asIsAnyOf.map(claim => meshClaimToClaim(claim)),
|
|
1937
1964
|
};
|
|
1938
1965
|
}
|
|
@@ -1940,16 +1967,16 @@ function meshConditionTypeToCondition(meshConditionType, context) {
|
|
|
1940
1967
|
const target = meshConditionType.asIsIdentity;
|
|
1941
1968
|
if (target.isExternalAgent) {
|
|
1942
1969
|
return {
|
|
1943
|
-
type:
|
|
1970
|
+
type: types_2.ConditionType.IsExternalAgent,
|
|
1944
1971
|
};
|
|
1945
1972
|
}
|
|
1946
1973
|
return {
|
|
1947
|
-
type:
|
|
1974
|
+
type: types_2.ConditionType.IsIdentity,
|
|
1948
1975
|
identity: new internal_1.Identity({ did: identityIdToString(target.asSpecific) }, context),
|
|
1949
1976
|
};
|
|
1950
1977
|
}
|
|
1951
1978
|
return {
|
|
1952
|
-
type:
|
|
1979
|
+
type: types_2.ConditionType.IsNoneOf,
|
|
1953
1980
|
claims: meshConditionType.asIsNoneOf.map(claim => meshClaimToClaim(claim)),
|
|
1954
1981
|
};
|
|
1955
1982
|
}
|
|
@@ -1962,7 +1989,7 @@ function complianceRequirementResultToRequirementCompliance(complianceRequiremen
|
|
|
1962
1989
|
const conditionCompliancesAreEqual = ({ condition: aCondition, complies: aComplies }, { condition: bCondition, complies: bComplies }) => (0, internal_3.conditionsAreEqual)(aCondition, bCondition) && aComplies === bComplies;
|
|
1963
1990
|
complianceRequirement.senderConditions.forEach(({ condition: { conditionType, issuers }, result }) => {
|
|
1964
1991
|
const newCondition = {
|
|
1965
|
-
condition: Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target:
|
|
1992
|
+
condition: Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target: types_2.ConditionTarget.Sender, trustedClaimIssuers: issuers.map(trustedIssuer => trustedIssuerToTrustedClaimIssuer(trustedIssuer, context)) }),
|
|
1966
1993
|
complies: boolToBoolean(result),
|
|
1967
1994
|
};
|
|
1968
1995
|
const existingCondition = conditions.find(condition => conditionCompliancesAreEqual(condition, newCondition));
|
|
@@ -1972,12 +1999,12 @@ function complianceRequirementResultToRequirementCompliance(complianceRequiremen
|
|
|
1972
1999
|
});
|
|
1973
2000
|
complianceRequirement.receiverConditions.forEach(({ condition: { conditionType, issuers }, result }) => {
|
|
1974
2001
|
const newCondition = {
|
|
1975
|
-
condition: Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target:
|
|
2002
|
+
condition: Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target: types_2.ConditionTarget.Receiver, trustedClaimIssuers: issuers.map(trustedIssuer => trustedIssuerToTrustedClaimIssuer(trustedIssuer, context)) }),
|
|
1976
2003
|
complies: boolToBoolean(result),
|
|
1977
2004
|
};
|
|
1978
2005
|
const existingCondition = conditions.find(condition => conditionCompliancesAreEqual(condition, newCondition));
|
|
1979
|
-
if (existingCondition && existingCondition.condition.target ===
|
|
1980
|
-
existingCondition.condition.target =
|
|
2006
|
+
if (existingCondition && existingCondition.condition.target === types_2.ConditionTarget.Sender) {
|
|
2007
|
+
existingCondition.condition.target = types_2.ConditionTarget.Both;
|
|
1981
2008
|
}
|
|
1982
2009
|
else {
|
|
1983
2010
|
conditions.push(newCondition);
|
|
@@ -1996,7 +2023,7 @@ exports.complianceRequirementResultToRequirementCompliance = complianceRequireme
|
|
|
1996
2023
|
function complianceRequirementToRequirement(complianceRequirement, context) {
|
|
1997
2024
|
const conditions = [];
|
|
1998
2025
|
complianceRequirement.senderConditions.forEach(({ conditionType, issuers }) => {
|
|
1999
|
-
const newCondition = Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target:
|
|
2026
|
+
const newCondition = Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target: types_2.ConditionTarget.Sender });
|
|
2000
2027
|
if (issuers.length) {
|
|
2001
2028
|
newCondition.trustedClaimIssuers = issuers.map(trustedIssuer => trustedIssuerToTrustedClaimIssuer(trustedIssuer, context));
|
|
2002
2029
|
}
|
|
@@ -2006,13 +2033,13 @@ function complianceRequirementToRequirement(complianceRequirement, context) {
|
|
|
2006
2033
|
}
|
|
2007
2034
|
});
|
|
2008
2035
|
complianceRequirement.receiverConditions.forEach(({ conditionType, issuers }) => {
|
|
2009
|
-
const newCondition = Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target:
|
|
2036
|
+
const newCondition = Object.assign(Object.assign({}, meshConditionTypeToCondition(conditionType, context)), { target: types_2.ConditionTarget.Receiver });
|
|
2010
2037
|
if (issuers.length) {
|
|
2011
2038
|
newCondition.trustedClaimIssuers = issuers.map(trustedIssuer => trustedIssuerToTrustedClaimIssuer(trustedIssuer, context));
|
|
2012
2039
|
}
|
|
2013
2040
|
const existingCondition = conditions.find(condition => (0, internal_3.conditionsAreEqual)(condition, newCondition));
|
|
2014
|
-
if (existingCondition && existingCondition.target ===
|
|
2015
|
-
existingCondition.target =
|
|
2041
|
+
if (existingCondition && existingCondition.target === types_2.ConditionTarget.Sender) {
|
|
2042
|
+
existingCondition.target = types_2.ConditionTarget.Both;
|
|
2016
2043
|
}
|
|
2017
2044
|
else {
|
|
2018
2045
|
conditions.push(newCondition);
|
|
@@ -2029,25 +2056,25 @@ exports.complianceRequirementToRequirement = complianceRequirementToRequirement;
|
|
|
2029
2056
|
*/
|
|
2030
2057
|
function txTagToProtocolOp(tag, context) {
|
|
2031
2058
|
const protocolOpTags = [
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2059
|
+
types_2.TxTags.asset.RegisterTicker,
|
|
2060
|
+
types_2.TxTags.asset.Issue,
|
|
2061
|
+
types_2.TxTags.asset.AddDocuments,
|
|
2062
|
+
types_2.TxTags.asset.CreateAsset,
|
|
2063
|
+
types_2.TxTags.capitalDistribution.Distribute,
|
|
2064
|
+
types_2.TxTags.checkpoint.CreateSchedule,
|
|
2065
|
+
types_2.TxTags.complianceManager.AddComplianceRequirement,
|
|
2066
|
+
types_2.TxTags.identity.CddRegisterDid,
|
|
2067
|
+
types_2.TxTags.identity.AddClaim,
|
|
2068
|
+
types_2.TxTags.identity.AddSecondaryKeysWithAuthorization,
|
|
2069
|
+
types_2.TxTags.pips.Propose,
|
|
2070
|
+
types_2.TxTags.corporateBallot.AttachBallot,
|
|
2071
|
+
types_2.TxTags.capitalDistribution.Distribute,
|
|
2045
2072
|
];
|
|
2046
2073
|
const [moduleName, extrinsicName] = tag.split('.');
|
|
2047
2074
|
const value = `${(0, util_1.stringUpperFirst)(moduleName)}${(0, util_1.stringUpperFirst)(extrinsicName)}`;
|
|
2048
2075
|
if (!(0, lodash_1.includes)(protocolOpTags, tag)) {
|
|
2049
2076
|
throw new internal_1.PolymeshError({
|
|
2050
|
-
code:
|
|
2077
|
+
code: types_2.ErrorCode.ValidationError,
|
|
2051
2078
|
message: `${value} does not match any PolymeshCommonUtilitiesProtocolFeeProtocolOp`,
|
|
2052
2079
|
});
|
|
2053
2080
|
}
|
|
@@ -2060,7 +2087,7 @@ exports.txTagToProtocolOp = txTagToProtocolOp;
|
|
|
2060
2087
|
function extrinsicIdentifierToTxTag(extrinsicIdentifier) {
|
|
2061
2088
|
const { moduleId, callId } = extrinsicIdentifier;
|
|
2062
2089
|
let moduleName;
|
|
2063
|
-
for (const txTagItem in
|
|
2090
|
+
for (const txTagItem in types_2.TxTags) {
|
|
2064
2091
|
if (txTagItem.toLowerCase() === moduleId) {
|
|
2065
2092
|
moduleName = txTagItem;
|
|
2066
2093
|
}
|
|
@@ -2159,15 +2186,15 @@ exports.secondaryAccountToMeshSecondaryKey = secondaryAccountToMeshSecondaryKey;
|
|
|
2159
2186
|
*/
|
|
2160
2187
|
function meshVenueTypeToVenueType(type) {
|
|
2161
2188
|
if (type.isOther) {
|
|
2162
|
-
return
|
|
2189
|
+
return types_2.VenueType.Other;
|
|
2163
2190
|
}
|
|
2164
2191
|
if (type.isDistribution) {
|
|
2165
|
-
return
|
|
2192
|
+
return types_2.VenueType.Distribution;
|
|
2166
2193
|
}
|
|
2167
2194
|
if (type.isSto) {
|
|
2168
|
-
return
|
|
2195
|
+
return types_2.VenueType.Sto;
|
|
2169
2196
|
}
|
|
2170
|
-
return
|
|
2197
|
+
return types_2.VenueType.Exchange;
|
|
2171
2198
|
}
|
|
2172
2199
|
exports.meshVenueTypeToVenueType = meshVenueTypeToVenueType;
|
|
2173
2200
|
/**
|
|
@@ -2201,12 +2228,12 @@ exports.meshInstructionStatusToInstructionStatus = meshInstructionStatusToInstru
|
|
|
2201
2228
|
*/
|
|
2202
2229
|
function meshAffirmationStatusToAffirmationStatus(status) {
|
|
2203
2230
|
if (status.isUnknown) {
|
|
2204
|
-
return
|
|
2231
|
+
return types_2.AffirmationStatus.Unknown;
|
|
2205
2232
|
}
|
|
2206
2233
|
if (status.isPending) {
|
|
2207
|
-
return
|
|
2234
|
+
return types_2.AffirmationStatus.Pending;
|
|
2208
2235
|
}
|
|
2209
|
-
return
|
|
2236
|
+
return types_2.AffirmationStatus.Affirmed;
|
|
2210
2237
|
}
|
|
2211
2238
|
exports.meshAffirmationStatusToAffirmationStatus = meshAffirmationStatusToAffirmationStatus;
|
|
2212
2239
|
/**
|
|
@@ -2214,15 +2241,15 @@ exports.meshAffirmationStatusToAffirmationStatus = meshAffirmationStatusToAffirm
|
|
|
2214
2241
|
*/
|
|
2215
2242
|
function meshSettlementTypeToEndCondition(type) {
|
|
2216
2243
|
if (type.isSettleOnBlock) {
|
|
2217
|
-
return { type:
|
|
2244
|
+
return { type: types_2.InstructionType.SettleOnBlock, endBlock: u32ToBigNumber(type.asSettleOnBlock) };
|
|
2218
2245
|
}
|
|
2219
2246
|
if (type.isSettleManual) {
|
|
2220
2247
|
return {
|
|
2221
|
-
type:
|
|
2248
|
+
type: types_2.InstructionType.SettleManual,
|
|
2222
2249
|
endAfterBlock: u32ToBigNumber(type.asSettleManual),
|
|
2223
2250
|
};
|
|
2224
2251
|
}
|
|
2225
|
-
return { type:
|
|
2252
|
+
return { type: types_2.InstructionType.SettleOnAffirmation };
|
|
2226
2253
|
}
|
|
2227
2254
|
exports.meshSettlementTypeToEndCondition = meshSettlementTypeToEndCondition;
|
|
2228
2255
|
/**
|
|
@@ -2232,16 +2259,16 @@ function endConditionToSettlementType(endCondition, context) {
|
|
|
2232
2259
|
let value;
|
|
2233
2260
|
const { type } = endCondition;
|
|
2234
2261
|
switch (type) {
|
|
2235
|
-
case
|
|
2236
|
-
value = { [
|
|
2262
|
+
case types_2.InstructionType.SettleOnBlock:
|
|
2263
|
+
value = { [types_2.InstructionType.SettleOnBlock]: bigNumberToU32(endCondition.endBlock, context) };
|
|
2237
2264
|
break;
|
|
2238
|
-
case
|
|
2265
|
+
case types_2.InstructionType.SettleManual:
|
|
2239
2266
|
value = {
|
|
2240
|
-
[
|
|
2267
|
+
[types_2.InstructionType.SettleManual]: bigNumberToU32(endCondition.endAfterBlock, context),
|
|
2241
2268
|
};
|
|
2242
2269
|
break;
|
|
2243
2270
|
default:
|
|
2244
|
-
value =
|
|
2271
|
+
value = types_2.InstructionType.SettleOnAffirmation;
|
|
2245
2272
|
}
|
|
2246
2273
|
return context.createType('PolymeshPrimitivesSettlementSettlementType', value);
|
|
2247
2274
|
}
|
|
@@ -2250,14 +2277,14 @@ exports.endConditionToSettlementType = endConditionToSettlementType;
|
|
|
2250
2277
|
* @hidden
|
|
2251
2278
|
*/
|
|
2252
2279
|
function middlewareClaimToClaimData(claim, context) {
|
|
2253
|
-
const { targetId, issuerId, issuanceDate, lastUpdateDate, expiry, type, jurisdiction, scope, cddId, } = claim;
|
|
2280
|
+
const { targetId, issuerId, issuanceDate, lastUpdateDate, expiry, type, jurisdiction, scope, cddId, customClaimTypeId, } = claim;
|
|
2254
2281
|
return {
|
|
2255
2282
|
target: new internal_1.Identity({ did: targetId }, context),
|
|
2256
2283
|
issuer: new internal_1.Identity({ did: issuerId }, context),
|
|
2257
2284
|
issuedAt: new Date(parseFloat(issuanceDate)),
|
|
2258
2285
|
lastUpdatedAt: new Date(parseFloat(lastUpdateDate)),
|
|
2259
2286
|
expiry: expiry ? new Date(parseFloat(expiry)) : null,
|
|
2260
|
-
claim: (0, internal_3.createClaim)(type, jurisdiction, scope, cddId),
|
|
2287
|
+
claim: (0, internal_3.createClaim)(type, jurisdiction, scope, cddId, customClaimTypeId ? new bignumber_js_1.default(customClaimTypeId) : undefined),
|
|
2261
2288
|
};
|
|
2262
2289
|
}
|
|
2263
2290
|
exports.middlewareClaimToClaimData = middlewareClaimToClaimData;
|
|
@@ -2275,7 +2302,17 @@ exports.toIdentityWithClaimsArray = toIdentityWithClaimsArray;
|
|
|
2275
2302
|
/**
|
|
2276
2303
|
* @hidden
|
|
2277
2304
|
*/
|
|
2278
|
-
function
|
|
2305
|
+
function nftToMeshNft(ticker, nfts, context) {
|
|
2306
|
+
return context.createType('PolymeshPrimitivesNftNfTs', {
|
|
2307
|
+
ticker: stringToTicker(ticker, context),
|
|
2308
|
+
ids: nfts.map(id => bigNumberToU64((0, internal_3.asNftId)(id), context)),
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
exports.nftToMeshNft = nftToMeshNft;
|
|
2312
|
+
/**
|
|
2313
|
+
* @hidden
|
|
2314
|
+
*/
|
|
2315
|
+
function fungibleMovementToPortfolioFund(portfolioItem, context) {
|
|
2279
2316
|
const { asset, amount, memo } = portfolioItem;
|
|
2280
2317
|
return context.createType('PolymeshPrimitivesPortfolioFund', {
|
|
2281
2318
|
description: {
|
|
@@ -2287,7 +2324,23 @@ function portfolioMovementToPortfolioFund(portfolioItem, context) {
|
|
|
2287
2324
|
memo: (0, internal_3.optionize)(stringToMemo)(memo, context),
|
|
2288
2325
|
});
|
|
2289
2326
|
}
|
|
2290
|
-
exports.
|
|
2327
|
+
exports.fungibleMovementToPortfolioFund = fungibleMovementToPortfolioFund;
|
|
2328
|
+
/**
|
|
2329
|
+
* @hidden
|
|
2330
|
+
*/
|
|
2331
|
+
function nftMovementToPortfolioFund(portfolioItem, context) {
|
|
2332
|
+
const { asset, nfts, memo } = portfolioItem;
|
|
2333
|
+
return context.createType('PolymeshPrimitivesPortfolioFund', {
|
|
2334
|
+
description: {
|
|
2335
|
+
NonFungible: {
|
|
2336
|
+
ticker: stringToTicker((0, internal_3.asTicker)(asset), context),
|
|
2337
|
+
ids: nfts.map(nftId => bigNumberToU64((0, internal_3.asNftId)(nftId), context)),
|
|
2338
|
+
},
|
|
2339
|
+
},
|
|
2340
|
+
memo: (0, internal_3.optionize)(stringToMemo)(memo, context),
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
exports.nftMovementToPortfolioFund = nftMovementToPortfolioFund;
|
|
2291
2344
|
/**
|
|
2292
2345
|
* @hidden
|
|
2293
2346
|
*/
|
|
@@ -2312,30 +2365,30 @@ function transferRestrictionToPolymeshTransferCondition(restriction, context) {
|
|
|
2312
2365
|
let restrictionType;
|
|
2313
2366
|
let restrictionValue;
|
|
2314
2367
|
const extractClaimValue = (claim) => {
|
|
2315
|
-
if (claim.type ===
|
|
2368
|
+
if (claim.type === types_2.ClaimType.Accredited) {
|
|
2316
2369
|
return booleanToBool(claim.accredited, context);
|
|
2317
2370
|
}
|
|
2318
|
-
else if (claim.type ===
|
|
2371
|
+
else if (claim.type === types_2.ClaimType.Affiliate) {
|
|
2319
2372
|
return booleanToBool(claim.affiliate, context);
|
|
2320
2373
|
}
|
|
2321
2374
|
else {
|
|
2322
2375
|
return (0, internal_3.optionize)(utils_2.countryCodeToMeshCountryCode)(claim.countryCode, context);
|
|
2323
2376
|
}
|
|
2324
2377
|
};
|
|
2325
|
-
if (type ===
|
|
2378
|
+
if (type === types_2.TransferRestrictionType.Count) {
|
|
2326
2379
|
restrictionType = 'MaxInvestorCount';
|
|
2327
2380
|
restrictionValue = bigNumberToU64(value, context);
|
|
2328
2381
|
}
|
|
2329
|
-
else if (type ===
|
|
2382
|
+
else if (type === types_2.TransferRestrictionType.Percentage) {
|
|
2330
2383
|
restrictionType = 'MaxInvestorOwnership';
|
|
2331
2384
|
restrictionValue = percentageToPermill(value, context);
|
|
2332
2385
|
}
|
|
2333
|
-
else if (type ===
|
|
2334
|
-
type ===
|
|
2386
|
+
else if (type === types_2.TransferRestrictionType.ClaimCount ||
|
|
2387
|
+
type === types_2.TransferRestrictionType.ClaimPercentage) {
|
|
2335
2388
|
let rawMin;
|
|
2336
2389
|
let rawMax;
|
|
2337
2390
|
const { min, max, claim, issuer } = value;
|
|
2338
|
-
if (type ===
|
|
2391
|
+
if (type === types_2.TransferRestrictionType.ClaimCount) {
|
|
2339
2392
|
restrictionType = 'ClaimCount';
|
|
2340
2393
|
rawMin = bigNumberToU64(min, context);
|
|
2341
2394
|
rawMax = (0, internal_3.optionize)(bigNumberToU64)(max, context);
|
|
@@ -2355,7 +2408,7 @@ function transferRestrictionToPolymeshTransferCondition(restriction, context) {
|
|
|
2355
2408
|
}
|
|
2356
2409
|
else {
|
|
2357
2410
|
throw new internal_1.PolymeshError({
|
|
2358
|
-
code:
|
|
2411
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
2359
2412
|
message: `Unexpected transfer restriction type: "${type}". Please report this to the Polymesh team`,
|
|
2360
2413
|
});
|
|
2361
2414
|
}
|
|
@@ -2378,31 +2431,31 @@ exports.identitiesToBtreeSet = identitiesToBtreeSet;
|
|
|
2378
2431
|
function transferConditionToTransferRestriction(transferCondition, context) {
|
|
2379
2432
|
if (transferCondition.isMaxInvestorCount) {
|
|
2380
2433
|
return {
|
|
2381
|
-
type:
|
|
2434
|
+
type: types_2.TransferRestrictionType.Count,
|
|
2382
2435
|
value: u64ToBigNumber(transferCondition.asMaxInvestorCount),
|
|
2383
2436
|
};
|
|
2384
2437
|
}
|
|
2385
2438
|
else if (transferCondition.isMaxInvestorOwnership) {
|
|
2386
2439
|
return {
|
|
2387
|
-
type:
|
|
2440
|
+
type: types_2.TransferRestrictionType.Percentage,
|
|
2388
2441
|
value: permillToBigNumber(transferCondition.asMaxInvestorOwnership),
|
|
2389
2442
|
};
|
|
2390
2443
|
}
|
|
2391
2444
|
else if (transferCondition.isClaimCount) {
|
|
2392
2445
|
return {
|
|
2393
|
-
type:
|
|
2446
|
+
type: types_2.TransferRestrictionType.ClaimCount,
|
|
2394
2447
|
value: claimCountToClaimCountRestrictionValue(transferCondition.asClaimCount, context),
|
|
2395
2448
|
};
|
|
2396
2449
|
}
|
|
2397
2450
|
else if (transferCondition.isClaimOwnership) {
|
|
2398
2451
|
return {
|
|
2399
|
-
type:
|
|
2452
|
+
type: types_2.TransferRestrictionType.ClaimPercentage,
|
|
2400
2453
|
value: claimPercentageToClaimPercentageRestrictionValue(transferCondition.asClaimOwnership, context),
|
|
2401
2454
|
};
|
|
2402
2455
|
}
|
|
2403
2456
|
else {
|
|
2404
2457
|
throw new internal_1.PolymeshError({
|
|
2405
|
-
code:
|
|
2458
|
+
code: types_2.ErrorCode.FatalError,
|
|
2406
2459
|
message: 'Unexpected transfer condition type',
|
|
2407
2460
|
});
|
|
2408
2461
|
}
|
|
@@ -2411,38 +2464,64 @@ exports.transferConditionToTransferRestriction = transferConditionToTransferRest
|
|
|
2411
2464
|
/**
|
|
2412
2465
|
* @hidden
|
|
2413
2466
|
*/
|
|
2414
|
-
function
|
|
2467
|
+
function nftDispatchErrorToTransferError(error, context) {
|
|
2468
|
+
const { DuplicatedNFTId: duplicateErr, InvalidNFTTransferComplianceFailure: complianceErr, InvalidNFTTransferFrozenAsset: frozenErr, InvalidNFTTransferInsufficientCount: insufficientErr, NFTNotFound: notFoundErr, InvalidNFTTransferNFTNotOwned: notOwnedErr, InvalidNFTTransferSamePortfolio: samePortfolioErr, } = context.polymeshApi.errors.nft;
|
|
2469
|
+
if (error.isModule) {
|
|
2470
|
+
const moduleErr = error.asModule;
|
|
2471
|
+
if ([notOwnedErr, notFoundErr, insufficientErr, duplicateErr].some(err => err.is(moduleErr))) {
|
|
2472
|
+
return types_2.TransferError.InsufficientPortfolioBalance;
|
|
2473
|
+
}
|
|
2474
|
+
else if (frozenErr.is(moduleErr)) {
|
|
2475
|
+
return types_2.TransferError.TransfersFrozen;
|
|
2476
|
+
}
|
|
2477
|
+
else if (complianceErr.is(moduleErr)) {
|
|
2478
|
+
return types_2.TransferError.ComplianceFailure;
|
|
2479
|
+
}
|
|
2480
|
+
else if (samePortfolioErr.is(moduleErr)) {
|
|
2481
|
+
return types_2.TransferError.SelfTransfer;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
throw new internal_1.PolymeshError({
|
|
2485
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
2486
|
+
message: 'Received unknown NFT can transfer status',
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
exports.nftDispatchErrorToTransferError = nftDispatchErrorToTransferError;
|
|
2490
|
+
/**
|
|
2491
|
+
* @hidden
|
|
2492
|
+
*/
|
|
2493
|
+
function granularCanTransferResultToTransferBreakdown(result, validateNftResult, context) {
|
|
2415
2494
|
const { invalid_granularity: invalidGranularity, self_transfer: selfTransfer, invalid_receiver_cdd: invalidReceiverCdd, invalid_sender_cdd: invalidSenderCdd, missing_scope_claim: missingScopeClaim, sender_insufficient_balance: insufficientBalance, asset_frozen: assetFrozen, portfolio_validity_result: { sender_portfolio_does_not_exist: senderPortfolioNotExists, receiver_portfolio_does_not_exist: receiverPortfolioNotExists, sender_insufficient_balance: senderInsufficientBalance, }, transfer_condition_result: transferConditionResult, compliance_result: complianceResult, result: finalResult, } = result;
|
|
2416
2495
|
const general = [];
|
|
2417
2496
|
if (boolToBoolean(invalidGranularity)) {
|
|
2418
|
-
general.push(
|
|
2497
|
+
general.push(types_2.TransferError.InvalidGranularity);
|
|
2419
2498
|
}
|
|
2420
2499
|
if (boolToBoolean(selfTransfer)) {
|
|
2421
|
-
general.push(
|
|
2500
|
+
general.push(types_2.TransferError.SelfTransfer);
|
|
2422
2501
|
}
|
|
2423
2502
|
if (boolToBoolean(invalidReceiverCdd)) {
|
|
2424
|
-
general.push(
|
|
2503
|
+
general.push(types_2.TransferError.InvalidReceiverCdd);
|
|
2425
2504
|
}
|
|
2426
2505
|
if (boolToBoolean(invalidSenderCdd)) {
|
|
2427
|
-
general.push(
|
|
2506
|
+
general.push(types_2.TransferError.InvalidSenderCdd);
|
|
2428
2507
|
}
|
|
2429
2508
|
if (boolToBoolean(missingScopeClaim)) {
|
|
2430
|
-
general.push(
|
|
2509
|
+
general.push(types_2.TransferError.ScopeClaimMissing);
|
|
2431
2510
|
}
|
|
2432
2511
|
if (boolToBoolean(insufficientBalance)) {
|
|
2433
|
-
general.push(
|
|
2512
|
+
general.push(types_2.TransferError.InsufficientBalance);
|
|
2434
2513
|
}
|
|
2435
2514
|
if (boolToBoolean(assetFrozen)) {
|
|
2436
|
-
general.push(
|
|
2515
|
+
general.push(types_2.TransferError.TransfersFrozen);
|
|
2437
2516
|
}
|
|
2438
2517
|
if (boolToBoolean(senderPortfolioNotExists)) {
|
|
2439
|
-
general.push(
|
|
2518
|
+
general.push(types_2.TransferError.InvalidSenderPortfolio);
|
|
2440
2519
|
}
|
|
2441
2520
|
if (boolToBoolean(receiverPortfolioNotExists)) {
|
|
2442
|
-
general.push(
|
|
2521
|
+
general.push(types_2.TransferError.InvalidReceiverPortfolio);
|
|
2443
2522
|
}
|
|
2444
2523
|
if (boolToBoolean(senderInsufficientBalance)) {
|
|
2445
|
-
general.push(
|
|
2524
|
+
general.push(types_2.TransferError.InsufficientPortfolioBalance);
|
|
2446
2525
|
}
|
|
2447
2526
|
const restrictions = transferConditionResult.map(({ condition, result: tmResult }) => {
|
|
2448
2527
|
return {
|
|
@@ -2450,14 +2529,23 @@ function granularCanTransferResultToTransferBreakdown(result, context) {
|
|
|
2450
2529
|
result: boolToBoolean(tmResult),
|
|
2451
2530
|
};
|
|
2452
2531
|
});
|
|
2532
|
+
let canTransfer = boolToBoolean(finalResult);
|
|
2533
|
+
if (canTransfer && (validateNftResult === null || validateNftResult === void 0 ? void 0 : validateNftResult.isErr)) {
|
|
2534
|
+
const transferError = nftDispatchErrorToTransferError(validateNftResult.asErr, context);
|
|
2535
|
+
general.push(transferError);
|
|
2536
|
+
canTransfer = false;
|
|
2537
|
+
}
|
|
2453
2538
|
return {
|
|
2454
2539
|
general,
|
|
2455
2540
|
compliance: assetComplianceResultToCompliance(complianceResult, context),
|
|
2456
2541
|
restrictions,
|
|
2457
|
-
result:
|
|
2542
|
+
result: canTransfer,
|
|
2458
2543
|
};
|
|
2459
2544
|
}
|
|
2460
2545
|
exports.granularCanTransferResultToTransferBreakdown = granularCanTransferResultToTransferBreakdown;
|
|
2546
|
+
/**
|
|
2547
|
+
* @hidden
|
|
2548
|
+
*/
|
|
2461
2549
|
/**
|
|
2462
2550
|
* @hidden
|
|
2463
2551
|
*/
|
|
@@ -2475,16 +2563,16 @@ exports.offeringTierToPriceTier = offeringTierToPriceTier;
|
|
|
2475
2563
|
function permissionsLikeToPermissions(permissionsLike, context) {
|
|
2476
2564
|
let assetPermissions = {
|
|
2477
2565
|
values: [],
|
|
2478
|
-
type:
|
|
2566
|
+
type: types_2.PermissionType.Include,
|
|
2479
2567
|
};
|
|
2480
2568
|
let transactionPermissions = {
|
|
2481
2569
|
values: [],
|
|
2482
|
-
type:
|
|
2570
|
+
type: types_2.PermissionType.Include,
|
|
2483
2571
|
};
|
|
2484
2572
|
let transactionGroupPermissions = [];
|
|
2485
2573
|
let portfolioPermissions = {
|
|
2486
2574
|
values: [],
|
|
2487
|
-
type:
|
|
2575
|
+
type: types_2.PermissionType.Include,
|
|
2488
2576
|
};
|
|
2489
2577
|
let transactions;
|
|
2490
2578
|
let transactionGroups;
|
|
@@ -2499,7 +2587,7 @@ function permissionsLikeToPermissions(permissionsLike, context) {
|
|
|
2499
2587
|
assetPermissions = null;
|
|
2500
2588
|
}
|
|
2501
2589
|
else if (assets) {
|
|
2502
|
-
assetPermissions = Object.assign(Object.assign({}, assets), { values: assets.values.map(ticker => typeof ticker !== 'string' ? ticker : new internal_1.
|
|
2590
|
+
assetPermissions = Object.assign(Object.assign({}, assets), { values: assets.values.map(ticker => typeof ticker !== 'string' ? ticker : new internal_1.FungibleAsset({ ticker }, context)) });
|
|
2503
2591
|
}
|
|
2504
2592
|
if (transactions !== undefined) {
|
|
2505
2593
|
transactionPermissions = transactions;
|
|
@@ -2569,29 +2657,29 @@ function fundraiserToOfferingDetails(fundraiser, name, context) {
|
|
|
2569
2657
|
const isStarted = now > start;
|
|
2570
2658
|
const isExpired = end && now > end;
|
|
2571
2659
|
const minInvestment = balanceToBigNumber(rawMinInvestment);
|
|
2572
|
-
let timing =
|
|
2573
|
-
let balance =
|
|
2574
|
-
let sale =
|
|
2660
|
+
let timing = types_2.OfferingTimingStatus.NotStarted;
|
|
2661
|
+
let balance = types_2.OfferingBalanceStatus.Available;
|
|
2662
|
+
let sale = types_2.OfferingSaleStatus.Live;
|
|
2575
2663
|
if (isExpired) {
|
|
2576
|
-
timing =
|
|
2664
|
+
timing = types_2.OfferingTimingStatus.Expired;
|
|
2577
2665
|
}
|
|
2578
2666
|
else if (isStarted) {
|
|
2579
|
-
timing =
|
|
2667
|
+
timing = types_2.OfferingTimingStatus.Started;
|
|
2580
2668
|
}
|
|
2581
2669
|
if (totalRemainingValue.isZero()) {
|
|
2582
|
-
balance =
|
|
2670
|
+
balance = types_2.OfferingBalanceStatus.SoldOut;
|
|
2583
2671
|
}
|
|
2584
2672
|
else if (totalRemainingValue.lt(minInvestment)) {
|
|
2585
|
-
balance =
|
|
2673
|
+
balance = types_2.OfferingBalanceStatus.Residual;
|
|
2586
2674
|
}
|
|
2587
2675
|
if (rawStatus.isClosedEarly) {
|
|
2588
|
-
sale =
|
|
2676
|
+
sale = types_2.OfferingSaleStatus.ClosedEarly;
|
|
2589
2677
|
}
|
|
2590
2678
|
else if (rawStatus.isClosed) {
|
|
2591
|
-
sale =
|
|
2679
|
+
sale = types_2.OfferingSaleStatus.Closed;
|
|
2592
2680
|
}
|
|
2593
2681
|
else if (rawStatus.isFrozen) {
|
|
2594
|
-
sale =
|
|
2682
|
+
sale = types_2.OfferingSaleStatus.Frozen;
|
|
2595
2683
|
}
|
|
2596
2684
|
return {
|
|
2597
2685
|
creator: new internal_1.Identity({ did: identityIdToString(creator) }, context),
|
|
@@ -2621,23 +2709,23 @@ function meshCorporateActionToCorporateActionParams(corporateAction, details, co
|
|
|
2621
2709
|
const { kind: rawKind, declDate, targets: { identities, treatment }, defaultWithholdingTax, withholdingTax, } = corporateAction;
|
|
2622
2710
|
let kind;
|
|
2623
2711
|
if (rawKind.isIssuerNotice) {
|
|
2624
|
-
kind =
|
|
2712
|
+
kind = types_2.CorporateActionKind.IssuerNotice;
|
|
2625
2713
|
}
|
|
2626
2714
|
else if (rawKind.isPredictableBenefit) {
|
|
2627
|
-
kind =
|
|
2715
|
+
kind = types_2.CorporateActionKind.PredictableBenefit;
|
|
2628
2716
|
}
|
|
2629
2717
|
else if (rawKind.isUnpredictableBenefit) {
|
|
2630
|
-
kind =
|
|
2718
|
+
kind = types_2.CorporateActionKind.UnpredictableBenefit;
|
|
2631
2719
|
}
|
|
2632
2720
|
else if (rawKind.isReorganization) {
|
|
2633
|
-
kind =
|
|
2721
|
+
kind = types_2.CorporateActionKind.Reorganization;
|
|
2634
2722
|
}
|
|
2635
2723
|
else {
|
|
2636
|
-
kind =
|
|
2724
|
+
kind = types_2.CorporateActionKind.Other;
|
|
2637
2725
|
}
|
|
2638
2726
|
const targets = {
|
|
2639
2727
|
identities: identities.map(identityId => new internal_1.Identity({ did: identityIdToString(identityId) }, context)),
|
|
2640
|
-
treatment: treatment.isExclude ?
|
|
2728
|
+
treatment: treatment.isExclude ? types_2.TargetTreatment.Exclude : types_2.TargetTreatment.Include,
|
|
2641
2729
|
};
|
|
2642
2730
|
const taxWithholdings = withholdingTax.map(([identityId, tax]) => ({
|
|
2643
2731
|
identity: new internal_1.Identity({ did: identityIdToString(identityId) }, context),
|
|
@@ -2686,7 +2774,7 @@ function targetIdentitiesToCorporateActionTargets(targetIdentities, context) {
|
|
|
2686
2774
|
const { identities, treatment } = targetIdentities;
|
|
2687
2775
|
return {
|
|
2688
2776
|
identities: identities.map(identity => new internal_1.Identity({ did: identityIdToString(identity) }, context)),
|
|
2689
|
-
treatment: treatment.isInclude ?
|
|
2777
|
+
treatment: treatment.isInclude ? types_2.TargetTreatment.Include : types_2.TargetTreatment.Exclude,
|
|
2690
2778
|
};
|
|
2691
2779
|
}
|
|
2692
2780
|
exports.targetIdentitiesToCorporateActionTargets = targetIdentitiesToCorporateActionTargets;
|
|
@@ -2699,7 +2787,7 @@ function targetsToTargetIdentities(targets, context) {
|
|
|
2699
2787
|
const maxTargets = u32ToBigNumber(maxTargetIds);
|
|
2700
2788
|
if (maxTargets.lt(targets.identities.length)) {
|
|
2701
2789
|
throw new internal_1.PolymeshError({
|
|
2702
|
-
code:
|
|
2790
|
+
code: types_2.ErrorCode.ValidationError,
|
|
2703
2791
|
message: 'Too many target Identities',
|
|
2704
2792
|
data: {
|
|
2705
2793
|
maxTargets,
|
|
@@ -2839,17 +2927,17 @@ function meshStatToStatType(rawStat) {
|
|
|
2839
2927
|
const { op: { type }, claimIssuer, } = rawStat;
|
|
2840
2928
|
if (claimIssuer.isNone) {
|
|
2841
2929
|
if (type === 'Count') {
|
|
2842
|
-
return
|
|
2930
|
+
return types_2.StatType.Count;
|
|
2843
2931
|
}
|
|
2844
2932
|
else {
|
|
2845
|
-
return
|
|
2933
|
+
return types_2.StatType.Balance;
|
|
2846
2934
|
}
|
|
2847
2935
|
}
|
|
2848
2936
|
if (type === 'Count') {
|
|
2849
|
-
return
|
|
2937
|
+
return types_2.StatType.ScopedCount;
|
|
2850
2938
|
}
|
|
2851
2939
|
else {
|
|
2852
|
-
return
|
|
2940
|
+
return types_2.StatType.ScopedBalance;
|
|
2853
2941
|
}
|
|
2854
2942
|
}
|
|
2855
2943
|
exports.meshStatToStatType = meshStatToStatType;
|
|
@@ -2857,20 +2945,20 @@ exports.meshStatToStatType = meshStatToStatType;
|
|
|
2857
2945
|
* @hidden
|
|
2858
2946
|
*/
|
|
2859
2947
|
function statTypeToStatOpType(type, context) {
|
|
2860
|
-
if (type ===
|
|
2861
|
-
return context.createType('PolymeshPrimitivesStatisticsStatOpType',
|
|
2948
|
+
if (type === types_2.StatType.Count || type === types_2.StatType.ScopedCount) {
|
|
2949
|
+
return context.createType('PolymeshPrimitivesStatisticsStatOpType', types_2.StatType.Count);
|
|
2862
2950
|
}
|
|
2863
|
-
return context.createType('PolymeshPrimitivesStatisticsStatOpType',
|
|
2951
|
+
return context.createType('PolymeshPrimitivesStatisticsStatOpType', types_2.StatType.Balance);
|
|
2864
2952
|
}
|
|
2865
2953
|
exports.statTypeToStatOpType = statTypeToStatOpType;
|
|
2866
2954
|
/**
|
|
2867
2955
|
* @hidden
|
|
2868
2956
|
*/
|
|
2869
2957
|
function transferRestrictionTypeToStatOpType(type, context) {
|
|
2870
|
-
if (type ===
|
|
2871
|
-
return context.createType('PolymeshPrimitivesStatisticsStatOpType',
|
|
2958
|
+
if (type === types_2.TransferRestrictionType.Count || type === types_2.TransferRestrictionType.ClaimCount) {
|
|
2959
|
+
return context.createType('PolymeshPrimitivesStatisticsStatOpType', types_2.StatType.Count);
|
|
2872
2960
|
}
|
|
2873
|
-
return context.createType('PolymeshPrimitivesStatisticsStatOpType',
|
|
2961
|
+
return context.createType('PolymeshPrimitivesStatisticsStatOpType', types_2.StatType.Balance);
|
|
2874
2962
|
}
|
|
2875
2963
|
exports.transferRestrictionTypeToStatOpType = transferRestrictionTypeToStatOpType;
|
|
2876
2964
|
/**
|
|
@@ -2945,7 +3033,7 @@ function sortTransferRestrictionByClaimValue(conditions) {
|
|
|
2945
3033
|
}
|
|
2946
3034
|
const aCode = (0, utils_2.meshCountryCodeToCountryCode)(aClaim.unwrap());
|
|
2947
3035
|
const bCode = (0, utils_2.meshCountryCodeToCountryCode)(bClaim.unwrap());
|
|
2948
|
-
const countryOrder = Object.values(
|
|
3036
|
+
const countryOrder = Object.values(types_2.CountryCode);
|
|
2949
3037
|
return countryOrder.indexOf(aCode) - countryOrder.indexOf(bCode);
|
|
2950
3038
|
});
|
|
2951
3039
|
}
|
|
@@ -2971,7 +3059,7 @@ exports.toExemptKey = toExemptKey;
|
|
|
2971
3059
|
function claimCountStatInputToStatUpdates(args, context) {
|
|
2972
3060
|
const { value, claimType: type } = args;
|
|
2973
3061
|
let updateArgs;
|
|
2974
|
-
if (type ===
|
|
3062
|
+
if (type === types_2.ClaimType.Jurisdiction) {
|
|
2975
3063
|
updateArgs = value.map(({ countryCode, count }) => {
|
|
2976
3064
|
const rawSecondKey = createStat2ndKey(type, context, countryCode);
|
|
2977
3065
|
return keyAndValueToStatUpdate(rawSecondKey, bigNumberToU128(count, context), context);
|
|
@@ -2979,7 +3067,7 @@ function claimCountStatInputToStatUpdates(args, context) {
|
|
|
2979
3067
|
}
|
|
2980
3068
|
else {
|
|
2981
3069
|
let yes, no;
|
|
2982
|
-
if (type ===
|
|
3070
|
+
if (type === types_2.ClaimType.Accredited) {
|
|
2983
3071
|
({ accredited: yes, nonAccredited: no } = value);
|
|
2984
3072
|
}
|
|
2985
3073
|
else {
|
|
@@ -3015,7 +3103,7 @@ function inputStatTypeToMeshStatType(input, context) {
|
|
|
3015
3103
|
const { type } = input;
|
|
3016
3104
|
const op = statTypeToStatOpType(type, context);
|
|
3017
3105
|
let claimIssuer;
|
|
3018
|
-
if (type ===
|
|
3106
|
+
if (type === types_2.StatType.ScopedCount || type === types_2.StatType.ScopedBalance) {
|
|
3019
3107
|
claimIssuer = claimIssuerToMeshClaimIssuer(input.claimIssuer, context);
|
|
3020
3108
|
}
|
|
3021
3109
|
return statisticsOpTypeToStatType({ op, claimIssuer }, context);
|
|
@@ -3029,19 +3117,19 @@ function meshProposalStatusToProposalStatus(status, expiry) {
|
|
|
3029
3117
|
switch (type) {
|
|
3030
3118
|
case 'ActiveOrExpired':
|
|
3031
3119
|
if (!expiry || expiry > new Date()) {
|
|
3032
|
-
return
|
|
3120
|
+
return types_2.ProposalStatus.Active;
|
|
3033
3121
|
}
|
|
3034
3122
|
else {
|
|
3035
|
-
return
|
|
3123
|
+
return types_2.ProposalStatus.Expired;
|
|
3036
3124
|
}
|
|
3037
3125
|
case 'Invalid':
|
|
3038
|
-
return
|
|
3126
|
+
return types_2.ProposalStatus.Invalid;
|
|
3039
3127
|
case 'ExecutionSuccessful':
|
|
3040
|
-
return
|
|
3128
|
+
return types_2.ProposalStatus.Successful;
|
|
3041
3129
|
case 'ExecutionFailed':
|
|
3042
|
-
return
|
|
3130
|
+
return types_2.ProposalStatus.Failed;
|
|
3043
3131
|
case 'Rejected':
|
|
3044
|
-
return
|
|
3132
|
+
return types_2.ProposalStatus.Rejected;
|
|
3045
3133
|
default:
|
|
3046
3134
|
throw new utils_1.UnreachableCaseError(type);
|
|
3047
3135
|
}
|
|
@@ -3056,7 +3144,7 @@ function metadataSpecToMeshMetadataSpec(specs, context) {
|
|
|
3056
3144
|
const metadataTypeDefMaxLength = u32ToBigNumber(assetMetadataTypeDefMaxLength);
|
|
3057
3145
|
if (typeDef && metadataTypeDefMaxLength.lt(typeDef.length)) {
|
|
3058
3146
|
throw new internal_1.PolymeshError({
|
|
3059
|
-
code:
|
|
3147
|
+
code: types_2.ErrorCode.ValidationError,
|
|
3060
3148
|
message: '"typeDef" length exceeded for given Asset Metadata spec',
|
|
3061
3149
|
data: {
|
|
3062
3150
|
maxLength: metadataTypeDefMaxLength,
|
|
@@ -3096,7 +3184,7 @@ exports.meshMetadataSpecToMetadataSpec = meshMetadataSpecToMetadataSpec;
|
|
|
3096
3184
|
function metadataToMeshMetadataKey(type, id, context) {
|
|
3097
3185
|
const rawId = bigNumberToU64(id, context);
|
|
3098
3186
|
let metadataKey;
|
|
3099
|
-
if (type ===
|
|
3187
|
+
if (type === types_2.MetadataType.Local) {
|
|
3100
3188
|
metadataKey = { Local: rawId };
|
|
3101
3189
|
}
|
|
3102
3190
|
else {
|
|
@@ -3114,17 +3202,17 @@ function meshMetadataValueToMetadataValue(rawValue, rawDetails) {
|
|
|
3114
3202
|
}
|
|
3115
3203
|
let metadataValue = {
|
|
3116
3204
|
value: bytesToString(rawValue.unwrap()),
|
|
3117
|
-
lockStatus:
|
|
3205
|
+
lockStatus: types_2.MetadataLockStatus.Unlocked,
|
|
3118
3206
|
expiry: null,
|
|
3119
3207
|
};
|
|
3120
3208
|
if (rawDetails.isSome) {
|
|
3121
3209
|
const { lockStatus: rawLockStatus, expire } = rawDetails.unwrap();
|
|
3122
3210
|
metadataValue = Object.assign(Object.assign({}, metadataValue), { expiry: (0, internal_3.optionize)(momentToDate)(expire.unwrapOr(null)) });
|
|
3123
3211
|
if (rawLockStatus.isLocked) {
|
|
3124
|
-
metadataValue = Object.assign(Object.assign({}, metadataValue), { lockStatus:
|
|
3212
|
+
metadataValue = Object.assign(Object.assign({}, metadataValue), { lockStatus: types_2.MetadataLockStatus.Locked });
|
|
3125
3213
|
}
|
|
3126
3214
|
if (rawLockStatus.isLockedUntil) {
|
|
3127
|
-
metadataValue = Object.assign(Object.assign({}, metadataValue), { lockStatus:
|
|
3215
|
+
metadataValue = Object.assign(Object.assign({}, metadataValue), { lockStatus: types_2.MetadataLockStatus.LockedUntil, lockedUntil: momentToDate(rawLockStatus.asLockedUntil) });
|
|
3128
3216
|
}
|
|
3129
3217
|
}
|
|
3130
3218
|
return metadataValue;
|
|
@@ -3138,7 +3226,7 @@ function metadataValueToMeshMetadataValue(value, context) {
|
|
|
3138
3226
|
const metadataValueMaxLength = u32ToBigNumber(assetMetadataValueMaxLength);
|
|
3139
3227
|
if (metadataValueMaxLength.lt(value.length)) {
|
|
3140
3228
|
throw new internal_1.PolymeshError({
|
|
3141
|
-
code:
|
|
3229
|
+
code: types_2.ErrorCode.ValidationError,
|
|
3142
3230
|
message: 'Asset Metadata value length exceeded',
|
|
3143
3231
|
data: {
|
|
3144
3232
|
maxLength: metadataValueMaxLength,
|
|
@@ -3154,11 +3242,11 @@ exports.metadataValueToMeshMetadataValue = metadataValueToMeshMetadataValue;
|
|
|
3154
3242
|
function metadataValueDetailToMeshMetadataValueDetail(details, context) {
|
|
3155
3243
|
const { lockStatus, expiry } = details;
|
|
3156
3244
|
let meshLockStatus;
|
|
3157
|
-
if (lockStatus ===
|
|
3245
|
+
if (lockStatus === types_2.MetadataLockStatus.LockedUntil) {
|
|
3158
3246
|
const { lockedUntil } = details;
|
|
3159
3247
|
if (lockedUntil < new Date()) {
|
|
3160
3248
|
throw new internal_1.PolymeshError({
|
|
3161
|
-
code:
|
|
3249
|
+
code: types_2.ErrorCode.UnmetPrerequisite,
|
|
3162
3250
|
message: 'Locked until date must be in the future',
|
|
3163
3251
|
});
|
|
3164
3252
|
}
|
|
@@ -3169,7 +3257,7 @@ function metadataValueDetailToMeshMetadataValueDetail(details, context) {
|
|
|
3169
3257
|
}
|
|
3170
3258
|
if (expiry && expiry < new Date()) {
|
|
3171
3259
|
throw new internal_1.PolymeshError({
|
|
3172
|
-
code:
|
|
3260
|
+
code: types_2.ErrorCode.UnmetPrerequisite,
|
|
3173
3261
|
message: 'Expiry date must be in the future',
|
|
3174
3262
|
});
|
|
3175
3263
|
}
|
|
@@ -3194,9 +3282,9 @@ function middlewareInstructionToHistoricInstruction(instruction, context) {
|
|
|
3194
3282
|
const { id: instructionId, status, settlementType, endBlock, tradeDate, valueDate, legs: { nodes: legs }, memo, createdBlock, venueId, } = instruction;
|
|
3195
3283
|
const { blockId, hash, datetime } = createdBlock;
|
|
3196
3284
|
let typeDetails;
|
|
3197
|
-
if (settlementType ===
|
|
3285
|
+
if (settlementType === types_2.InstructionType.SettleOnAffirmation) {
|
|
3198
3286
|
typeDetails = {
|
|
3199
|
-
type:
|
|
3287
|
+
type: types_2.InstructionType.SettleOnAffirmation,
|
|
3200
3288
|
};
|
|
3201
3289
|
}
|
|
3202
3290
|
else {
|
|
@@ -3208,7 +3296,7 @@ function middlewareInstructionToHistoricInstruction(instruction, context) {
|
|
|
3208
3296
|
return Object.assign(Object.assign({ id: new bignumber_js_1.default(instructionId), blockNumber: new bignumber_js_1.default(blockId), blockHash: hash, status,
|
|
3209
3297
|
tradeDate,
|
|
3210
3298
|
valueDate }, typeDetails), { memo: memo !== null && memo !== void 0 ? memo : null, venueId: new bignumber_js_1.default(venueId), createdAt: new Date(datetime), legs: legs.map(({ from, to, assetId, amount }) => ({
|
|
3211
|
-
asset: new internal_1.
|
|
3299
|
+
asset: new internal_1.FungibleAsset({ ticker: assetId }, context),
|
|
3212
3300
|
amount: new bignumber_js_1.default(amount).shiftedBy(-6),
|
|
3213
3301
|
from: middlewarePortfolioToPortfolio(from, context),
|
|
3214
3302
|
to: middlewarePortfolioToPortfolio(to, context),
|
|
@@ -3222,7 +3310,7 @@ exports.middlewareInstructionToHistoricInstruction = middlewareInstructionToHist
|
|
|
3222
3310
|
function expiryToMoment(expiry, context) {
|
|
3223
3311
|
if (expiry && expiry <= new Date()) {
|
|
3224
3312
|
throw new internal_1.PolymeshError({
|
|
3225
|
-
code:
|
|
3313
|
+
code: types_2.ErrorCode.UnmetPrerequisite,
|
|
3226
3314
|
message: 'Expiry date must be in the future',
|
|
3227
3315
|
});
|
|
3228
3316
|
}
|
|
@@ -3244,10 +3332,17 @@ exports.middlewarePortfolioDataToPortfolio = middlewarePortfolioDataToPortfolio;
|
|
|
3244
3332
|
/**
|
|
3245
3333
|
* @hidden
|
|
3246
3334
|
*/
|
|
3247
|
-
function
|
|
3248
|
-
return context.createType('PolymeshPrimitivesSettlementLeg', leg);
|
|
3335
|
+
function legToFungibleLeg(leg, context) {
|
|
3336
|
+
return context.createType('PolymeshPrimitivesSettlementLeg', { Fungible: leg });
|
|
3337
|
+
}
|
|
3338
|
+
exports.legToFungibleLeg = legToFungibleLeg;
|
|
3339
|
+
/**
|
|
3340
|
+
* @hidden
|
|
3341
|
+
*/
|
|
3342
|
+
function legToNonFungibleLeg(leg, context) {
|
|
3343
|
+
return context.createType('PolymeshPrimitivesSettlementLeg', { NonFungible: leg });
|
|
3249
3344
|
}
|
|
3250
|
-
exports.
|
|
3345
|
+
exports.legToNonFungibleLeg = legToNonFungibleLeg;
|
|
3251
3346
|
/**
|
|
3252
3347
|
* @hidden
|
|
3253
3348
|
*/
|
|
@@ -3256,16 +3351,16 @@ function middlewareAgentGroupDataToPermissionGroup(agentGroupData, context) {
|
|
|
3256
3351
|
const agentGroup = agentGroupData[asset];
|
|
3257
3352
|
let permissionGroupIdentifier;
|
|
3258
3353
|
if ('full' in agentGroup) {
|
|
3259
|
-
permissionGroupIdentifier =
|
|
3354
|
+
permissionGroupIdentifier = types_2.PermissionGroupType.Full;
|
|
3260
3355
|
}
|
|
3261
3356
|
else if ('exceptMeta' in agentGroup) {
|
|
3262
|
-
permissionGroupIdentifier =
|
|
3357
|
+
permissionGroupIdentifier = types_2.PermissionGroupType.ExceptMeta;
|
|
3263
3358
|
}
|
|
3264
3359
|
else if ('polymeshV1CAA' in agentGroup) {
|
|
3265
|
-
permissionGroupIdentifier =
|
|
3360
|
+
permissionGroupIdentifier = types_2.PermissionGroupType.PolymeshV1Caa;
|
|
3266
3361
|
}
|
|
3267
3362
|
else if ('polymeshV1PIA' in agentGroup) {
|
|
3268
|
-
permissionGroupIdentifier =
|
|
3363
|
+
permissionGroupIdentifier = types_2.PermissionGroupType.PolymeshV1Pia;
|
|
3269
3364
|
}
|
|
3270
3365
|
else {
|
|
3271
3366
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3282,11 +3377,11 @@ function middlewareExtrinsicPermissionsDataToTransactionPermissions(permissions)
|
|
|
3282
3377
|
let extrinsicType;
|
|
3283
3378
|
let pallets;
|
|
3284
3379
|
if ('these' in permissions) {
|
|
3285
|
-
extrinsicType =
|
|
3380
|
+
extrinsicType = types_2.PermissionType.Include;
|
|
3286
3381
|
pallets = permissions.these;
|
|
3287
3382
|
}
|
|
3288
3383
|
else if ('except' in permissions) {
|
|
3289
|
-
extrinsicType =
|
|
3384
|
+
extrinsicType = types_2.PermissionType.Exclude;
|
|
3290
3385
|
pallets = permissions.except;
|
|
3291
3386
|
}
|
|
3292
3387
|
let txValues = [];
|
|
@@ -3342,16 +3437,16 @@ function middlewarePermissionsDataToPermissions(permissionsData, context) {
|
|
|
3342
3437
|
let assetsType;
|
|
3343
3438
|
let assetsPermissions;
|
|
3344
3439
|
if ('these' in asset) {
|
|
3345
|
-
assetsType =
|
|
3440
|
+
assetsType = types_2.PermissionType.Include;
|
|
3346
3441
|
assetsPermissions = asset.these;
|
|
3347
3442
|
}
|
|
3348
3443
|
else if ('except' in asset) {
|
|
3349
|
-
assetsType =
|
|
3444
|
+
assetsType = types_2.PermissionType.Exclude;
|
|
3350
3445
|
assetsPermissions = asset.except;
|
|
3351
3446
|
}
|
|
3352
3447
|
if (assetsPermissions) {
|
|
3353
3448
|
assets = {
|
|
3354
|
-
values: [...assetsPermissions].map(ticker => new internal_1.
|
|
3449
|
+
values: [...assetsPermissions].map(ticker => new internal_1.FungibleAsset({ ticker: (0, exports.coerceHexToString)(ticker) }, context)),
|
|
3355
3450
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3356
3451
|
type: assetsType,
|
|
3357
3452
|
};
|
|
@@ -3360,11 +3455,11 @@ function middlewarePermissionsDataToPermissions(permissionsData, context) {
|
|
|
3360
3455
|
let portfoliosType;
|
|
3361
3456
|
let portfolioIds;
|
|
3362
3457
|
if ('these' in portfolio) {
|
|
3363
|
-
portfoliosType =
|
|
3458
|
+
portfoliosType = types_2.PermissionType.Include;
|
|
3364
3459
|
portfolioIds = portfolio.these;
|
|
3365
3460
|
}
|
|
3366
3461
|
else if ('except' in portfolio) {
|
|
3367
|
-
portfoliosType =
|
|
3462
|
+
portfoliosType = types_2.PermissionType.Exclude;
|
|
3368
3463
|
portfolioIds = portfolio.except;
|
|
3369
3464
|
}
|
|
3370
3465
|
if (portfolioIds) {
|
|
@@ -3388,41 +3483,41 @@ exports.middlewarePermissionsDataToPermissions = middlewarePermissionsDataToPerm
|
|
|
3388
3483
|
*/
|
|
3389
3484
|
function middlewareAuthorizationDataToAuthorization(context, type, data) {
|
|
3390
3485
|
switch (type) {
|
|
3391
|
-
case
|
|
3486
|
+
case types_1.AuthTypeEnum.AttestPrimaryKeyRotation:
|
|
3392
3487
|
return {
|
|
3393
|
-
type:
|
|
3488
|
+
type: types_2.AuthorizationType.AttestPrimaryKeyRotation,
|
|
3394
3489
|
value: new internal_1.Identity({ did: data }, context),
|
|
3395
3490
|
};
|
|
3396
|
-
case
|
|
3491
|
+
case types_1.AuthTypeEnum.RotatePrimaryKey: {
|
|
3397
3492
|
return {
|
|
3398
|
-
type:
|
|
3493
|
+
type: types_2.AuthorizationType.RotatePrimaryKey,
|
|
3399
3494
|
};
|
|
3400
3495
|
}
|
|
3401
|
-
case
|
|
3496
|
+
case types_1.AuthTypeEnum.RotatePrimaryKeyToSecondary: {
|
|
3402
3497
|
return {
|
|
3403
|
-
type:
|
|
3498
|
+
type: types_2.AuthorizationType.RotatePrimaryKeyToSecondary,
|
|
3404
3499
|
value: middlewarePermissionsDataToPermissions(data, context),
|
|
3405
3500
|
};
|
|
3406
3501
|
}
|
|
3407
|
-
case
|
|
3502
|
+
case types_1.AuthTypeEnum.JoinIdentity: {
|
|
3408
3503
|
return {
|
|
3409
|
-
type:
|
|
3504
|
+
type: types_2.AuthorizationType.JoinIdentity,
|
|
3410
3505
|
value: middlewarePermissionsDataToPermissions(data, context),
|
|
3411
3506
|
};
|
|
3412
3507
|
}
|
|
3413
|
-
case
|
|
3508
|
+
case types_1.AuthTypeEnum.AddMultiSigSigner:
|
|
3414
3509
|
return {
|
|
3415
|
-
type:
|
|
3510
|
+
type: types_2.AuthorizationType.AddMultiSigSigner,
|
|
3416
3511
|
value: data,
|
|
3417
3512
|
};
|
|
3418
|
-
case
|
|
3513
|
+
case types_1.AuthTypeEnum.AddRelayerPayingKey: {
|
|
3419
3514
|
// data is received in the format - {"5Ci94GCJC2JBM8U1PCkpHX6HkscWmucN9XwUrjb7o4TDgVns","5DZp1QYH49MKZhCtDupNaAeHp8xtqetuSzgf2p2cUWoxW3iu","1000000000"}
|
|
3420
3515
|
const [beneficiary, subsidizer, allowance] = data
|
|
3421
3516
|
.substring(1, data.length - 1)
|
|
3422
3517
|
.replace(/"/g, '')
|
|
3423
3518
|
.split(',');
|
|
3424
3519
|
return {
|
|
3425
|
-
type:
|
|
3520
|
+
type: types_2.AuthorizationType.AddRelayerPayingKey,
|
|
3426
3521
|
value: {
|
|
3427
3522
|
beneficiary: new internal_1.Account({ address: beneficiary }, context),
|
|
3428
3523
|
subsidizer: new internal_1.Account({ address: subsidizer }, context),
|
|
@@ -3430,33 +3525,33 @@ function middlewareAuthorizationDataToAuthorization(context, type, data) {
|
|
|
3430
3525
|
},
|
|
3431
3526
|
};
|
|
3432
3527
|
}
|
|
3433
|
-
case
|
|
3528
|
+
case types_1.AuthTypeEnum.BecomeAgent: {
|
|
3434
3529
|
const becomeAgentData = JSON.parse(data.replace(',', ':'));
|
|
3435
3530
|
return {
|
|
3436
|
-
type:
|
|
3531
|
+
type: types_2.AuthorizationType.BecomeAgent,
|
|
3437
3532
|
value: middlewareAgentGroupDataToPermissionGroup(becomeAgentData, context),
|
|
3438
3533
|
};
|
|
3439
3534
|
}
|
|
3440
|
-
case
|
|
3535
|
+
case types_1.AuthTypeEnum.TransferTicker:
|
|
3441
3536
|
return {
|
|
3442
|
-
type:
|
|
3537
|
+
type: types_2.AuthorizationType.TransferTicker,
|
|
3443
3538
|
value: (0, exports.coerceHexToString)(data),
|
|
3444
3539
|
};
|
|
3445
|
-
case
|
|
3540
|
+
case types_1.AuthTypeEnum.TransferAssetOwnership: {
|
|
3446
3541
|
return {
|
|
3447
|
-
type:
|
|
3542
|
+
type: types_2.AuthorizationType.TransferAssetOwnership,
|
|
3448
3543
|
value: (0, exports.coerceHexToString)(data),
|
|
3449
3544
|
};
|
|
3450
3545
|
}
|
|
3451
|
-
case
|
|
3546
|
+
case types_1.AuthTypeEnum.PortfolioCustody: {
|
|
3452
3547
|
return {
|
|
3453
|
-
type:
|
|
3548
|
+
type: types_2.AuthorizationType.PortfolioCustody,
|
|
3454
3549
|
value: middlewarePortfolioDataToPortfolio(JSON.parse(data), context),
|
|
3455
3550
|
};
|
|
3456
3551
|
}
|
|
3457
3552
|
}
|
|
3458
3553
|
throw new internal_1.PolymeshError({
|
|
3459
|
-
code:
|
|
3554
|
+
code: types_2.ErrorCode.UnexpectedError,
|
|
3460
3555
|
message: 'Unsupported Authorization Type. Please contact the Polymesh team',
|
|
3461
3556
|
data: {
|
|
3462
3557
|
auth: data,
|
|
@@ -3465,4 +3560,58 @@ function middlewareAuthorizationDataToAuthorization(context, type, data) {
|
|
|
3465
3560
|
}
|
|
3466
3561
|
exports.middlewareAuthorizationDataToAuthorization = middlewareAuthorizationDataToAuthorization;
|
|
3467
3562
|
/* eslint-enable @typescript-eslint/no-non-null-assertion */
|
|
3563
|
+
/**
|
|
3564
|
+
* @hidden
|
|
3565
|
+
*/
|
|
3566
|
+
function collectionKeysToMetadataKeys(keys, context) {
|
|
3567
|
+
const metadataKeys = keys.map(({ type, id }) => {
|
|
3568
|
+
return metadataToMeshMetadataKey(type, id, context);
|
|
3569
|
+
});
|
|
3570
|
+
return context.createType('Vec<PolymeshPrimitivesAssetMetadataAssetMetadataKey>', metadataKeys);
|
|
3571
|
+
}
|
|
3572
|
+
exports.collectionKeysToMetadataKeys = collectionKeysToMetadataKeys;
|
|
3573
|
+
/**
|
|
3574
|
+
* @hidden
|
|
3575
|
+
*/
|
|
3576
|
+
function meshMetadataKeyToMetadataKey(rawKey, ticker) {
|
|
3577
|
+
if (rawKey.isGlobal) {
|
|
3578
|
+
return { type: types_2.MetadataType.Global, id: u64ToBigNumber(rawKey.asGlobal) };
|
|
3579
|
+
}
|
|
3580
|
+
else {
|
|
3581
|
+
return { type: types_2.MetadataType.Local, id: u64ToBigNumber(rawKey.asLocal), ticker };
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
exports.meshMetadataKeyToMetadataKey = meshMetadataKeyToMetadataKey;
|
|
3585
|
+
/**
|
|
3586
|
+
* @hidden
|
|
3587
|
+
*/
|
|
3588
|
+
function meshNftToNftId(rawInfo) {
|
|
3589
|
+
const { ticker: rawTicker, ids: rawIds } = rawInfo;
|
|
3590
|
+
return {
|
|
3591
|
+
ticker: tickerToString(rawTicker),
|
|
3592
|
+
ids: rawIds.map(rawId => u64ToBigNumber(rawId)),
|
|
3593
|
+
};
|
|
3594
|
+
}
|
|
3595
|
+
exports.meshNftToNftId = meshNftToNftId;
|
|
3596
|
+
/**
|
|
3597
|
+
* @hidden
|
|
3598
|
+
*/
|
|
3599
|
+
function nftInputToNftMetadataAttribute(nftInfo, context) {
|
|
3600
|
+
const { type, id, value } = nftInfo;
|
|
3601
|
+
const rawKey = metadataToMeshMetadataKey(type, id, context);
|
|
3602
|
+
const rawValue = metadataValueToMeshMetadataValue(value, context);
|
|
3603
|
+
return context.createType('PolymeshPrimitivesNftNftMetadataAttribute', {
|
|
3604
|
+
key: rawKey,
|
|
3605
|
+
value: rawValue,
|
|
3606
|
+
});
|
|
3607
|
+
}
|
|
3608
|
+
exports.nftInputToNftMetadataAttribute = nftInputToNftMetadataAttribute;
|
|
3609
|
+
/**
|
|
3610
|
+
* @hidden
|
|
3611
|
+
*/
|
|
3612
|
+
function nftInputToNftMetadataVec(nftInfo, context) {
|
|
3613
|
+
const rawItems = nftInfo.map(item => nftInputToNftMetadataAttribute(item, context));
|
|
3614
|
+
return context.createType('Vec<PolymeshPrimitivesNftNftMetadataAttribute>', rawItems);
|
|
3615
|
+
}
|
|
3616
|
+
exports.nftInputToNftMetadataVec = nftInputToNftMetadataVec;
|
|
3468
3617
|
//# sourceMappingURL=conversion.js.map
|