@polymeshassociation/polymesh-sdk 14.0.0-beta.12 → 15.0.0-alpha.13
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 +9 -6
- package/{AccountManagement.d.ts → api/client/AccountManagement.d.ts} +8 -8
- package/api/client/AccountManagement.d.ts.map +1 -0
- package/{AccountManagement.js → api/client/AccountManagement.js} +3 -3
- package/api/client/AccountManagement.js.map +1 -0
- package/{Assets.d.ts → api/client/Assets.d.ts} +13 -2
- package/api/client/Assets.d.ts.map +1 -0
- package/{Assets.js → api/client/Assets.js} +18 -4
- package/api/client/Assets.js.map +1 -0
- package/{Claims.d.ts → api/client/Claims.d.ts} +3 -62
- package/api/client/Claims.d.ts.map +1 -0
- package/{Claims.js → api/client/Claims.js} +24 -152
- package/api/client/Claims.js.map +1 -0
- package/{Identities.d.ts → api/client/Identities.d.ts} +5 -5
- package/api/client/Identities.d.ts.map +1 -0
- package/{Identities.js → api/client/Identities.js} +2 -2
- package/api/client/Identities.js.map +1 -0
- package/{Network.d.ts → api/client/Network.d.ts} +3 -53
- package/api/client/Network.d.ts.map +1 -0
- package/{Network.js → api/client/Network.js} +5 -111
- package/api/client/Network.js.map +1 -0
- package/{Polymesh.d.ts → api/client/Polymesh.d.ts} +7 -9
- package/api/client/Polymesh.d.ts.map +1 -0
- package/{Polymesh.js → api/client/Polymesh.js} +37 -50
- package/api/client/Polymesh.js.map +1 -0
- package/{Settlements.d.ts → api/client/Settlements.d.ts} +4 -6
- package/api/client/Settlements.d.ts.map +1 -0
- package/{Settlements.js → api/client/Settlements.js} +10 -11
- package/api/client/Settlements.js.map +1 -0
- package/api/entities/Account.d.ts +2 -22
- package/api/entities/Account.d.ts.map +1 -1
- package/api/entities/Account.js +18 -69
- package/api/entities/Account.js.map +1 -1
- package/api/entities/Asset/Checkpoints/Schedules.d.ts +2 -2
- package/api/entities/Asset/Checkpoints/Schedules.d.ts.map +1 -1
- package/api/entities/Asset/Checkpoints/Schedules.js.map +1 -1
- package/api/entities/Asset/Checkpoints/index.d.ts.map +1 -1
- package/api/entities/Asset/Checkpoints/index.js.map +1 -1
- package/api/entities/Asset/Checkpoints/types.d.ts +1 -1
- package/api/entities/Asset/Checkpoints/types.d.ts.map +1 -1
- package/api/entities/Asset/Compliance/Requirements.d.ts +2 -2
- package/api/entities/Asset/Compliance/Requirements.d.ts.map +1 -1
- package/api/entities/Asset/Compliance/Requirements.js.map +1 -1
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts +2 -2
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts.map +1 -1
- package/api/entities/Asset/Compliance/TrustedClaimIssuers.js.map +1 -1
- package/api/entities/Asset/CorporateActions/Distributions.d.ts +2 -2
- package/api/entities/Asset/CorporateActions/Distributions.d.ts.map +1 -1
- package/api/entities/Asset/CorporateActions/Distributions.js.map +1 -1
- package/api/entities/Asset/CorporateActions/index.d.ts +5 -5
- package/api/entities/Asset/CorporateActions/index.d.ts.map +1 -1
- package/api/entities/Asset/CorporateActions/index.js +1 -1
- package/api/entities/Asset/CorporateActions/index.js.map +1 -1
- package/api/entities/Asset/Documents.d.ts +2 -2
- package/api/entities/Asset/Documents.d.ts.map +1 -1
- package/api/entities/Asset/Documents.js.map +1 -1
- package/api/entities/Asset/Offerings.d.ts +2 -2
- package/api/entities/Asset/Offerings.d.ts.map +1 -1
- package/api/entities/Asset/Offerings.js.map +1 -1
- package/api/entities/Asset/Permissions.d.ts +5 -5
- package/api/entities/Asset/Permissions.d.ts.map +1 -1
- package/api/entities/Asset/Permissions.js.map +1 -1
- package/api/entities/Asset/Settlements.d.ts.map +1 -1
- package/api/entities/Asset/Settlements.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Count.d.ts +2 -2
- package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Count.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts +2 -2
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts +3 -7
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js +10 -10
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +1 -1
- package/api/entities/Asset/index.d.ts +8 -23
- package/api/entities/Asset/index.d.ts.map +1 -1
- package/api/entities/Asset/index.js +7 -47
- package/api/entities/Asset/index.js.map +1 -1
- package/api/entities/AuthorizationRequest.d.ts +1 -2
- package/api/entities/AuthorizationRequest.d.ts.map +1 -1
- package/api/entities/Checkpoint.d.ts +1 -2
- package/api/entities/Checkpoint.d.ts.map +1 -1
- package/api/entities/Checkpoint.js.map +1 -1
- package/api/entities/CheckpointSchedule/index.d.ts +2 -3
- package/api/entities/CheckpointSchedule/index.d.ts.map +1 -1
- package/api/entities/CorporateAction.d.ts +2 -2
- package/api/entities/CorporateAction.d.ts.map +1 -1
- package/api/entities/CorporateAction.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 +2 -2
- package/api/entities/CorporateActionBase/index.js.map +1 -1
- package/api/entities/CustomPermissionGroup.d.ts +2 -2
- package/api/entities/CustomPermissionGroup.d.ts.map +1 -1
- package/api/entities/CustomPermissionGroup.js.map +1 -1
- package/api/entities/DefaultTrustedClaimIssuer.d.ts +0 -7
- package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -1
- package/api/entities/DefaultTrustedClaimIssuer.js +0 -17
- package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -1
- package/api/entities/DividendDistribution/index.d.ts +3 -20
- package/api/entities/DividendDistribution/index.d.ts.map +1 -1
- package/api/entities/DividendDistribution/index.js +0 -69
- package/api/entities/DividendDistribution/index.js.map +1 -1
- package/api/entities/Identity/AssetPermissions.d.ts +2 -30
- package/api/entities/Identity/AssetPermissions.d.ts.map +1 -1
- package/api/entities/Identity/AssetPermissions.js +3 -55
- package/api/entities/Identity/AssetPermissions.js.map +1 -1
- package/api/entities/Identity/index.d.ts +7 -20
- package/api/entities/Identity/index.d.ts.map +1 -1
- package/api/entities/Identity/index.js +43 -52
- package/api/entities/Identity/index.js.map +1 -1
- package/api/entities/Instruction/index.d.ts +0 -11
- package/api/entities/Instruction/index.d.ts.map +1 -1
- package/api/entities/Instruction/index.js +4 -54
- package/api/entities/Instruction/index.js.map +1 -1
- package/api/entities/NumberedPortfolio.d.ts +2 -9
- package/api/entities/NumberedPortfolio.d.ts.map +1 -1
- package/api/entities/NumberedPortfolio.js +1 -18
- package/api/entities/NumberedPortfolio.js.map +1 -1
- package/api/entities/Offering/index.d.ts +4 -18
- package/api/entities/Offering/index.d.ts.map +1 -1
- package/api/entities/Offering/index.js +1 -33
- package/api/entities/Offering/index.js.map +1 -1
- package/api/entities/Portfolio/index.d.ts +6 -19
- package/api/entities/Portfolio/index.d.ts.map +1 -1
- package/api/entities/Portfolio/index.js +5 -94
- package/api/entities/Portfolio/index.js.map +1 -1
- package/api/entities/Subsidy/index.d.ts +2 -2
- package/api/entities/Subsidy/index.d.ts.map +1 -1
- package/api/entities/Subsidy/index.js +9 -10
- package/api/entities/Subsidy/index.js.map +1 -1
- package/api/entities/TickerReservation/index.d.ts +5 -5
- package/api/entities/TickerReservation/index.d.ts.map +1 -1
- package/api/entities/TickerReservation/index.js +1 -1
- package/api/entities/TickerReservation/index.js.map +1 -1
- package/api/entities/Venue/index.d.ts +2 -2
- package/api/entities/Venue/index.d.ts.map +1 -1
- package/api/entities/Venue/index.js +2 -2
- package/api/entities/Venue/index.js.map +1 -1
- package/api/entities/common/namespaces/Authorizations.d.ts +2 -2
- package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -1
- package/api/entities/common/namespaces/Authorizations.js +1 -1
- package/api/entities/common/namespaces/Authorizations.js.map +1 -1
- package/api/procedures/addAssetRequirement.d.ts +1 -9
- package/api/procedures/addAssetRequirement.d.ts.map +1 -1
- package/api/procedures/addAssetRequirement.js +1 -1
- package/api/procedures/addAssetRequirement.js.map +1 -1
- package/api/procedures/addInstruction.d.ts +2 -34
- package/api/procedures/addInstruction.d.ts.map +1 -1
- package/api/procedures/addInstruction.js +9 -10
- package/api/procedures/addInstruction.js.map +1 -1
- package/api/procedures/addInvestorUniquenessClaim.d.ts +2 -9
- package/api/procedures/addInvestorUniquenessClaim.d.ts.map +1 -1
- package/api/procedures/addInvestorUniquenessClaim.js +1 -1
- package/api/procedures/addInvestorUniquenessClaim.js.map +1 -1
- package/api/procedures/addTransferRestriction.d.ts +14 -10
- package/api/procedures/addTransferRestriction.d.ts.map +1 -1
- package/api/procedures/addTransferRestriction.js +98 -30
- package/api/procedures/addTransferRestriction.js.map +1 -1
- package/api/procedures/claimClassicTicker.d.ts +1 -12
- package/api/procedures/claimClassicTicker.d.ts.map +1 -1
- package/api/procedures/claimClassicTicker.js +1 -1
- package/api/procedures/claimClassicTicker.js.map +1 -1
- package/api/procedures/configureDividendDistribution.d.ts +2 -34
- package/api/procedures/configureDividendDistribution.d.ts.map +1 -1
- package/api/procedures/configureDividendDistribution.js +31 -17
- package/api/procedures/configureDividendDistribution.js.map +1 -1
- package/api/procedures/controllerTransfer.d.ts +1 -12
- package/api/procedures/controllerTransfer.d.ts.map +1 -1
- package/api/procedures/controllerTransfer.js.map +1 -1
- package/api/procedures/createAsset.d.ts +3 -43
- package/api/procedures/createAsset.d.ts.map +1 -1
- package/api/procedures/createAsset.js +114 -54
- package/api/procedures/createAsset.js.map +1 -1
- package/api/procedures/createCheckpointSchedule.d.ts +1 -17
- package/api/procedures/createCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/createCheckpointSchedule.js.map +1 -1
- package/api/procedures/createGroup.d.ts +2 -14
- package/api/procedures/createGroup.d.ts.map +1 -1
- package/api/procedures/createGroup.js +4 -28
- package/api/procedures/createGroup.js.map +1 -1
- package/api/procedures/createPortfolio.js +1 -1
- package/api/procedures/createPortfolio.js.map +1 -1
- package/api/procedures/createVenue.d.ts +1 -5
- package/api/procedures/createVenue.d.ts.map +1 -1
- package/api/procedures/createVenue.js +1 -1
- package/api/procedures/createVenue.js.map +1 -1
- package/api/procedures/investInOffering.d.ts +2 -20
- package/api/procedures/investInOffering.d.ts.map +1 -1
- package/api/procedures/investInOffering.js.map +1 -1
- package/api/procedures/inviteAccount.d.ts +2 -7
- package/api/procedures/inviteAccount.d.ts.map +1 -1
- package/api/procedures/inviteAccount.js.map +1 -1
- package/api/procedures/inviteExternalAgent.d.ts +4 -16
- package/api/procedures/inviteExternalAgent.d.ts.map +1 -1
- package/api/procedures/inviteExternalAgent.js +33 -13
- package/api/procedures/inviteExternalAgent.js.map +1 -1
- package/api/procedures/launchOffering.d.ts +3 -46
- 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/leaveIdentity.d.ts.map +1 -1
- package/api/procedures/leaveIdentity.js +3 -4
- package/api/procedures/leaveIdentity.js.map +1 -1
- package/api/procedures/linkCaDocs.d.ts +1 -7
- package/api/procedures/linkCaDocs.d.ts.map +1 -1
- package/api/procedures/linkCaDocs.js.map +1 -1
- package/api/procedures/modifyAllowance.d.ts +2 -23
- package/api/procedures/modifyAllowance.d.ts.map +1 -1
- package/api/procedures/modifyAllowance.js +5 -6
- package/api/procedures/modifyAllowance.js.map +1 -1
- package/api/procedures/modifyAsset.d.ts +1 -25
- package/api/procedures/modifyAsset.d.ts.map +1 -1
- package/api/procedures/modifyAsset.js +4 -2
- package/api/procedures/modifyAsset.js.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +2 -11
- package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -1
- package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -1
- package/api/procedures/modifyCaCheckpoint.d.ts +1 -7
- package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -1
- package/api/procedures/modifyCaCheckpoint.js.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.d.ts +1 -15
- package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -1
- package/api/procedures/modifyCaDefaultConfig.js +8 -10
- package/api/procedures/modifyCaDefaultConfig.js.map +1 -1
- package/api/procedures/modifyClaims.d.ts +2 -25
- package/api/procedures/modifyClaims.d.ts.map +1 -1
- package/api/procedures/modifyClaims.js +8 -9
- package/api/procedures/modifyClaims.js.map +1 -1
- package/api/procedures/modifyComplianceRequirement.d.ts +1 -14
- package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -1
- package/api/procedures/modifyComplianceRequirement.js.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.d.ts +2 -11
- package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -1
- package/api/procedures/modifyCorporateActionsAgent.js.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.d.ts +2 -9
- package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.js +5 -6
- package/api/procedures/modifyInstructionAffirmation.js.map +1 -1
- package/api/procedures/modifyOfferingTimes.d.ts +1 -16
- package/api/procedures/modifyOfferingTimes.d.ts.map +1 -1
- package/api/procedures/modifyOfferingTimes.js.map +1 -1
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts +2 -11
- package/api/procedures/modifyPrimaryIssuanceAgent.d.ts.map +1 -1
- package/api/procedures/modifyPrimaryIssuanceAgent.js.map +1 -1
- package/api/procedures/modifySignerPermissions.d.ts +1 -10
- package/api/procedures/modifySignerPermissions.d.ts.map +1 -1
- package/api/procedures/modifySignerPermissions.js.map +1 -1
- package/api/procedures/modifyVenue.d.ts +1 -11
- package/api/procedures/modifyVenue.d.ts.map +1 -1
- package/api/procedures/modifyVenue.js +1 -1
- package/api/procedures/modifyVenue.js.map +1 -1
- package/api/procedures/moveFunds.d.ts +1 -12
- package/api/procedures/moveFunds.d.ts.map +1 -1
- package/api/procedures/moveFunds.js.map +1 -1
- package/api/procedures/payDividends.d.ts +2 -4
- package/api/procedures/payDividends.d.ts.map +1 -1
- package/api/procedures/payDividends.js.map +1 -1
- package/api/procedures/quitCustody.d.ts +2 -1
- package/api/procedures/quitCustody.d.ts.map +1 -1
- package/api/procedures/quitCustody.js.map +1 -1
- package/api/procedures/redeemTokens.d.ts +1 -4
- package/api/procedures/redeemTokens.d.ts.map +1 -1
- package/api/procedures/redeemTokens.js.map +1 -1
- package/api/procedures/registerIdentity.d.ts +2 -9
- package/api/procedures/registerIdentity.d.ts.map +1 -1
- package/api/procedures/registerIdentity.js.map +1 -1
- package/api/procedures/removeAssetRequirement.d.ts +1 -5
- package/api/procedures/removeAssetRequirement.d.ts.map +1 -1
- package/api/procedures/removeAssetRequirement.js.map +1 -1
- package/api/procedures/removeCheckpointSchedule.d.ts +2 -8
- package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -1
- package/api/procedures/removeCheckpointSchedule.js.map +1 -1
- package/api/procedures/removeCorporateAction.d.ts +2 -5
- package/api/procedures/removeCorporateAction.d.ts.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 -4
- package/api/procedures/removeExternalAgent.d.ts.map +1 -1
- package/api/procedures/removeExternalAgent.js.map +1 -1
- package/api/procedures/removeSecondaryAccounts.d.ts +1 -4
- package/api/procedures/removeSecondaryAccounts.d.ts.map +1 -1
- package/api/procedures/removeSecondaryAccounts.js +1 -1
- package/api/procedures/removeSecondaryAccounts.js.map +1 -1
- package/api/procedures/renamePortfolio.d.ts +1 -3
- package/api/procedures/renamePortfolio.d.ts.map +1 -1
- package/api/procedures/renamePortfolio.js +1 -1
- package/api/procedures/renamePortfolio.js.map +1 -1
- package/api/procedures/reserveTicker.d.ts +1 -7
- package/api/procedures/reserveTicker.d.ts.map +1 -1
- package/api/procedures/reserveTicker.js.map +1 -1
- package/api/procedures/setAssetDocuments.d.ts +1 -7
- package/api/procedures/setAssetDocuments.d.ts.map +1 -1
- package/api/procedures/setAssetDocuments.js.map +1 -1
- package/api/procedures/setAssetRequirements.d.ts +1 -8
- package/api/procedures/setAssetRequirements.d.ts.map +1 -1
- package/api/procedures/setAssetRequirements.js.map +1 -1
- package/api/procedures/setCustodian.d.ts +2 -5
- package/api/procedures/setCustodian.d.ts.map +1 -1
- package/api/procedures/setCustodian.js.map +1 -1
- package/api/procedures/setGroupPermissions.d.ts +1 -8
- package/api/procedures/setGroupPermissions.d.ts.map +1 -1
- package/api/procedures/setGroupPermissions.js.map +1 -1
- package/api/procedures/setPermissionGroup.d.ts +1 -26
- package/api/procedures/setPermissionGroup.d.ts.map +1 -1
- package/api/procedures/setPermissionGroup.js +42 -23
- package/api/procedures/setPermissionGroup.js.map +1 -1
- package/api/procedures/setTransferRestrictions.d.ts +7 -22
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +133 -122
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/subsidizeAccount.d.ts +2 -12
- package/api/procedures/subsidizeAccount.d.ts.map +1 -1
- package/api/procedures/subsidizeAccount.js.map +1 -1
- package/api/procedures/transferAssetOwnership.d.ts +2 -8
- package/api/procedures/transferAssetOwnership.d.ts.map +1 -1
- package/api/procedures/transferAssetOwnership.js.map +1 -1
- package/api/procedures/transferPolyx.d.ts +2 -16
- package/api/procedures/transferPolyx.d.ts.map +1 -1
- package/api/procedures/transferPolyx.js.map +1 -1
- package/api/procedures/transferTickerOwnership.d.ts +2 -8
- package/api/procedures/transferTickerOwnership.d.ts.map +1 -1
- package/api/procedures/transferTickerOwnership.js.map +1 -1
- package/api/procedures/types.d.ts +648 -0
- package/api/procedures/types.d.ts.map +1 -0
- package/api/procedures/types.js +27 -0
- package/api/procedures/types.js.map +1 -0
- package/api/procedures/utils.d.ts +21 -7
- package/api/procedures/utils.d.ts.map +1 -1
- package/api/procedures/utils.js +59 -28
- package/api/procedures/utils.js.map +1 -1
- package/api/procedures/waivePermissions.d.ts +1 -3
- package/api/procedures/waivePermissions.d.ts.map +1 -1
- package/api/procedures/waivePermissions.js.map +1 -1
- package/base/Context.d.ts +3 -69
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +44 -207
- package/base/Context.js.map +1 -1
- package/base/PolymeshTransactionBase.d.ts +4 -0
- package/base/PolymeshTransactionBase.d.ts.map +1 -1
- package/base/PolymeshTransactionBase.js +7 -0
- package/base/PolymeshTransactionBase.js.map +1 -1
- package/generated/types.d.ts +512 -0
- package/generated/types.d.ts.map +1 -1
- package/generated/types.js +557 -1
- package/generated/types.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/internal.d.ts +51 -52
- package/internal.d.ts.map +1 -1
- package/internal.js +3 -5
- package/internal.js.map +1 -1
- package/middleware/types.d.ts +1 -0
- package/middleware/types.d.ts.map +1 -1
- package/middleware/types.js +1 -0
- package/middleware/types.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-15.0.0-alpha.13.tgz +0 -0
- package/package.json +72 -14
- package/polkadot/asset/definitions.js +12 -12
- package/polkadot/asset/definitions.js.map +1 -1
- package/polkadot/augment-api-consts.d.ts +127 -43
- package/polkadot/augment-api-consts.d.ts.map +1 -1
- package/polkadot/augment-api-errors.d.ts +286 -16
- package/polkadot/augment-api-errors.d.ts.map +1 -1
- package/polkadot/augment-api-events.d.ts +1102 -465
- package/polkadot/augment-api-events.d.ts.map +1 -1
- package/polkadot/augment-api-query.d.ts +746 -545
- package/polkadot/augment-api-query.d.ts.map +1 -1
- package/polkadot/augment-api-rpc.d.ts +50 -17
- package/polkadot/augment-api-rpc.d.ts.map +1 -1
- package/polkadot/augment-api-tx.d.ts +1445 -1003
- package/polkadot/augment-api-tx.d.ts.map +1 -1
- package/polkadot/augment-api.d.ts +0 -1
- package/polkadot/augment-api.d.ts.map +1 -1
- package/polkadot/augment-api.js +0 -1
- package/polkadot/augment-api.js.map +1 -1
- package/polkadot/augment-types.d.ts +213 -2220
- package/polkadot/augment-types.d.ts.map +1 -1
- package/polkadot/compliance/definitions.js +2 -2
- package/polkadot/compliance/definitions.js.map +1 -1
- package/polkadot/identity/definitions.js +4 -4
- package/polkadot/identity/definitions.js.map +1 -1
- package/polkadot/lookup.d.ts +4439 -0
- package/polkadot/lookup.d.ts.map +1 -0
- package/polkadot/lookup.js +5125 -0
- package/polkadot/lookup.js.map +1 -0
- package/polkadot/polymesh/definitions.d.ts +106 -36
- package/polkadot/polymesh/definitions.d.ts.map +1 -1
- package/polkadot/polymesh/definitions.js +111 -41
- package/polkadot/polymesh/definitions.js.map +1 -1
- package/polkadot/polymesh/types.d.ts +216 -61
- package/polkadot/polymesh/types.d.ts.map +1 -1
- package/polkadot/registry.d.ts +385 -0
- package/polkadot/registry.d.ts.map +1 -0
- package/polkadot/registry.js +5 -0
- package/polkadot/registry.js.map +1 -0
- package/polkadot/schema.d.ts +106 -36
- package/polkadot/schema.d.ts.map +1 -1
- package/polkadot/schema.js +129 -59
- package/polkadot/schema.js.map +1 -1
- package/polkadot/types-lookup.d.ts +5578 -0
- package/polkadot/types-lookup.d.ts.map +1 -0
- package/polkadot/types-lookup.js +4 -0
- package/polkadot/types-lookup.js.map +1 -0
- package/polkadot/types.d.ts +0 -464
- package/polkadot/types.d.ts.map +1 -1
- package/polkadot/types.js +0 -505
- package/polkadot/types.js.map +1 -1
- package/types/index.d.ts +31 -36
- package/types/index.d.ts.map +1 -1
- package/types/index.js +11 -7
- package/types/index.js.map +1 -1
- package/types/internal.d.ts +13 -28
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js +6 -19
- package/types/internal.js.map +1 -1
- package/types/utils/index.d.ts +11 -10
- package/types/utils/index.d.ts.map +1 -1
- package/types/utils/index.js +2 -0
- package/types/utils/index.js.map +1 -1
- package/utils/constants.d.ts +13 -2
- package/utils/constants.d.ts.map +1 -1
- package/utils/constants.js +14 -3
- package/utils/constants.js.map +1 -1
- package/utils/conversion.d.ts +112 -94
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +572 -525
- package/utils/conversion.js.map +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +2 -1
- package/utils/index.js.map +1 -1
- package/utils/internal.d.ts +4 -4
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +90 -15
- package/utils/internal.js.map +1 -1
- package/utils/typeguards.d.ts.map +1 -1
- package/utils/typeguards.js +1 -0
- package/utils/typeguards.js.map +1 -1
- package/AccountManagement.d.ts.map +0 -1
- package/AccountManagement.js.map +0 -1
- package/Assets.d.ts.map +0 -1
- package/Assets.js.map +0 -1
- package/Claims.d.ts.map +0 -1
- package/Claims.js.map +0 -1
- package/Identities.d.ts.map +0 -1
- package/Identities.js.map +0 -1
- package/Network.d.ts.map +0 -1
- package/Network.js.map +0 -1
- package/Polymesh.d.ts.map +0 -1
- package/Polymesh.js.map +0 -1
- package/Settlements.d.ts.map +0 -1
- package/Settlements.js.map +0 -1
- package/api/procedures/initiateCorporateAction.d.ts +0 -60
- package/api/procedures/initiateCorporateAction.d.ts.map +0 -1
- package/api/procedures/initiateCorporateAction.js +0 -107
- package/api/procedures/initiateCorporateAction.js.map +0 -1
- package/middleware/queriesV2.d.ts +0 -143
- package/middleware/queriesV2.d.ts.map +0 -1
- package/middleware/queriesV2.js +0 -798
- package/middleware/queriesV2.js.map +0 -1
- package/middleware/typesV2.d.ts +0 -25495
- package/middleware/typesV2.d.ts.map +0 -1
- package/middleware/typesV2.js +0 -2013
- package/middleware/typesV2.js.map +0 -1
- package/npm-package/polymeshassociation-polymesh-sdk-14.0.0-beta.12.tgz +0 -0
|
@@ -8,17 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
13
|
};
|
|
@@ -36,7 +25,7 @@ const internal_2 = require("../../utils/internal");
|
|
|
36
25
|
const createDividendDistributionResolver = (context) => (receipt) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
26
|
const [{ data }] = (0, internal_2.filterEventRecords)(receipt, 'capitalDistribution', 'Created');
|
|
38
27
|
const [, caId, distribution] = data;
|
|
39
|
-
const { ticker,
|
|
28
|
+
const { ticker, localId } = caId;
|
|
40
29
|
const { corporateAction } = context.polymeshApi.query;
|
|
41
30
|
const [corpAction, details] = yield Promise.all([
|
|
42
31
|
corporateAction.corporateActions(ticker, localId),
|
|
@@ -50,8 +39,8 @@ exports.createDividendDistributionResolver = createDividendDistributionResolver;
|
|
|
50
39
|
*/
|
|
51
40
|
function prepareConfigureDividendDistribution(args) {
|
|
52
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const { context: { polymeshApi: { tx }, }, context, storage: { portfolio }, } = this;
|
|
54
|
-
const { ticker, originPortfolio = null, currency, perShare, maxAmount, paymentDate, expiryDate = null, checkpoint
|
|
42
|
+
const { context: { polymeshApi: { tx, query }, }, context, storage: { portfolio }, } = this;
|
|
43
|
+
const { ticker, originPortfolio = null, currency, perShare, maxAmount, paymentDate, expiryDate = null, checkpoint, targets = null, description, declarationDate = new Date(), defaultTaxWithholding = null, taxWithholdings = null, } = args;
|
|
55
44
|
if (currency === ticker) {
|
|
56
45
|
throw new internal_1.PolymeshError({
|
|
57
46
|
code: types_1.ErrorCode.ValidationError,
|
|
@@ -70,6 +59,23 @@ function prepareConfigureDividendDistribution(args) {
|
|
|
70
59
|
message: 'Expiry date must be after payment date',
|
|
71
60
|
});
|
|
72
61
|
}
|
|
62
|
+
if (declarationDate > new Date()) {
|
|
63
|
+
throw new internal_1.PolymeshError({
|
|
64
|
+
code: types_1.ErrorCode.ValidationError,
|
|
65
|
+
message: 'Declaration date must be in the past',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const rawMaxDetailsLength = yield query.corporateAction.maxDetailsLength();
|
|
69
|
+
const maxDetailsLength = (0, conversion_1.u32ToBigNumber)(rawMaxDetailsLength);
|
|
70
|
+
if (maxDetailsLength.lt(description.length)) {
|
|
71
|
+
throw new internal_1.PolymeshError({
|
|
72
|
+
code: types_1.ErrorCode.ValidationError,
|
|
73
|
+
message: 'Description too long',
|
|
74
|
+
data: {
|
|
75
|
+
maxLength: maxDetailsLength.toNumber(),
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
73
79
|
const checkpointValue = yield (0, internal_2.getCheckpointValue)(checkpoint, ticker, context);
|
|
74
80
|
if (!(checkpointValue instanceof internal_1.Checkpoint)) {
|
|
75
81
|
yield (0, utils_1.assertDistributionDatesValid)(checkpointValue, paymentDate, expiryDate);
|
|
@@ -93,7 +99,6 @@ function prepareConfigureDividendDistribution(args) {
|
|
|
93
99
|
},
|
|
94
100
|
});
|
|
95
101
|
}
|
|
96
|
-
const caId = yield this.addProcedure((0, internal_1.initiateCorporateAction)(), Object.assign({ ticker, kind: types_1.CorporateActionKind.UnpredictableBenefit, checkpoint: checkpointValue }, corporateActionArgs));
|
|
97
102
|
const rawPortfolioNumber = originPortfolio &&
|
|
98
103
|
(0, internal_2.optionize)(conversion_1.bigNumberToU64)(originPortfolio instanceof bignumber_js_1.default ? originPortfolio : originPortfolio.id, context);
|
|
99
104
|
const rawCurrency = (0, conversion_1.stringToTicker)(currency, context);
|
|
@@ -102,10 +107,19 @@ function prepareConfigureDividendDistribution(args) {
|
|
|
102
107
|
const rawPaymentAt = (0, conversion_1.dateToMoment)(paymentDate, context);
|
|
103
108
|
const rawExpiresAt = (0, internal_2.optionize)(conversion_1.dateToMoment)(expiryDate, context);
|
|
104
109
|
const [dividendDistribution] = this.addTransaction({
|
|
105
|
-
transaction: tx.
|
|
110
|
+
transaction: tx.corporateAction.initiateCorporateActionAndDistribute,
|
|
106
111
|
resolvers: [(0, exports.createDividendDistributionResolver)(context)],
|
|
107
112
|
args: [
|
|
108
|
-
|
|
113
|
+
(0, conversion_1.corporateActionParamsToMeshCorporateActionArgs)({
|
|
114
|
+
ticker,
|
|
115
|
+
kind: types_1.CorporateActionKind.UnpredictableBenefit,
|
|
116
|
+
declarationDate,
|
|
117
|
+
checkpoint: checkpointValue,
|
|
118
|
+
description,
|
|
119
|
+
targets,
|
|
120
|
+
defaultTaxWithholding,
|
|
121
|
+
taxWithholdings,
|
|
122
|
+
}, context),
|
|
109
123
|
rawPortfolioNumber,
|
|
110
124
|
rawCurrency,
|
|
111
125
|
rawPerShare,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureDividendDistribution.js","sourceRoot":"","sources":["../../../src/api/procedures/configureDividendDistribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configureDividendDistribution.js","sourceRoot":"","sources":["../../../src/api/procedures/configureDividendDistribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gEAAqC;AAErC,mCAAsE;AACtE,6CAUoB;AACpB,uCAMiB;AAE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,CAAC,CAAC;YACxC,UAAU,EAAE,CAAC,SAAS,CAAC;SACxB;KACF,CAAC;AACJ,CAAC;AAjBD,4CAiBC;AAED;;GAEG;AACH,SAAsB,cAAc,CAElC,EAAE,eAAe,EAAU;;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAEnD,IAAI,SAAS,GAAG,eAAe,IAAI,IAAI,2BAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;QAE1E,IAAI,SAAS,YAAY,sBAAS,EAAE;YAClC,SAAS,GAAG,IAAI,4BAAiB,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;SACpE;QAED,OAAO;YACL,SAAS;SACV,CAAC;IACJ,CAAC;CAAA;AAjBD,wCAiBC;AAED;;GAEG;AACI,MAAM,6BAA6B,GAAG,GAAqD,EAAE,CAClG,IAAI,oBAAS,CAAC,oCAAoC,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAD3E,QAAA,6BAA6B,iCAC8C"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import BigNumber from 'bignumber.js';
|
|
2
1
|
import { Procedure } from "../../internal";
|
|
3
|
-
import {
|
|
2
|
+
import { ControllerTransferParams } from "../../types";
|
|
4
3
|
import { ProcedureAuthorization } from "../../types/internal";
|
|
5
|
-
export interface ControllerTransferParams {
|
|
6
|
-
/**
|
|
7
|
-
* portfolio (or portfolio ID) from which Assets will be transferred
|
|
8
|
-
*/
|
|
9
|
-
originPortfolio: PortfolioLike;
|
|
10
|
-
/**
|
|
11
|
-
* amount of Asset tokens to transfer
|
|
12
|
-
*/
|
|
13
|
-
amount: BigNumber;
|
|
14
|
-
}
|
|
15
4
|
export interface Storage {
|
|
16
5
|
did: string;
|
|
17
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllerTransfer.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/controllerTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"controllerTransfer.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/controllerTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,uBAAmB;AAC/E,OAAO,EAAE,wBAAwB,EAA+B,oBAAgB;AAChF,OAAO,EAAE,sBAAsB,EAAE,6BAAyB;AAS1D,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,oBAAY,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EACtC,EAAE,MAAM,EAAE,EAAE,MAAM,GACjB,OAAO,CAAC,sBAAsB,CAAC,CAkBjC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ7F;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAO,UAAU,MAAM,EAAE,IAAI,EAAE,OAAO,CACO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllerTransfer.js","sourceRoot":"","sources":["../../../src/api/procedures/controllerTransfer.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"controllerTransfer.js","sourceRoot":"","sources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|
|
1
1
|
import { Bytes } from '@polkadot/types';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Asset, Context, Procedure } from "../../internal";
|
|
6
|
-
import { AssetDocument, SecurityIdentifier, TickerReservationStatus } from "../../types";
|
|
2
|
+
import { Asset, Procedure } from "../../internal";
|
|
3
|
+
import { CustomAssetTypeId } from "../../polkadot/polymesh";
|
|
4
|
+
import { CreateAssetWithTickerParams, TickerReservationStatus } from "../../types";
|
|
7
5
|
import { ProcedureAuthorization } from "../../types/internal";
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export declare const createRegisterCustomAssetTypeResolver: (context: Context) => (receipt: ISubmittableResult) => AssetType;
|
|
12
|
-
export interface CreateAssetParams {
|
|
13
|
-
name: string;
|
|
14
|
-
/**
|
|
15
|
-
* amount of Asset tokens that will be minted on creation (optional, default doesn't mint)
|
|
16
|
-
*/
|
|
17
|
-
initialSupply?: BigNumber;
|
|
18
|
-
/**
|
|
19
|
-
* whether a single Asset token can be divided into decimal parts
|
|
20
|
-
*/
|
|
21
|
-
isDivisible: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* type of security that the Asset represents (i.e. Equity, Debt, Commodity, etc). Common values are included in the
|
|
24
|
-
* {@link KnownAssetType} enum, but custom values can be used as well. Custom values must be registered on-chain the first time
|
|
25
|
-
* they're used, requiring an additional transaction. They aren't tied to a specific Asset
|
|
26
|
-
*/
|
|
27
|
-
assetType: string;
|
|
28
|
-
/**
|
|
29
|
-
* array of domestic or international alphanumeric security identifiers for the Asset (ISIN, CUSIP, etc)
|
|
30
|
-
*/
|
|
31
|
-
securityIdentifiers?: SecurityIdentifier[];
|
|
32
|
-
/**
|
|
33
|
-
* (optional) funding round in which the Asset currently is (Series A, Series B, etc)
|
|
34
|
-
*/
|
|
35
|
-
fundingRound?: string;
|
|
36
|
-
documents?: AssetDocument[];
|
|
37
|
-
/**
|
|
38
|
-
* whether this asset requires investors to have a Investor Uniqueness Claim in order
|
|
39
|
-
* to hold it. More information about Investor Uniqueness and PUIS [here](https://developers.polymesh.live/introduction/identity#polymesh-unique-identity-system-puis)
|
|
40
|
-
*/
|
|
41
|
-
requireInvestorUniqueness: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface CreateAssetWithTickerParams extends CreateAssetParams {
|
|
44
|
-
ticker: string;
|
|
45
|
-
}
|
|
46
6
|
/**
|
|
47
7
|
* @hidden
|
|
48
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAsset.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"createAsset.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAE,KAAK,EAA0B,SAAS,EAAqB,uBAAmB;AACzF,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,OAAO,EACL,2BAA2B,EAI3B,uBAAuB,EAGxB,oBAAgB;AACjB,OAAO,EAAE,sBAAsB,EAAE,6BAAyB;AAa1D;;GAEG;AACH,oBAAY,MAAM,GAAG,2BAA2B,GAAG;IACjD,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,cAAc,EAAE;QACd,EAAE,EAAE,iBAAiB,CAAC;QACtB,QAAQ,EAAE,KAAK,CAAC;KACjB,GAAG,IAAI,CAAC;IAET,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAgCD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC,CAuLhB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,MAAM,GAC5B,OAAO,CAAC,sBAAsB,CAAC,CA8BjC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,MAAM,GAC5B,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,QAAO,UAAU,MAAM,EAAE,KAAK,EAAE,OAAO,CACM,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.createAsset = exports.prepareStorage = exports.getAuthorization = exports.prepareCreateAsset =
|
|
15
|
+
exports.createAsset = exports.prepareStorage = exports.getAuthorization = exports.prepareCreateAsset = void 0;
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
17
|
const lodash_1 = require("lodash");
|
|
18
18
|
const internal_1 = require("../../internal");
|
|
@@ -20,13 +20,28 @@ const types_1 = require("../../types");
|
|
|
20
20
|
const conversion_1 = require("../../utils/conversion");
|
|
21
21
|
const internal_2 = require("../../utils/internal");
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Add protocol fees for specific tags to the current accumulated total
|
|
24
|
+
*
|
|
25
|
+
* @returns undefined if fees aren't being calculated manually
|
|
24
26
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function addManualFees(currentFee, tags, context) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
if (!currentFee) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const fees = yield context.getProtocolFees({
|
|
33
|
+
tags: tags.map(tagData => (typeof tagData !== 'string' ? tagData.tag : tagData)),
|
|
34
|
+
});
|
|
35
|
+
return fees.reduce((prev, { fees: nextFees }, index) => {
|
|
36
|
+
const tagData = tags[index];
|
|
37
|
+
let feeMultiplier = new bignumber_js_1.default(1);
|
|
38
|
+
if (typeof tagData !== 'string') {
|
|
39
|
+
({ feeMultiplier } = tagData);
|
|
40
|
+
}
|
|
41
|
+
return prev.plus(nextFees.times(feeMultiplier));
|
|
42
|
+
}, currentFee);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
30
45
|
/**
|
|
31
46
|
* @hidden
|
|
32
47
|
*/
|
|
@@ -46,73 +61,118 @@ function prepareCreateAsset(args) {
|
|
|
46
61
|
message: `You must first reserve ticker "${ticker}" in order to create an Asset with it`,
|
|
47
62
|
});
|
|
48
63
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const { rawValue, id } = customTypeData;
|
|
52
|
-
if (id.isEmpty) {
|
|
53
|
-
// if the custom asset type doesn't exist, we create it
|
|
54
|
-
[rawType] = this.addTransaction({
|
|
55
|
-
transaction: tx.asset.registerCustomAssetType,
|
|
56
|
-
resolvers: [(0, exports.createRegisterCustomAssetTypeResolver)(context)],
|
|
57
|
-
args: [rawValue],
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
rawType = (0, conversion_1.internalAssetTypeToAssetType)({ Custom: id }, context);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
rawType = (0, conversion_1.internalAssetTypeToAssetType)(assetType, context);
|
|
66
|
-
}
|
|
67
|
-
const rawName = (0, conversion_1.stringToAssetName)(name, context);
|
|
64
|
+
const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
|
|
65
|
+
const rawName = (0, conversion_1.stringToBytes)(name, context);
|
|
68
66
|
const rawIsDivisible = (0, conversion_1.booleanToBool)(isDivisible, context);
|
|
69
67
|
const rawIdentifiers = securityIdentifiers.map(identifier => (0, conversion_1.securityIdentifierToAssetIdentifier)(identifier, context));
|
|
70
|
-
const rawFundingRound =
|
|
68
|
+
const rawFundingRound = (0, internal_2.optionize)(conversion_1.stringToBytes)(fundingRound, context);
|
|
71
69
|
const rawDisableIu = (0, conversion_1.booleanToBool)(!requireInvestorUniqueness, context);
|
|
70
|
+
const newAsset = new internal_1.Asset({ ticker }, context);
|
|
72
71
|
let fee;
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
/*
|
|
73
|
+
* we waive any protocol fees if the Asset is created in Ethereum. If not created and ticker is not yet reserved,
|
|
74
|
+
* we set the fee to the sum of protocol fees for ticker registration and Asset creation.
|
|
75
|
+
*/
|
|
75
76
|
const classicTicker = yield asset.classicTickers(rawTicker);
|
|
76
|
-
const assetCreatedInEthereum = classicTicker.isSome && (0, conversion_1.boolToBoolean)(classicTicker.unwrap().
|
|
77
|
+
const assetCreatedInEthereum = classicTicker.isSome && (0, conversion_1.boolToBoolean)(classicTicker.unwrap().isCreated);
|
|
77
78
|
if (assetCreatedInEthereum) {
|
|
78
79
|
fee = new bignumber_js_1.default(0);
|
|
79
80
|
}
|
|
80
81
|
else if (status === types_1.TickerReservationStatus.Free) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
fee = yield addManualFees(new bignumber_js_1.default(0), [types_1.TxTags.asset.RegisterTicker, types_1.TxTags.asset.CreateAsset], context);
|
|
83
|
+
}
|
|
84
|
+
const transactions = [];
|
|
85
|
+
/*
|
|
86
|
+
* - if the passed Asset type isn't one of the fixed ones (custom), we check if there is already
|
|
87
|
+
* an on-chain custom Asset type with that name:
|
|
88
|
+
* - if not, we create it together with the Asset
|
|
89
|
+
* - otherwise, we create the asset with the id of the existing custom asset type
|
|
90
|
+
* - if the passed Asset type is a fixed one, we create the asset using that Asset type
|
|
91
|
+
*/
|
|
92
|
+
if (customTypeData) {
|
|
93
|
+
const { rawValue, id } = customTypeData;
|
|
94
|
+
if (id.isEmpty) {
|
|
95
|
+
/*
|
|
96
|
+
* if we're using custom fees because we're creating the Asset without registering first, we have to manually add
|
|
97
|
+
* the fees for registering a custom Asset type
|
|
98
|
+
*/
|
|
99
|
+
fee = yield addManualFees(fee, [types_1.TxTags.asset.RegisterCustomAssetType], context);
|
|
100
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
101
|
+
transaction: tx.asset.createAssetWithCustomType,
|
|
102
|
+
args: [
|
|
103
|
+
rawName,
|
|
104
|
+
rawTicker,
|
|
105
|
+
rawIsDivisible,
|
|
106
|
+
rawValue,
|
|
107
|
+
rawIdentifiers,
|
|
108
|
+
rawFundingRound,
|
|
109
|
+
rawDisableIu,
|
|
110
|
+
],
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const rawType = (0, conversion_1.internalAssetTypeToAssetType)({ Custom: id }, context);
|
|
115
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
116
|
+
transaction: tx.asset.createAsset,
|
|
117
|
+
args: [
|
|
118
|
+
rawName,
|
|
119
|
+
rawTicker,
|
|
120
|
+
rawIsDivisible,
|
|
121
|
+
rawType,
|
|
122
|
+
rawIdentifiers,
|
|
123
|
+
rawFundingRound,
|
|
124
|
+
rawDisableIu,
|
|
125
|
+
],
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const rawType = (0, conversion_1.internalAssetTypeToAssetType)(assetType, context);
|
|
131
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
132
|
+
transaction: tx.asset.createAsset,
|
|
133
|
+
args: [
|
|
134
|
+
rawName,
|
|
135
|
+
rawTicker,
|
|
136
|
+
rawIsDivisible,
|
|
137
|
+
rawType,
|
|
138
|
+
rawIdentifiers,
|
|
139
|
+
rawFundingRound,
|
|
140
|
+
rawDisableIu,
|
|
141
|
+
],
|
|
142
|
+
}));
|
|
85
143
|
}
|
|
86
|
-
this.addTransaction({
|
|
87
|
-
transaction: tx.asset.createAsset,
|
|
88
|
-
fee,
|
|
89
|
-
args: [
|
|
90
|
-
rawName,
|
|
91
|
-
rawTicker,
|
|
92
|
-
rawIsDivisible,
|
|
93
|
-
rawType,
|
|
94
|
-
rawIdentifiers,
|
|
95
|
-
rawFundingRound,
|
|
96
|
-
rawDisableIu,
|
|
97
|
-
],
|
|
98
|
-
});
|
|
99
144
|
if (initialSupply && initialSupply.gt(0)) {
|
|
100
145
|
const rawInitialSupply = (0, conversion_1.bigNumberToBalance)(initialSupply, context, isDivisible);
|
|
101
|
-
|
|
146
|
+
/*
|
|
147
|
+
* if we're using custom fees because we're creating the Asset without registering first, we have to manually add
|
|
148
|
+
* the fees for issuing
|
|
149
|
+
*/
|
|
150
|
+
fee = yield addManualFees(fee, [types_1.TxTags.asset.Issue], context);
|
|
151
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
102
152
|
transaction: tx.asset.issue,
|
|
103
153
|
args: [rawTicker, rawInitialSupply],
|
|
104
|
-
});
|
|
154
|
+
}));
|
|
105
155
|
}
|
|
106
156
|
if (documents === null || documents === void 0 ? void 0 : documents.length) {
|
|
107
157
|
const rawDocuments = documents.map(doc => (0, conversion_1.assetDocumentToDocument)(doc, context));
|
|
108
|
-
|
|
158
|
+
const feeMultiplier = new bignumber_js_1.default(rawDocuments.length);
|
|
159
|
+
/*
|
|
160
|
+
* if we're using custom fees because we're creating the Asset without registering first, we have to manually add
|
|
161
|
+
* the fees for adding documents
|
|
162
|
+
*/
|
|
163
|
+
fee = yield addManualFees(fee, [{ tag: types_1.TxTags.asset.AddDocuments, feeMultiplier }], context);
|
|
164
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
109
165
|
transaction: tx.asset.addDocuments,
|
|
110
|
-
|
|
111
|
-
feeMultiplier
|
|
166
|
+
// this will be ignored if manual fees are passed
|
|
167
|
+
feeMultiplier,
|
|
112
168
|
args: [rawDocuments, rawTicker],
|
|
113
|
-
});
|
|
169
|
+
}));
|
|
114
170
|
}
|
|
115
|
-
|
|
171
|
+
this.addBatchTransaction({
|
|
172
|
+
transactions,
|
|
173
|
+
fee,
|
|
174
|
+
});
|
|
175
|
+
return newAsset;
|
|
116
176
|
});
|
|
117
177
|
}
|
|
118
178
|
exports.prepareCreateAsset = prepareCreateAsset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAsset.js","sourceRoot":"","sources":["../../../src/api/procedures/createAsset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"createAsset.js","sourceRoot":"","sources":["../../../src/api/procedures/createAsset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gEAAqC;AACrC,mCAAgC;AAEhC,6CAAyF;AAEzF,uCAQiB;AAEjB,uDAS4B;AAC5B,mDAA0D;AAyB1D;;;;GAIG;AACH,SAAe,aAAa,CAC1B,UAAiC,EACjC,IAA0D,EAC1D,OAAgB;;QAEhB,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC;YACzC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;SACjF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,aAAa,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;YAErC,IAAI,OAAO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C;SACH;QAED,OAAO;YACL,cAAc,EAAE,IAAI;YACpB,MAAM;SACP,CAAC;IACJ,CAAC;CAAA;AA5BD,wCA4BC;AAED;;GAEG;AACI,MAAM,WAAW,GAAG,GAAsC,EAAE,CACjE,IAAI,oBAAS,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AADzD,QAAA,WAAW,eAC8C"}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
2
|
-
import BigNumber from 'bignumber.js';
|
|
3
2
|
import { CheckpointSchedule, Context, PostTransactionValue, Procedure } from "../../internal";
|
|
4
|
-
import {
|
|
3
|
+
import { CreateCheckpointScheduleParams } from "../../types";
|
|
5
4
|
import { ProcedureAuthorization } from "../../types/internal";
|
|
6
|
-
export interface CreateCheckpointScheduleParams {
|
|
7
|
-
/**
|
|
8
|
-
* The date from which to begin creating snapshots. A null value indicates immediately
|
|
9
|
-
*/
|
|
10
|
-
start: Date | null;
|
|
11
|
-
/**
|
|
12
|
-
* The cadence with which to make Checkpoints.
|
|
13
|
-
* @note A null value indicates to create only one Checkpoint, regardless of repetitions specified. This can be used to schedule the creation of a Checkpoint in the future
|
|
14
|
-
*/
|
|
15
|
-
period: CalendarPeriod | null;
|
|
16
|
-
/**
|
|
17
|
-
* The number of snapshots to take. A null value indicates snapshots should be made indefinitely
|
|
18
|
-
*/
|
|
19
|
-
repetitions: BigNumber | null;
|
|
20
|
-
}
|
|
21
5
|
/**
|
|
22
6
|
* @hidden
|
|
23
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCheckpointSchedule.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createCheckpointSchedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"createCheckpointSchedule.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createCheckpointSchedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAEL,kBAAkB,EAClB,OAAO,EAEP,oBAAoB,EACpB,SAAS,EACV,uBAAmB;AACpB,OAAO,EAAE,8BAA8B,EAAqB,oBAAgB;AAC5E,OAAO,EAAE,sBAAsB,EAAE,6BAAyB;AAQ1D;;GAEG;AACH,oBAAY,MAAM,GAAG,8BAA8B,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,WAClC,MAAM,WAAW,OAAO,eACvB,kBAAkB,KAAG,kBAY9B,CAAC;AAEJ;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC3C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAsBnD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC3C,EAAE,MAAM,EAAE,EAAE,MAAM,GACjB,sBAAsB,CASxB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,UAAU,MAAM,EAAE,kBAAkB,CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCheckpointSchedule.js","sourceRoot":"","sources":["../../../src/api/procedures/createCheckpointSchedule.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"createCheckpointSchedule.js","sourceRoot":"","sources":["../../../src/api/procedures/createCheckpointSchedule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6CAOoB;AACpB,uCAA4E;AAE5E,uDAI4B;AAC5B,mDAAsD;AAStD;;GAEG;AACI,MAAM,gCAAgC,GAC3C,CAAC,MAAc,EAAE,OAAgB,EAAE,EAAE,CACr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AAC;IAClB,CAAC;CAAA;AAzBD,0EAyBC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAE9B,EAAE,MAAM,EAAU;IAElB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,OAAO;QACL,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAM,CAAC,UAAU,CAAC,cAAc,CAAC;YAChD,MAAM,EAAE,CAAC,IAAI,gBAAK,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;YACxC,UAAU,EAAE,EAAE;SACf;KACF,CAAC;AACJ,CAAC;AAZD,4CAYC;AAED;;GAEG;AACI,MAAM,wBAAwB,GAAG,GAA0C,EAAE,CAClF,IAAI,oBAAS,CAAC,+BAA+B,EAAE,gBAAgB,CAAC,CAAC;AADtD,QAAA,wBAAwB,4BAC8B"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { TransactionPermissions, TxGroup } from "../../types";
|
|
1
|
+
import { Asset, CustomPermissionGroup, PostTransactionValue, Procedure } from "../../internal";
|
|
2
|
+
import { CreateGroupParams } from "../../types";
|
|
4
3
|
import { ProcedureAuthorization } from "../../types/internal";
|
|
5
|
-
export interface CreateGroupParams {
|
|
6
|
-
permissions: {
|
|
7
|
-
transactions: TransactionPermissions;
|
|
8
|
-
} | {
|
|
9
|
-
transactionGroups: TxGroup[];
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
4
|
/**
|
|
13
5
|
* @hidden
|
|
14
6
|
*/
|
|
@@ -21,10 +13,6 @@ export declare type Params = CreateGroupParams & {
|
|
|
21
13
|
export interface Storage {
|
|
22
14
|
asset: Asset;
|
|
23
15
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
export declare const createCreateGroupResolver: (context: Context) => (receipt: ISubmittableResult) => CustomPermissionGroup;
|
|
28
16
|
/**
|
|
29
17
|
* @hidden
|
|
30
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGroup.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGroup.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,SAAS,EAAE,uBAAmB;AAC3F,OAAO,EAAE,iBAAiB,EAAU,oBAAgB;AACpD,OAAO,EAAE,sBAAsB,EAAE,6BAAyB;AAO1D;;GAEG;AACH,oBAAY,MAAM,GAAG,iBAAiB,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,EACvD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CA6BtD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,GACtD,sBAAsB,CAWxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,EACvD,EAAE,MAAM,EAAE,EAAE,MAAM,GACjB,OAAO,CAMT;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,QAAO,UAAU,MAAM,EAAE,qBAAqB,EAAE,OAAO,CACV,CAAC"}
|
|
@@ -8,25 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.createGroup = exports.prepareStorage = exports.getAuthorization = exports.prepareCreateGroup =
|
|
16
|
-
const
|
|
17
|
-
const lodash_1 = require("lodash");
|
|
12
|
+
exports.createGroup = exports.prepareStorage = exports.getAuthorization = exports.prepareCreateGroup = void 0;
|
|
13
|
+
const utils_1 = require("./utils");
|
|
18
14
|
const internal_1 = require("../../internal");
|
|
19
15
|
const types_1 = require("../../types");
|
|
20
16
|
const conversion_1 = require("../../utils/conversion");
|
|
21
|
-
const internal_2 = require("../../utils/internal");
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
|
-
const createCreateGroupResolver = (context) => (receipt) => {
|
|
26
|
-
const [{ data }] = (0, internal_2.filterEventRecords)(receipt, 'externalAgents', 'GroupCreated');
|
|
27
|
-
return new internal_1.CustomPermissionGroup({ id: (0, conversion_1.u64ToBigNumber)(data[2]), ticker: (0, conversion_1.tickerToString)(data[1]) }, context);
|
|
28
|
-
};
|
|
29
|
-
exports.createCreateGroupResolver = createCreateGroupResolver;
|
|
30
17
|
/**
|
|
31
18
|
* @hidden
|
|
32
19
|
*/
|
|
@@ -36,22 +23,11 @@ function prepareCreateGroup(args) {
|
|
|
36
23
|
const { ticker, permissions } = args;
|
|
37
24
|
const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
|
|
38
25
|
const { transactions } = (0, conversion_1.permissionsLikeToPermissions)(permissions, context);
|
|
39
|
-
|
|
40
|
-
const allGroups = [...custom, ...known];
|
|
41
|
-
const currentGroupPermissions = yield bluebird_1.default.map(allGroups, group => group.getPermissions());
|
|
42
|
-
const duplicatedGroupIndex = currentGroupPermissions.findIndex(({ transactions: transactionPermissions }) => (0, lodash_1.isEqual)(transactionPermissions, transactions));
|
|
43
|
-
if (duplicatedGroupIndex > -1) {
|
|
44
|
-
const group = allGroups[duplicatedGroupIndex];
|
|
45
|
-
throw new internal_1.PolymeshError({
|
|
46
|
-
code: types_1.ErrorCode.NoDataChange,
|
|
47
|
-
message: 'There already exists a group with the exact same permissions',
|
|
48
|
-
data: { groupId: group instanceof internal_1.CustomPermissionGroup ? group.id : group.type },
|
|
49
|
-
});
|
|
50
|
-
}
|
|
26
|
+
yield (0, utils_1.assertGroupDoesNotExist)(asset, transactions);
|
|
51
27
|
const rawExtrinsicPermissions = (0, conversion_1.transactionPermissionsToExtrinsicPermissions)(transactions, context);
|
|
52
28
|
const [customPermissionGroup] = this.addTransaction({
|
|
53
29
|
transaction: externalAgents.createGroup,
|
|
54
|
-
resolvers: [(0,
|
|
30
|
+
resolvers: [(0, utils_1.createCreateGroupResolver)(context)],
|
|
55
31
|
args: [rawTicker, rawExtrinsicPermissions],
|
|
56
32
|
});
|
|
57
33
|
return customPermissionGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGroup.js","sourceRoot":"","sources":["../../../src/api/procedures/createGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGroup.js","sourceRoot":"","sources":["../../../src/api/procedures/createGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA4F;AAC5F,6CAA2F;AAC3F,uCAAoD;AAEpD,uDAI4B;AAgB5B;;GAEG;AACH,SAAsB,kBAAkB,CAEtC,IAAY;;QAEZ,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EAAE,cAAc,EAAE,GACvB,GACF,EACD,OAAO,EACP,OAAO,EAAE,EAAE,KAAK,EAAE,GACnB,GAAG,IAAI,CAAC;QACT,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAErC,MAAM,SAAS,GAAG,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClD,MAAM,E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const { name: portfolioName } = args;
|
|
34
34
|
const { did } = yield context.getSigningIdentity();
|
|
35
35
|
const rawIdentityId = (0, conversion_1.stringToIdentityId)(did, context);
|
|
36
|
-
const rawName = (0, conversion_1.
|
|
36
|
+
const rawName = (0, conversion_1.stringToBytes)(portfolioName, context);
|
|
37
37
|
const existingPortfolioNumber = yield (0, internal_2.getPortfolioIdByName)(rawIdentityId, rawName, context);
|
|
38
38
|
if (existingPortfolioNumber) {
|
|
39
39
|
throw new internal_1.PolymeshError({
|