From 6f705d505bbdb68f5a8fa79dcb12b20442891aff Mon Sep 17 00:00:00 2001 From: Benoit Devos Date: Wed, 18 Oct 2023 16:12:06 +0200 Subject: [PATCH 1/3] feat: generate node api for close with auto-ack flag. logion-network/logion-internal#1028 --- packages/node-api/package.json | 2 +- .../src/interfaces/augment-api-errors.ts | 12 ++- .../src/interfaces/augment-api-query.ts | 2 +- .../node-api/src/interfaces/augment-api-tx.ts | 6 +- packages/node-api/src/interfaces/lookup.ts | 74 +++++++++--------- .../node-api/src/interfaces/types-lookup.ts | 78 +++++++++---------- 6 files changed, 86 insertions(+), 88 deletions(-) diff --git a/packages/node-api/package.json b/packages/node-api/package.json index 82ed5d38..3cdf188a 100644 --- a/packages/node-api/package.json +++ b/packages/node-api/package.json @@ -1,6 +1,6 @@ { "name": "@logion/node-api", - "version": "0.23.0", + "version": "0.24.0-1", "description": "logion API", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/node-api/src/interfaces/augment-api-errors.ts b/packages/node-api/src/interfaces/augment-api-errors.ts index abdbfcc7..9ba96fc4 100644 --- a/packages/node-api/src/interfaces/augment-api-errors.ts +++ b/packages/node-api/src/interfaces/augment-api-errors.ts @@ -234,7 +234,7 @@ declare module '@polkadot/api-base/types/errors' { **/ AlreadyExists: AugmentedError; /** - * Issuer has already been nominated by the guardian + * Issuer has already been nominated by the owner **/ AlreadyNominated: AugmentedError; /** @@ -255,9 +255,13 @@ declare module '@polkadot/api-base/types/errors' { **/ CannotAddRecord: AugmentedError; /** - * There is still at least one Unacknowledged Item (Metadata or File) + * There is still at least one Item (Metadata, Link or File) unacknowledged by LOC owner **/ - CannotCloseUnacknowledged: AugmentedError; + CannotCloseUnacknowledgedByOwner: AugmentedError; + /** + * There is still at least one Item (Metadata, Link or File) unacknowledged by verified issuer + **/ + CannotCloseUnacknowledgedByVerifiedIssuer: AugmentedError; /** * The sponsorship cannot be used for creating the new LOC **/ @@ -363,7 +367,7 @@ declare module '@polkadot/api-base/types/errors' { **/ NotFound: AugmentedError; /** - * Issuer is not nominated by the guardian + * Issuer is not nominated by the owner **/ NotNominated: AugmentedError; /** diff --git a/packages/node-api/src/interfaces/augment-api-query.ts b/packages/node-api/src/interfaces/augment-api-query.ts index e0e998e2..4bfc8f24 100644 --- a/packages/node-api/src/interfaces/augment-api-query.ts +++ b/packages/node-api/src/interfaces/augment-api-query.ts @@ -223,7 +223,7 @@ declare module '@polkadot/api-base/types/storage' { **/ verifiedIssuersByLocMap: AugmentedQuery Observable>, [u128, AccountId32]> & QueryableStorageEntry; /** - * Verified Issuers by guardian + * Verified Issuers by owner **/ verifiedIssuersMap: AugmentedQuery Observable>, [AccountId32, AccountId32]> & QueryableStorageEntry; /** diff --git a/packages/node-api/src/interfaces/augment-api-tx.ts b/packages/node-api/src/interfaces/augment-api-tx.ts index 7ca3f2d5..672c3e58 100644 --- a/packages/node-api/src/interfaces/augment-api-tx.ts +++ b/packages/node-api/src/interfaces/augment-api-tx.ts @@ -270,11 +270,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * See [`Pallet::close`]. **/ - close: AugmentedSubmittable<(locId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; - /** - * See [`Pallet::close_and_seal`]. - **/ - closeAndSeal: AugmentedSubmittable<(locId: Compact | AnyNumber | Uint8Array, seal: H256 | string | Uint8Array) => SubmittableExtrinsic, [Compact, H256]>; + close: AugmentedSubmittable<(locId: Compact | AnyNumber | Uint8Array, seal: Option | null | Uint8Array | H256 | string, autoAck: bool | boolean | Uint8Array) => SubmittableExtrinsic, [Compact, Option, bool]>; /** * See [`Pallet::create_collection_loc`]. **/ diff --git a/packages/node-api/src/interfaces/lookup.ts b/packages/node-api/src/interfaces/lookup.ts index 07296763..c316c637 100644 --- a/packages/node-api/src/interfaces/lookup.ts +++ b/packages/node-api/src/interfaces/lookup.ts @@ -1426,13 +1426,8 @@ export default { locId: 'Compact', link: 'PalletLogionLocLocLinkParams', }, - close: { - locId: 'Compact', - }, - close_and_seal: { - locId: 'Compact', - seal: 'H256', - }, + __Unused8: 'Null', + __Unused9: 'Null', make_void: { locId: 'Compact', }, @@ -1502,7 +1497,12 @@ export default { }, acknowledge_link: { locId: 'Compact', - target: 'Compact' + target: 'Compact', + }, + close: { + locId: 'Compact', + seal: 'Option', + autoAck: 'bool' } } }, @@ -1586,7 +1586,7 @@ export default { hash_: 'H256' }, /** - * Lookup177: pallet_verified_recovery::pallet::Call + * Lookup178: pallet_verified_recovery::pallet::Call **/ PalletVerifiedRecoveryCall: { _enum: { @@ -1596,7 +1596,7 @@ export default { } }, /** - * Lookup178: pallet_logion_vault::pallet::Call + * Lookup179: pallet_logion_vault::pallet::Call **/ PalletLogionVaultCall: { _enum: { @@ -1614,7 +1614,7 @@ export default { } }, /** - * Lookup179: pallet_logion_vote::pallet::Call + * Lookup180: pallet_logion_vote::pallet::Call **/ PalletLogionVoteCall: { _enum: { @@ -1628,7 +1628,7 @@ export default { } }, /** - * Lookup180: pallet_treasury::pallet::Call + * Lookup181: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1652,19 +1652,19 @@ export default { } }, /** - * Lookup181: pallet_sudo::pallet::Error + * Lookup182: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup183: pallet_node_authorization::pallet::Error + * Lookup184: pallet_node_authorization::pallet::Error **/ PalletNodeAuthorizationError: { _enum: ['PeerIdTooLong', 'TooManyNodes', 'AlreadyJoined', 'NotExist', 'AlreadyClaimed', 'NotClaimed', 'NotOwner', 'PermissionDenied'] }, /** - * Lookup185: pallet_multisig::Multisig + * Lookup186: pallet_multisig::Multisig **/ PalletMultisigMultisig: { when: 'PalletMultisigTimepoint', @@ -1673,13 +1673,13 @@ export default { approvals: 'Vec' }, /** - * Lookup187: pallet_multisig::pallet::Error + * Lookup188: pallet_multisig::pallet::Error **/ PalletMultisigError: { _enum: ['MinimumThreshold', 'AlreadyApproved', 'NoApprovalsNeeded', 'TooFewSignatories', 'TooManySignatories', 'SignatoriesOutOfOrder', 'SenderInSignatories', 'NotFound', 'NotOwner', 'NoTimepoint', 'WrongTimepoint', 'UnexpectedTimepoint', 'MaxWeightTooLow', 'AlreadyStored'] }, /** - * Lookup188: pallet_recovery::RecoveryConfig> + * Lookup189: pallet_recovery::RecoveryConfig> **/ PalletRecoveryRecoveryConfig: { delayPeriod: 'u32', @@ -1688,7 +1688,7 @@ export default { threshold: 'u16' }, /** - * Lookup191: pallet_recovery::ActiveRecovery> + * Lookup192: pallet_recovery::ActiveRecovery> **/ PalletRecoveryActiveRecovery: { created: 'u32', @@ -1696,13 +1696,13 @@ export default { friends: 'Vec' }, /** - * Lookup192: pallet_recovery::pallet::Error + * Lookup193: pallet_recovery::pallet::Error **/ PalletRecoveryError: { _enum: ['NotAllowed', 'ZeroThreshold', 'NotEnoughFriends', 'MaxFriends', 'NotSorted', 'NotRecoverable', 'AlreadyRecoverable', 'AlreadyStarted', 'NotStarted', 'NotFriend', 'DelayPeriod', 'AlreadyVouched', 'Threshold', 'StillActive', 'AlreadyProxy', 'BadState'] }, /** - * Lookup193: pallet_assets::types::AssetDetails + * Lookup194: pallet_assets::types::AssetDetails **/ PalletAssetsAssetDetails: { owner: 'AccountId32', @@ -1719,13 +1719,13 @@ export default { status: 'PalletAssetsAssetStatus' }, /** - * Lookup194: pallet_assets::types::AssetStatus + * Lookup195: pallet_assets::types::AssetStatus **/ PalletAssetsAssetStatus: { _enum: ['Live', 'Frozen', 'Destroying'] }, /** - * Lookup196: pallet_assets::types::AssetAccount + * Lookup197: pallet_assets::types::AssetAccount **/ PalletAssetsAssetAccount: { balance: 'u128', @@ -1734,13 +1734,13 @@ export default { extra: 'Null' }, /** - * Lookup197: pallet_assets::types::AccountStatus + * Lookup198: pallet_assets::types::AccountStatus **/ PalletAssetsAccountStatus: { _enum: ['Liquid', 'Frozen', 'Blocked'] }, /** - * Lookup198: pallet_assets::types::ExistenceReason + * Lookup199: pallet_assets::types::ExistenceReason **/ PalletAssetsExistenceReason: { _enum: { @@ -1752,14 +1752,14 @@ export default { } }, /** - * Lookup200: pallet_assets::types::Approval + * Lookup201: pallet_assets::types::Approval **/ PalletAssetsApproval: { amount: 'u128', deposit: 'u128' }, /** - * Lookup201: pallet_assets::types::AssetMetadata> + * Lookup202: pallet_assets::types::AssetMetadata> **/ PalletAssetsAssetMetadata: { deposit: 'u128', @@ -1769,25 +1769,25 @@ export default { isFrozen: 'bool' }, /** - * Lookup203: pallet_assets::pallet::Error + * Lookup204: pallet_assets::pallet::Error **/ PalletAssetsError: { _enum: ['BalanceLow', 'NoAccount', 'NoPermission', 'Unknown', 'Frozen', 'InUse', 'BadWitness', 'MinBalanceZero', 'UnavailableConsumer', 'BadMetadata', 'Unapproved', 'WouldDie', 'AlreadyExists', 'NoDeposit', 'WouldBurn', 'LiveAsset', 'AssetNotLive', 'IncorrectStatus', 'NotFrozen', 'CallbackFailed'] }, /** - * Lookup204: pallet_lo_authority_list::pallet::StorageVersion + * Lookup205: pallet_lo_authority_list::pallet::StorageVersion **/ PalletLoAuthorityListStorageVersion: { _enum: ['V1', 'V2AddOnchainSettings', 'V3GuestLegalOfficers', 'V4Region'] }, /** - * Lookup205: pallet_lo_authority_list::pallet::Error + * Lookup206: pallet_lo_authority_list::pallet::Error **/ PalletLoAuthorityListError: { _enum: ['AlreadyExists', 'NotFound', 'PeerIdAlreadyInUse', 'HostHasGuest', 'GuestOfGuest', 'HostNotFound', 'HostCannotConvert', 'GuestCannotUpdate', 'CannotChangeRegion'] }, /** - * Lookup206: pallet_logion_loc::LegalOfficerCase + * Lookup207: pallet_logion_loc::LegalOfficerCase **/ PalletLogionLocLegalOfficerCase: { owner: 'AccountId32', @@ -1808,7 +1808,7 @@ export default { legalFee: 'Option' }, /** - * Lookup207: pallet_logion_loc::Requester + * Lookup208: pallet_logion_loc::Requester **/ PalletLogionLocRequester: { _enum: { @@ -1819,7 +1819,7 @@ export default { } }, /** - * Lookup209: pallet_logion_loc::MetadataItem + * Lookup210: pallet_logion_loc::MetadataItem **/ PalletLogionLocMetadataItem: { name: 'H256', @@ -1829,7 +1829,7 @@ export default { acknowledgedByVerifiedIssuer: 'bool' }, /** - * Lookup211: pallet_logion_loc::File + * Lookup212: pallet_logion_loc::File **/ PalletLogionLocFile: { _alias: { @@ -1844,13 +1844,13 @@ export default { acknowledgedByVerifiedIssuer: 'bool' }, /** - * Lookup212: pallet_logion_loc::LocType + * Lookup213: pallet_logion_loc::LocType **/ PalletLogionLocLocType: { _enum: ['Transaction', 'Identity', 'Collection'] }, /** - * Lookup214: pallet_logion_loc::LocLink + * Lookup215: pallet_logion_loc::LocLink **/ PalletLogionLocLocLink: { id: 'u128', @@ -1860,7 +1860,7 @@ export default { acknowledgedByVerifiedIssuer: 'bool' }, /** - * Lookup216: pallet_logion_loc::LocVoidInfo + * Lookup217: pallet_logion_loc::LocVoidInfo **/ PalletLogionLocLocVoidInfo: { replacer: 'Option' @@ -1908,7 +1908,7 @@ export default { * Lookup228: pallet_logion_loc::pallet::Error **/ PalletLogionLocError: { - _enum: ['AlreadyExists', 'NotFound', 'Unauthorized', 'CannotMutate', 'AlreadyClosed', 'LinkedLocNotFound', 'ReplacerLocNotFound', 'AlreadyVoid', 'ReplacerLocAlreadyVoid', 'ReplacerLocAlreadyReplacing', 'CannotMutateVoid', 'UnexpectedRequester', 'ReplacerLocWrongType', 'InvalidSubmitter', 'CollectionHasNoLimit', 'WrongCollectionLoc', 'CollectionItemAlreadyExists', 'CollectionItemTooMuchData', 'CollectionLimitsReached', 'MetadataItemInvalid', 'FileInvalid', 'LocLinkInvalid', 'CannotUpload', 'MustUpload', 'DuplicateFile', 'MissingToken', 'MissingFiles', 'TermsAndConditionsLocNotFound', 'TermsAndConditionsLocNotClosed', 'TermsAndConditionsLocVoid', 'DuplicateLocFile', 'DuplicateLocMetadata', 'DuplicateLocLink', 'TokensRecordTooMuchData', 'TokensRecordAlreadyExists', 'CannotAddRecord', 'InvalidIdentityLoc', 'AlreadyNominated', 'NotNominated', 'CannotSubmit', 'InsufficientFunds', 'AlreadyUsed', 'CannotLinkToSponsorship', 'ItemNotFound', 'ItemAlreadyAcknowledged', 'CannotCloseUnacknowledged', 'BadTokenIssuance'] + _enum: ['AlreadyExists', 'NotFound', 'Unauthorized', 'CannotMutate', 'AlreadyClosed', 'LinkedLocNotFound', 'ReplacerLocNotFound', 'AlreadyVoid', 'ReplacerLocAlreadyVoid', 'ReplacerLocAlreadyReplacing', 'CannotMutateVoid', 'UnexpectedRequester', 'ReplacerLocWrongType', 'InvalidSubmitter', 'CollectionHasNoLimit', 'WrongCollectionLoc', 'CollectionItemAlreadyExists', 'CollectionItemTooMuchData', 'CollectionLimitsReached', 'MetadataItemInvalid', 'FileInvalid', 'LocLinkInvalid', 'CannotUpload', 'MustUpload', 'DuplicateFile', 'MissingToken', 'MissingFiles', 'TermsAndConditionsLocNotFound', 'TermsAndConditionsLocNotClosed', 'TermsAndConditionsLocVoid', 'DuplicateLocFile', 'DuplicateLocMetadata', 'DuplicateLocLink', 'TokensRecordTooMuchData', 'TokensRecordAlreadyExists', 'CannotAddRecord', 'InvalidIdentityLoc', 'AlreadyNominated', 'NotNominated', 'CannotSubmit', 'InsufficientFunds', 'AlreadyUsed', 'CannotLinkToSponsorship', 'ItemNotFound', 'ItemAlreadyAcknowledged', 'CannotCloseUnacknowledgedByOwner', 'BadTokenIssuance', 'CannotCloseUnacknowledgedByVerifiedIssuer'] }, /** * Lookup229: pallet_verified_recovery::pallet::Error diff --git a/packages/node-api/src/interfaces/types-lookup.ts b/packages/node-api/src/interfaces/types-lookup.ts index 8e5c5c55..b307af5c 100644 --- a/packages/node-api/src/interfaces/types-lookup.ts +++ b/packages/node-api/src/interfaces/types-lookup.ts @@ -1562,15 +1562,6 @@ declare module '@polkadot/types/lookup' { readonly locId: Compact; readonly link: PalletLogionLocLocLinkParams; } & Struct; - readonly isClose: boolean; - readonly asClose: { - readonly locId: Compact; - } & Struct; - readonly isCloseAndSeal: boolean; - readonly asCloseAndSeal: { - readonly locId: Compact; - readonly seal: H256; - } & Struct; readonly isMakeVoid: boolean; readonly asMakeVoid: { readonly locId: Compact; @@ -1653,7 +1644,13 @@ declare module '@polkadot/types/lookup' { readonly locId: Compact; readonly target: Compact; } & Struct; - readonly type: 'CreatePolkadotIdentityLoc' | 'CreateLogionIdentityLoc' | 'CreatePolkadotTransactionLoc' | 'CreateLogionTransactionLoc' | 'CreateCollectionLoc' | 'AddMetadata' | 'AddFile' | 'AddLink' | 'Close' | 'CloseAndSeal' | 'MakeVoid' | 'MakeVoidAndReplace' | 'AddCollectionItem' | 'AddCollectionItemWithTermsAndConditions' | 'NominateIssuer' | 'DismissIssuer' | 'SetIssuerSelection' | 'AddTokensRecord' | 'CreateOtherIdentityLoc' | 'Sponsor' | 'WithdrawSponsorship' | 'AcknowledgeMetadata' | 'AcknowledgeFile' | 'AcknowledgeLink'; + readonly isClose: boolean; + readonly asClose: { + readonly locId: Compact; + readonly seal: Option; + readonly autoAck: bool; + } & Struct; + readonly type: 'CreatePolkadotIdentityLoc' | 'CreateLogionIdentityLoc' | 'CreatePolkadotTransactionLoc' | 'CreateLogionTransactionLoc' | 'CreateCollectionLoc' | 'AddMetadata' | 'AddFile' | 'AddLink' | 'MakeVoid' | 'MakeVoidAndReplace' | 'AddCollectionItem' | 'AddCollectionItemWithTermsAndConditions' | 'NominateIssuer' | 'DismissIssuer' | 'SetIssuerSelection' | 'AddTokensRecord' | 'CreateOtherIdentityLoc' | 'Sponsor' | 'WithdrawSponsorship' | 'AcknowledgeMetadata' | 'AcknowledgeFile' | 'AcknowledgeLink' | 'Close'; } /** @name PalletLogionLocItemsParams (162) */ @@ -1715,7 +1712,7 @@ declare module '@polkadot/types/lookup' { readonly hash_: H256; } - /** @name PalletVerifiedRecoveryCall (177) */ + /** @name PalletVerifiedRecoveryCall (178) */ interface PalletVerifiedRecoveryCall extends Enum { readonly isCreateRecovery: boolean; readonly asCreateRecovery: { @@ -1724,7 +1721,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateRecovery'; } - /** @name PalletLogionVaultCall (178) */ + /** @name PalletLogionVaultCall (179) */ interface PalletLogionVaultCall extends Enum { readonly isRequestCall: boolean; readonly asRequestCall: { @@ -1742,7 +1739,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'RequestCall' | 'ApproveCall'; } - /** @name PalletLogionVoteCall (179) */ + /** @name PalletLogionVoteCall (180) */ interface PalletLogionVoteCall extends Enum { readonly isCreateVoteForAllLegalOfficers: boolean; readonly asCreateVoteForAllLegalOfficers: { @@ -1756,7 +1753,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateVoteForAllLegalOfficers' | 'Vote'; } - /** @name PalletTreasuryCall (180) */ + /** @name PalletTreasuryCall (181) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1783,13 +1780,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name PalletSudoError (181) */ + /** @name PalletSudoError (182) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name PalletNodeAuthorizationError (183) */ + /** @name PalletNodeAuthorizationError (184) */ interface PalletNodeAuthorizationError extends Enum { readonly isPeerIdTooLong: boolean; readonly isTooManyNodes: boolean; @@ -1802,7 +1799,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PeerIdTooLong' | 'TooManyNodes' | 'AlreadyJoined' | 'NotExist' | 'AlreadyClaimed' | 'NotClaimed' | 'NotOwner' | 'PermissionDenied'; } - /** @name PalletMultisigMultisig (185) */ + /** @name PalletMultisigMultisig (186) */ interface PalletMultisigMultisig extends Struct { readonly when: PalletMultisigTimepoint; readonly deposit: u128; @@ -1810,7 +1807,7 @@ declare module '@polkadot/types/lookup' { readonly approvals: Vec; } - /** @name PalletMultisigError (187) */ + /** @name PalletMultisigError (188) */ interface PalletMultisigError extends Enum { readonly isMinimumThreshold: boolean; readonly isAlreadyApproved: boolean; @@ -1829,7 +1826,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'MinimumThreshold' | 'AlreadyApproved' | 'NoApprovalsNeeded' | 'TooFewSignatories' | 'TooManySignatories' | 'SignatoriesOutOfOrder' | 'SenderInSignatories' | 'NotFound' | 'NotOwner' | 'NoTimepoint' | 'WrongTimepoint' | 'UnexpectedTimepoint' | 'MaxWeightTooLow' | 'AlreadyStored'; } - /** @name PalletRecoveryRecoveryConfig (188) */ + /** @name PalletRecoveryRecoveryConfig (189) */ interface PalletRecoveryRecoveryConfig extends Struct { readonly delayPeriod: u32; readonly deposit: u128; @@ -1837,14 +1834,14 @@ declare module '@polkadot/types/lookup' { readonly threshold: u16; } - /** @name PalletRecoveryActiveRecovery (191) */ + /** @name PalletRecoveryActiveRecovery (192) */ interface PalletRecoveryActiveRecovery extends Struct { readonly created: u32; readonly deposit: u128; readonly friends: Vec; } - /** @name PalletRecoveryError (192) */ + /** @name PalletRecoveryError (193) */ interface PalletRecoveryError extends Enum { readonly isNotAllowed: boolean; readonly isZeroThreshold: boolean; @@ -1865,7 +1862,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotAllowed' | 'ZeroThreshold' | 'NotEnoughFriends' | 'MaxFriends' | 'NotSorted' | 'NotRecoverable' | 'AlreadyRecoverable' | 'AlreadyStarted' | 'NotStarted' | 'NotFriend' | 'DelayPeriod' | 'AlreadyVouched' | 'Threshold' | 'StillActive' | 'AlreadyProxy' | 'BadState'; } - /** @name PalletAssetsAssetDetails (193) */ + /** @name PalletAssetsAssetDetails (194) */ interface PalletAssetsAssetDetails extends Struct { readonly owner: AccountId32; readonly issuer: AccountId32; @@ -1881,7 +1878,7 @@ declare module '@polkadot/types/lookup' { readonly status: PalletAssetsAssetStatus; } - /** @name PalletAssetsAssetStatus (194) */ + /** @name PalletAssetsAssetStatus (195) */ interface PalletAssetsAssetStatus extends Enum { readonly isLive: boolean; readonly isFrozen: boolean; @@ -1889,7 +1886,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Live' | 'Frozen' | 'Destroying'; } - /** @name PalletAssetsAssetAccount (196) */ + /** @name PalletAssetsAssetAccount (197) */ interface PalletAssetsAssetAccount extends Struct { readonly balance: u128; readonly status: PalletAssetsAccountStatus; @@ -1897,7 +1894,7 @@ declare module '@polkadot/types/lookup' { readonly extra: Null; } - /** @name PalletAssetsAccountStatus (197) */ + /** @name PalletAssetsAccountStatus (198) */ interface PalletAssetsAccountStatus extends Enum { readonly isLiquid: boolean; readonly isFrozen: boolean; @@ -1905,7 +1902,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Liquid' | 'Frozen' | 'Blocked'; } - /** @name PalletAssetsExistenceReason (198) */ + /** @name PalletAssetsExistenceReason (199) */ interface PalletAssetsExistenceReason extends Enum { readonly isConsumer: boolean; readonly isSufficient: boolean; @@ -1917,13 +1914,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Consumer' | 'Sufficient' | 'DepositHeld' | 'DepositRefunded' | 'DepositFrom'; } - /** @name PalletAssetsApproval (200) */ + /** @name PalletAssetsApproval (201) */ interface PalletAssetsApproval extends Struct { readonly amount: u128; readonly deposit: u128; } - /** @name PalletAssetsAssetMetadata (201) */ + /** @name PalletAssetsAssetMetadata (202) */ interface PalletAssetsAssetMetadata extends Struct { readonly deposit: u128; readonly name: Bytes; @@ -1932,7 +1929,7 @@ declare module '@polkadot/types/lookup' { readonly isFrozen: bool; } - /** @name PalletAssetsError (203) */ + /** @name PalletAssetsError (204) */ interface PalletAssetsError extends Enum { readonly isBalanceLow: boolean; readonly isNoAccount: boolean; @@ -1957,7 +1954,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'NoAccount' | 'NoPermission' | 'Unknown' | 'Frozen' | 'InUse' | 'BadWitness' | 'MinBalanceZero' | 'UnavailableConsumer' | 'BadMetadata' | 'Unapproved' | 'WouldDie' | 'AlreadyExists' | 'NoDeposit' | 'WouldBurn' | 'LiveAsset' | 'AssetNotLive' | 'IncorrectStatus' | 'NotFrozen' | 'CallbackFailed'; } - /** @name PalletLoAuthorityListStorageVersion (204) */ + /** @name PalletLoAuthorityListStorageVersion (205) */ interface PalletLoAuthorityListStorageVersion extends Enum { readonly isV1: boolean; readonly isV2AddOnchainSettings: boolean; @@ -1966,7 +1963,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V1' | 'V2AddOnchainSettings' | 'V3GuestLegalOfficers' | 'V4Region'; } - /** @name PalletLoAuthorityListError (205) */ + /** @name PalletLoAuthorityListError (206) */ interface PalletLoAuthorityListError extends Enum { readonly isAlreadyExists: boolean; readonly isNotFound: boolean; @@ -1980,7 +1977,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AlreadyExists' | 'NotFound' | 'PeerIdAlreadyInUse' | 'HostHasGuest' | 'GuestOfGuest' | 'HostNotFound' | 'HostCannotConvert' | 'GuestCannotUpdate' | 'CannotChangeRegion'; } - /** @name PalletLogionLocLegalOfficerCase (206) */ + /** @name PalletLogionLocLegalOfficerCase (207) */ interface PalletLogionLocLegalOfficerCase extends Struct { readonly owner: AccountId32; readonly requester: PalletLogionLocRequester; @@ -2000,7 +1997,7 @@ declare module '@polkadot/types/lookup' { readonly legalFee: Option; } - /** @name PalletLogionLocRequester (207) */ + /** @name PalletLogionLocRequester (208) */ interface PalletLogionLocRequester extends Enum { readonly isNone: boolean; readonly isAccount: boolean; @@ -2012,7 +2009,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'Account' | 'Loc' | 'OtherAccount'; } - /** @name PalletLogionLocMetadataItem (209) */ + /** @name PalletLogionLocMetadataItem (210) */ interface PalletLogionLocMetadataItem extends Struct { readonly name: H256; readonly value: H256; @@ -2021,7 +2018,7 @@ declare module '@polkadot/types/lookup' { readonly acknowledgedByVerifiedIssuer: bool; } - /** @name PalletLogionLocFile (211) */ + /** @name PalletLogionLocFile (212) */ interface PalletLogionLocFile extends Struct { readonly hash_: H256; readonly nature: H256; @@ -2031,7 +2028,7 @@ declare module '@polkadot/types/lookup' { readonly acknowledgedByVerifiedIssuer: bool; } - /** @name PalletLogionLocLocType (212) */ + /** @name PalletLogionLocLocType (213) */ interface PalletLogionLocLocType extends Enum { readonly isTransaction: boolean; readonly isIdentity: boolean; @@ -2039,7 +2036,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transaction' | 'Identity' | 'Collection'; } - /** @name PalletLogionLocLocLink (214) */ + /** @name PalletLogionLocLocLink (215) */ interface PalletLogionLocLocLink extends Struct { readonly id: u128; readonly nature: H256; @@ -2048,7 +2045,7 @@ declare module '@polkadot/types/lookup' { readonly acknowledgedByVerifiedIssuer: bool; } - /** @name PalletLogionLocLocVoidInfo (216) */ + /** @name PalletLogionLocLocVoidInfo (217) */ interface PalletLogionLocLocVoidInfo extends Struct { readonly replacer: Option; } @@ -2155,9 +2152,10 @@ declare module '@polkadot/types/lookup' { readonly isCannotLinkToSponsorship: boolean; readonly isItemNotFound: boolean; readonly isItemAlreadyAcknowledged: boolean; - readonly isCannotCloseUnacknowledged: boolean; + readonly isCannotCloseUnacknowledgedByOwner: boolean; readonly isBadTokenIssuance: boolean; - readonly type: 'AlreadyExists' | 'NotFound' | 'Unauthorized' | 'CannotMutate' | 'AlreadyClosed' | 'LinkedLocNotFound' | 'ReplacerLocNotFound' | 'AlreadyVoid' | 'ReplacerLocAlreadyVoid' | 'ReplacerLocAlreadyReplacing' | 'CannotMutateVoid' | 'UnexpectedRequester' | 'ReplacerLocWrongType' | 'InvalidSubmitter' | 'CollectionHasNoLimit' | 'WrongCollectionLoc' | 'CollectionItemAlreadyExists' | 'CollectionItemTooMuchData' | 'CollectionLimitsReached' | 'MetadataItemInvalid' | 'FileInvalid' | 'LocLinkInvalid' | 'CannotUpload' | 'MustUpload' | 'DuplicateFile' | 'MissingToken' | 'MissingFiles' | 'TermsAndConditionsLocNotFound' | 'TermsAndConditionsLocNotClosed' | 'TermsAndConditionsLocVoid' | 'DuplicateLocFile' | 'DuplicateLocMetadata' | 'DuplicateLocLink' | 'TokensRecordTooMuchData' | 'TokensRecordAlreadyExists' | 'CannotAddRecord' | 'InvalidIdentityLoc' | 'AlreadyNominated' | 'NotNominated' | 'CannotSubmit' | 'InsufficientFunds' | 'AlreadyUsed' | 'CannotLinkToSponsorship' | 'ItemNotFound' | 'ItemAlreadyAcknowledged' | 'CannotCloseUnacknowledged' | 'BadTokenIssuance'; + readonly isCannotCloseUnacknowledgedByVerifiedIssuer: boolean; + readonly type: 'AlreadyExists' | 'NotFound' | 'Unauthorized' | 'CannotMutate' | 'AlreadyClosed' | 'LinkedLocNotFound' | 'ReplacerLocNotFound' | 'AlreadyVoid' | 'ReplacerLocAlreadyVoid' | 'ReplacerLocAlreadyReplacing' | 'CannotMutateVoid' | 'UnexpectedRequester' | 'ReplacerLocWrongType' | 'InvalidSubmitter' | 'CollectionHasNoLimit' | 'WrongCollectionLoc' | 'CollectionItemAlreadyExists' | 'CollectionItemTooMuchData' | 'CollectionLimitsReached' | 'MetadataItemInvalid' | 'FileInvalid' | 'LocLinkInvalid' | 'CannotUpload' | 'MustUpload' | 'DuplicateFile' | 'MissingToken' | 'MissingFiles' | 'TermsAndConditionsLocNotFound' | 'TermsAndConditionsLocNotClosed' | 'TermsAndConditionsLocVoid' | 'DuplicateLocFile' | 'DuplicateLocMetadata' | 'DuplicateLocLink' | 'TokensRecordTooMuchData' | 'TokensRecordAlreadyExists' | 'CannotAddRecord' | 'InvalidIdentityLoc' | 'AlreadyNominated' | 'NotNominated' | 'CannotSubmit' | 'InsufficientFunds' | 'AlreadyUsed' | 'CannotLinkToSponsorship' | 'ItemNotFound' | 'ItemAlreadyAcknowledged' | 'CannotCloseUnacknowledgedByOwner' | 'BadTokenIssuance' | 'CannotCloseUnacknowledgedByVerifiedIssuer'; } /** @name PalletVerifiedRecoveryError (229) */ From 1b9732ca6e87d5771d661dc03edabab708d6ea24 Mon Sep 17 00:00:00 2001 From: Benoit Devos Date: Wed, 18 Oct 2023 16:13:49 +0200 Subject: [PATCH 2/3] feat: fix client by setting default auto-ack flag and seal. logion-network/logion-internal#1028 --- packages/client/integration/Protection.ts | 2 +- packages/client/package.json | 2 +- packages/client/src/LocClient.ts | 20 ++++++++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/client/integration/Protection.ts b/packages/client/integration/Protection.ts index ef15bf13..d8cd93c8 100644 --- a/packages/client/integration/Protection.ts +++ b/packages/client/integration/Protection.ts @@ -192,7 +192,7 @@ async function createAndCloseIdentityLoc( }); await signer.signAndSend({ signerId: legalOfficerAddress, - submittable: api.polkadot.tx.logionLoc.close(api.adapters.toLocId(identityLocId)) + submittable: api.polkadot.tx.logionLoc.close(api.adapters.toLocId(identityLocId), null, false) }); return identityLocId; } diff --git a/packages/client/package.json b/packages/client/package.json index e3ce9304..c9c3d269 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@logion/client", - "version": "0.33.0-1", + "version": "0.33.0-2", "description": "logion SDK for client applications", "main": "dist/index.js", "packageManager": "yarn@3.2.0", diff --git a/packages/client/src/LocClient.ts b/packages/client/src/LocClient.ts index 8abc22e8..fb236803 100644 --- a/packages/client/src/LocClient.ts +++ b/packages/client/src/LocClient.ts @@ -493,7 +493,7 @@ export class ClientToken { type: type as TokenType, issuance: this.issuance, }; - } + } } export interface ClientItemFile { @@ -1905,17 +1905,13 @@ export class AuthenticatedLocClient extends LocClient { } async close(parameters: { locId: UUID, seal?: string } & BlockchainSubmissionParams): Promise { - let submittable: SubmittableExtrinsic; - if(parameters.seal) { - submittable = this.nodeApi.polkadot.tx.logionLoc.closeAndSeal( - this.nodeApi.adapters.toLocId(parameters.locId), - parameters.seal, - ); - } else { - submittable = this.nodeApi.polkadot.tx.logionLoc.close( - this.nodeApi.adapters.toLocId(parameters.locId), - ); - } + const seal = parameters.seal || null; + const autoAck = false; // TODO temporarily hard-coded to keep previous behaviour. + const submittable = this.nodeApi.polkadot.tx.logionLoc.close( + this.nodeApi.adapters.toLocId(parameters.locId), + seal, + autoAck, + ); const fees = await this.nodeApi.fees.estimateWithoutStorage({ origin: this.currentAddress.address, From 7ac635c4016e2293e4c2a5e0daa1988bbe249d5f Mon Sep 17 00:00:00 2001 From: Benoit Devos Date: Thu, 19 Oct 2023 10:20:03 +0200 Subject: [PATCH 3/3] chore: remove deprecated addCollectionItemWithTermsAndConditions. logion-network/logion-internal#1028 --- packages/node-api/src/interfaces/augment-api-tx.ts | 4 ---- packages/node-api/src/interfaces/lookup.ts | 10 +--------- packages/node-api/src/interfaces/types-lookup.ts | 12 +----------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/packages/node-api/src/interfaces/augment-api-tx.ts b/packages/node-api/src/interfaces/augment-api-tx.ts index 672c3e58..eef0fdd7 100644 --- a/packages/node-api/src/interfaces/augment-api-tx.ts +++ b/packages/node-api/src/interfaces/augment-api-tx.ts @@ -247,10 +247,6 @@ declare module '@polkadot/api-base/types/submittable' { * See [`Pallet::add_collection_item`]. **/ addCollectionItem: AugmentedSubmittable<(collectionLocId: Compact | AnyNumber | Uint8Array, itemId: H256 | string | Uint8Array, itemDescription: H256 | string | Uint8Array, itemFiles: Vec | (PalletLogionLocCollectionItemFile | { name?: any; contentType?: any; size_?: any; hash_?: any } | string | Uint8Array)[], itemToken: Option | null | Uint8Array | PalletLogionLocCollectionItemToken | { tokenType?: any; tokenId?: any; tokenIssuance?: any } | string, restrictedDelivery: bool | boolean | Uint8Array, termsAndConditions: Vec | (PalletLogionLocTermsAndConditionsElement | { tcType?: any; tcLoc?: any; details?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Compact, H256, H256, Vec, Option, bool, Vec]>; - /** - * See [`Pallet::add_collection_item_with_terms_and_conditions`]. - **/ - addCollectionItemWithTermsAndConditions: AugmentedSubmittable<(collectionLocId: Compact | AnyNumber | Uint8Array, itemId: H256 | string | Uint8Array, itemDescription: H256 | string | Uint8Array, itemFiles: Vec | (PalletLogionLocCollectionItemFile | { name?: any; contentType?: any; size_?: any; hash_?: any } | string | Uint8Array)[], itemToken: Option | null | Uint8Array | PalletLogionLocCollectionItemToken | { tokenType?: any; tokenId?: any; tokenIssuance?: any } | string, restrictedDelivery: bool | boolean | Uint8Array, termsAndConditions: Vec | (PalletLogionLocTermsAndConditionsElement | { tcType?: any; tcLoc?: any; details?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Compact, H256, H256, Vec, Option, bool, Vec]>; /** * See [`Pallet::add_file`]. **/ diff --git a/packages/node-api/src/interfaces/lookup.ts b/packages/node-api/src/interfaces/lookup.ts index c316c637..6aba12d1 100644 --- a/packages/node-api/src/interfaces/lookup.ts +++ b/packages/node-api/src/interfaces/lookup.ts @@ -1444,15 +1444,7 @@ export default { restrictedDelivery: 'bool', termsAndConditions: 'Vec', }, - add_collection_item_with_terms_and_conditions: { - collectionLocId: 'Compact', - itemId: 'H256', - itemDescription: 'H256', - itemFiles: 'Vec', - itemToken: 'Option', - restrictedDelivery: 'bool', - termsAndConditions: 'Vec', - }, + __Unused13: 'Null', nominate_issuer: { issuer: 'AccountId32', identityLocId: 'Compact', diff --git a/packages/node-api/src/interfaces/types-lookup.ts b/packages/node-api/src/interfaces/types-lookup.ts index b307af5c..b78a0718 100644 --- a/packages/node-api/src/interfaces/types-lookup.ts +++ b/packages/node-api/src/interfaces/types-lookup.ts @@ -1581,16 +1581,6 @@ declare module '@polkadot/types/lookup' { readonly restrictedDelivery: bool; readonly termsAndConditions: Vec; } & Struct; - readonly isAddCollectionItemWithTermsAndConditions: boolean; - readonly asAddCollectionItemWithTermsAndConditions: { - readonly collectionLocId: Compact; - readonly itemId: H256; - readonly itemDescription: H256; - readonly itemFiles: Vec; - readonly itemToken: Option; - readonly restrictedDelivery: bool; - readonly termsAndConditions: Vec; - } & Struct; readonly isNominateIssuer: boolean; readonly asNominateIssuer: { readonly issuer: AccountId32; @@ -1650,7 +1640,7 @@ declare module '@polkadot/types/lookup' { readonly seal: Option; readonly autoAck: bool; } & Struct; - readonly type: 'CreatePolkadotIdentityLoc' | 'CreateLogionIdentityLoc' | 'CreatePolkadotTransactionLoc' | 'CreateLogionTransactionLoc' | 'CreateCollectionLoc' | 'AddMetadata' | 'AddFile' | 'AddLink' | 'MakeVoid' | 'MakeVoidAndReplace' | 'AddCollectionItem' | 'AddCollectionItemWithTermsAndConditions' | 'NominateIssuer' | 'DismissIssuer' | 'SetIssuerSelection' | 'AddTokensRecord' | 'CreateOtherIdentityLoc' | 'Sponsor' | 'WithdrawSponsorship' | 'AcknowledgeMetadata' | 'AcknowledgeFile' | 'AcknowledgeLink' | 'Close'; + readonly type: 'CreatePolkadotIdentityLoc' | 'CreateLogionIdentityLoc' | 'CreatePolkadotTransactionLoc' | 'CreateLogionTransactionLoc' | 'CreateCollectionLoc' | 'AddMetadata' | 'AddFile' | 'AddLink' | 'MakeVoid' | 'MakeVoidAndReplace' | 'AddCollectionItem' | 'NominateIssuer' | 'DismissIssuer' | 'SetIssuerSelection' | 'AddTokensRecord' | 'CreateOtherIdentityLoc' | 'Sponsor' | 'WithdrawSponsorship' | 'AcknowledgeMetadata' | 'AcknowledgeFile' | 'AcknowledgeLink' | 'Close'; } /** @name PalletLogionLocItemsParams (162) */