diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index f19aee9..75a64f4 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -21,7 +21,6 @@ "@crustio/type-definitions": "1.3.0", "@darwinia/types": "2.8.10", "@darwinia/types-known": "2.8.10", - "@digitalnative/type-definitions": "1.1.27", "@docknetwork/node-types": "0.16.0", "@edgeware/node-types": "3.6.2-wako", "@equilab/definitions": "1.4.18", @@ -31,7 +30,6 @@ "@jamton/teyrchain-ts-interfaces": "npm:@jamton/parachain-ts-interfaces@1.10.4", "@kiltprotocol/type-definitions": "^1.11502.1", "@laminar/type-definitions": "0.3.1", - "@logion/node-api": "0.27.0-4", "@mangata-finance/type-definitions": "^2.1.2", "@metaverse-network-sdk/type-definitions": "0.0.1-16", "@moonbeam-network/types-bundle": "1.0.2", diff --git a/packages/apps-config/src/api/spec/logion.ts b/packages/apps-config/src/api/spec/logion.ts index 76c6f47..f5e8f3e 100644 --- a/packages/apps-config/src/api/spec/logion.ts +++ b/packages/apps-config/src/api/spec/logion.ts @@ -4,9 +4,492 @@ // structs need to be in order /* eslint-disable sort-keys */ -import type { OverrideBundleDefinition } from '@pezkuwi/types/types'; +import type { DefinitionsTypes, OverrideBundleDefinition, RegistryTypes } from '@pezkuwi/types/types'; -import logionDefault, { runtime as logionRuntime, session as logionSession } from '@logion/node-api/interfaces/definitions'; +// The type definitions @logion/node-api 0.27.0-4 (Apache-2.0, logion-network/logion-api) +// exports from interfaces/definitions, kept here as data: the package itself depends on +// an old @polkadot/api tree. +// RegistryTypes does not model a struct's `_alias` map (TransactionInfo), which the +// registry accepts; the package's own declarations hid that by typing these narrowly. +const logionDefault: { types: DefinitionsTypes } = { types: { + OpaquePeerId: 'Vec', + AccountInfo: 'AccountInfoWithDualRefCount', + TAssetBalance: 'u128', + AssetDetails: { + owner: 'AccountId', + issuer: 'AccountId', + admin: 'AccountId', + freezer: 'AccountId', + supply: 'Balance', + deposit: 'DepositBalance', + max_zombies: 'u32', + min_balance: 'Balance', + zombies: 'u32', + accounts: 'u32', + is_frozen: 'bool' + }, + AssetMetadata: { + deposit: 'DepositBalance', + name: 'Vec', + symbol: 'Vec', + decimals: 'u8' + }, + LocId: 'u128', + LegalOfficerCaseOf: { + owner: 'AccountId', + requester: 'Requester', + metadata: 'Vec', + files: 'Vec', + closed: 'bool', + loc_type: 'LocType', + links: 'Vec', + void_info: 'Option>', + replacer_of: 'Option', + collection_last_block_submission: 'Option', + collection_max_size: 'Option', + collection_can_upload: 'bool', + seal: 'Option', + sponsorship_id: 'Option', + value_fee: 'Balance', + legal_fee: 'Balance', + collection_item_fee: 'Balance', + tokens_record_fee: 'Balance' + }, + MetadataItemParams: { + name: 'Hash', + value: 'Hash', + submitter: 'SupportedAccountId' + }, + MetadataItem: { + name: 'Hash', + value: 'Hash', + submitter: 'SupportedAccountId', + acknowledgedByOwner: 'bool', + acknowledgedByVerifiedIssuer: 'bool' + }, + LocType: { + _enum: [ + 'Transaction', + 'Identity', + 'Collection' + ] + }, + LocLinkParams: { + id: 'LocId', + nature: 'Hash', + submitter: 'SupportedAccountId' + }, + LocLink: { + id: 'LocId', + nature: 'Hash', + submitter: 'SupportedAccountId', + acknowledgedByOwner: 'bool', + acknowledgedByVerifiedIssuer: 'bool' + }, + FileParams: { + hash: 'Hash', + nature: 'Hash', + submitter: 'SupportedAccountId' + }, + File: { + hash: 'Hash', + nature: 'Hash', + submitter: 'SupportedAccountId', + acknowledgedByOwner: 'bool', + acknowledgedByVerifiedIssuer: 'bool' + }, + LocVoidInfo: { + replacer: 'Option' + }, + StorageVersion: { + _enum: [ + 'V1', + 'V2MakeLocVoid', + 'V3RequesterEnum', + 'V4ItemSubmitter', + 'V5Collection', + 'V6ItemUpload', + 'V7ItemToken', + 'V8AddSeal', + 'V9TermsAndConditions', + 'V10AddLocFileSize', + 'V11EnableEthereumSubmitter', + 'V12Sponsorship', + 'V13AcknowledgeItems', + 'V14HashLocPublicData', + 'V15AddTokenIssuance', + 'V16MoveTokenIssuance', + 'V17HashItemRecordPublicData', + 'V18AddValueFee', + 'V19AcknowledgeItemsByIssuer', + 'V20AddCustomLegalFee', + 'V21EnableRequesterLinks', + 'V22AddRecurrentFees' + ] + }, + Requester: { + _enum: { + None: null, + Account: 'AccountId', + Loc: 'LocId', + OtherAccount: 'OtherAccountId' + } + }, + CollectionSize: 'u32', + CollectionItemId: 'Hash', + CollectionItem: { + description: 'Hash', + files: 'Vec', + token: 'Option', + restricted_delivery: 'bool', + terms_and_conditions: 'Vec' + }, + TokenIssuance: 'u64', + CollectionItemFile: { + name: 'Hash', + content_type: 'Hash', + fileSize: 'u32', + hash: 'Hash' + }, + CollectionItemToken: { + token_type: 'Hash', + token_id: 'Hash', + token_issuance: 'TokenIssuance' + }, + LegalOfficerData: { + _enum: { + Host: 'HostData', + Guest: 'AccountId' + } + }, + HostData: { + node_id: 'Option', + base_url: 'Option>', + region: 'Region' + }, + Region: { + _enum: [ + 'Europe' + ] + }, + LoAuthorityListStorageVersion: { + _enum: [ + 'V1', + 'V2AddOnchainSettings', + 'V3GuestLegalOfficers', + 'V4Region' + ] + }, + TermsAndConditionsElement: { + tcType: 'Hash', + tcLoc: 'LocId', + details: 'Hash' + }, + LogionVote: { + locId: 'LocId', + ballots: 'Vec' + }, + Ballot: { + voter: 'LocId', + status: 'AccountId' + }, + BallotStatus: { + _enum: [ + 'NotVoted', + 'VotedYes', + 'VotedNo' + ] + }, + VoteId: 'u64', + VoteClosed: 'bool', + VoteApproved: 'bool', + LegalOfficerCaseSummary: { + owner: 'AccountId', + requester: 'Option' + }, + TokensRecord: { + description: 'Hash', + files: 'Vec', + submitter: 'AccountId' + }, + TokensRecordFile: { + name: 'Hash', + contentType: 'Hash', + file_size: 'u32', + hash: 'Hash' + }, + VerifiedIssuer: { + identityLoc: 'LocId' + }, + OtherAccountId: { + _enum: { + Ethereum: 'H160' + } + }, + SupportedAccountId: { + _enum: { + None: null, + Polkadot: 'AccountId', + Other: 'OtherAccountId' + } + }, + SponsorshipId: 'u128', + Sponsorship: { + sponsor: 'AccountId', + sponsored_account: 'SupportedAccountId', + legal_officer: 'AccountId', + loc_id: 'Option' + }, + Beneficiary: { + _enum: { + Other: null, + LegalOfficer: 'AccountId' + } + }, + ItemsParams: { + metadata: 'Vec', + files: 'Vec', + links: 'Vec' + } +} }; + +const logionRuntime: { types: DefinitionsTypes } = { types: { + Fixed64: 'Int<64, Fixed64>', + FixedI64: 'Int<64, FixedI64>', + FixedU64: 'UInt<64, FixedU64>', + Fixed128: 'Int<128, Fixed128>', + FixedI128: 'Int<128, FixedI128>', + FixedU128: 'UInt<128, FixedU128>', + I32F32: 'Int<64, I32F32>', + U32F32: 'UInt<64, U32F32>', + PerU16: 'UInt<16, PerU16>', + Perbill: 'UInt<32, Perbill>', + Percent: 'UInt<8, Percent>', + Permill: 'UInt<32, Permill>', + Perquintill: 'UInt<64, Perquintill>', + AccountId: 'AccountId32', + AccountId20: 'GenericEthereumAccountId', + AccountId32: 'GenericAccountId32', + AccountId33: 'GenericAccountId33', + AccountIdOf: 'AccountId', + AccountIndex: 'GenericAccountIndex', + Address: 'MultiAddress', + AssetId: 'u64', + Balance: 'UInt<128, Balance>', + BalanceOf: 'Balance', + Block: 'GenericBlock', + BlockNumber: 'u32', + BlockNumberFor: 'BlockNumber', + BlockNumberOf: 'BlockNumber', + Call: 'GenericCall', + CallHash: 'Hash', + CallHashOf: 'CallHash', + ChangesTrieConfiguration: { + digestInterval: 'u32', + digestLevels: 'u32' + }, + ChangesTrieSignal: { + _enum: { + NewConfiguration: 'Option' + } + }, + ConsensusEngineId: 'GenericConsensusEngineId', + CodecHash: 'Hash', + CrateVersion: { + major: 'u16', + minor: 'u8', + patch: 'u8' + }, + Digest: { + logs: 'Vec' + }, + DigestItem: { + _enum: { + Other: 'Bytes', + AuthoritiesChange: 'Vec', + ChangesTrieRoot: 'Hash', + SealV0: 'SealV0', + Consensus: 'Consensus', + Seal: 'Seal', + PreRuntime: 'PreRuntime', + ChangesTrieSignal: 'ChangesTrieSignal', + RuntimeEnvironmentUpdated: 'Null' + } + }, + ExtrinsicsWeight: { + normal: 'Weight', + operational: 'Weight' + }, + H32: '[u8; 4; H32]', + H64: '[u8; 8; H64]', + H128: '[u8; 16; H128]', + H160: '[u8; 20; H160]', + H256: '[u8; 32; H256]', + H512: '[u8; 64; H512]', + H1024: '[u8; 128; H1024]', + H2048: '[u8; 256; H2048]', + Hash: 'H256', + Header: { + parentHash: 'Hash', + number: 'Compact', + stateRoot: 'Hash', + extrinsicsRoot: 'Hash', + digest: 'Digest' + }, + HeaderPartial: { + parentHash: 'Hash', + number: 'BlockNumber' + }, + IndicesLookupSource: 'GenericLookupSource', + Index: 'u32', + Justification: '(ConsensusEngineId, EncodedJustification)', + EncodedJustification: 'Bytes', + Justifications: 'Vec', + KeyValue: '(StorageKey, StorageData)', + KeyTypeId: 'u32', + LockIdentifier: '[u8; 8]', + LookupSource: 'MultiAddress', + LookupTarget: 'AccountId', + ModuleId: 'LockIdentifier', + MultiAddress: 'GenericMultiAddress', + MultiSigner: { + _enum: { + Ed25519: '[u8; 32]', + Sr25519: '[u8; 32]', + Ecdsa: '[u8; 33]' + } + }, + Moment: 'UInt<64, Moment>', + OpaqueCall: 'Bytes', + Origin: 'DoNotConstruct', + OriginCaller: { + _enum: { + System: 'SystemOrigin' + } + }, + PalletId: 'LockIdentifier', + PalletsOrigin: 'OriginCaller', + PalletVersion: { + major: 'u16', + minor: 'u8', + patch: 'u8' + }, + Pays: { + _enum: [ + 'Yes', + 'No' + ] + }, + Phantom: 'Null', + PhantomData: 'Null', + Releases: { + _enum: [ + 'V1', + 'V2', + 'V3', + 'V4', + 'V5', + 'V6', + 'V7', + 'V8', + 'V9', + 'V10' + ] + }, + RuntimeCall: 'Call', + RuntimeEvent: 'Event', + RuntimeDbWeight: { + read: 'Weight', + write: 'Weight' + }, + SignedBlock: 'SignedBlockWithJustifications', + SignedBlockWithJustification: { + block: 'Block', + justification: 'Option' + }, + SignedBlockWithJustifications: { + block: 'Block', + justifications: 'Option' + }, + Slot: 'u64', + SlotDuration: 'u64', + StorageData: 'Bytes', + StorageInfo: { + palletName: 'Bytes', + storage_name: 'Bytes', + prefix: 'Bytes', + maxValues: 'Option', + maxSize: 'Option' + }, + StorageProof: { + trieNodes: 'Vec' + }, + TransactionPriority: 'u64', + TransactionLongevity: 'u64', + TransactionTag: 'Bytes', + TransactionInfo: { + _alias: { + dataSize: 'size' + }, + chunkRoot: 'H256', + contentHash: 'H256', + dataSize: 'u32', + blockChunks: 'u32' + }, + TransactionStorageProof: { + chunk: 'Vec', + proof: 'Vec>' + }, + ValidatorId: 'AccountId', + ValidatorIdOf: 'ValidatorId', + WeightV0: 'u32', + WeightV1: 'u64', + WeightV2: { + refTime: 'Compact', + proofSize: 'Compact' + }, + Weight: 'WeightV2', + WeightMultiplier: 'Fixed64', + PreRuntime: '(ConsensusEngineId, Bytes)', + SealV0: '(u64, Signature)', + Seal: '(ConsensusEngineId, Bytes)', + Consensus: '(ConsensusEngineId, Bytes)', + ExtrinsicInclusionMode: { + _enum: [ + 'AllExtrinsics', + 'OnlyInherents' + ] + } +} }; + +const logionSession: { types: DefinitionsTypes } = { types: { + BeefyKey: '[u8; 33]', + Keys: 'SessionKeys2', + SessionKeys1: '(AccountId)', + SessionKeys2: '(AccountId, AccountId)', + SessionKeys3: '(AccountId, AccountId, AccountId)', + SessionKeys4: '(AccountId, AccountId, AccountId, AccountId)', + SessionKeys5: '(AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys6: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys6B: '(AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)', + SessionKeys7: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys7B: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)', + SessionKeys8: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys8B: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)', + SessionKeys9: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys9B: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)', + SessionKeys10: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)', + SessionKeys10B: '(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)', + FullIdentification: 'Exposure', + IdentificationTuple: '(ValidatorId, FullIdentification)', + MembershipProof: { + session: 'SessionIndex', + trieNodes: 'Vec', + validatorCount: 'ValidatorCount' + }, + SessionIndex: 'u32', + ValidatorCount: 'u32' +} }; const defaultTypesUpTo109 = { Address: 'MultiAddress', @@ -329,7 +812,7 @@ const definitions: OverrideBundleDefinition = { ...logionDefault.types, ...logionRuntime.types, ...logionSession.types - } + } as RegistryTypes } ] }; diff --git a/packages/apps-config/src/api/spec/opportunity.ts b/packages/apps-config/src/api/spec/opportunity.ts index aee8b9b..2157bae 100644 --- a/packages/apps-config/src/api/spec/opportunity.ts +++ b/packages/apps-config/src/api/spec/opportunity.ts @@ -1,9 +1,92 @@ // Copyright 2017-2026 @pezkuwi/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 +// structs need to be in order +/* eslint-disable sort-keys */ + import type { OverrideBundleDefinition } from '@pezkuwi/types/types'; -// @ts-expect-error No definitions provided in package -import { opportunityTypes } from '@digitalnative/type-definitions'; +// The opportunityTypes bundle of @digitalnative/type-definitions 1.1.27 (MIT, Digital Native), +// kept here as data: the package depends on an old @polkadot/api tree. +const definitions: OverrideBundleDefinition = { + types: [ + { + minmax: [ + 0, + undefined + ], + types: { + AccountInfo: 'AccountInfoWithTripleRefCount', + Address: 'MultiAddress', + LookupSource: 'MultiAddress', + Account: { + nonce: 'U256', + balance: 'U256' + }, + Transaction: { + nonce: 'U256', + action: 'String', + gas_price: 'u64', + gas_limit: 'u64', + value: 'U256', + input: 'Vec', + signature: 'Signature' + }, + Signature: { + v: 'u64', + r: 'H256', + s: 'H256' + }, + XCurrencyId: { + chain_id: 'ChainId', + currency_id: 'Bytes' + }, + CurrencyIdOf: 'CurrencyId', + CurrencyId: { + _enum: { + Token: 'TokenSymbol' + } + }, + TokenSymbol: { + _enum: [ + 'ACA', + 'AUSD', + 'DOT', + 'XBTC', + 'LDOT', + 'RENBTC', + 'SDN', + 'PLM' + ] + }, + AmountOf: 'Amount', + Amount: 'i128', + DataVersion: 'u64', + RequestIdentifier: 'u64', + SpecIndex: 'Vec', + CDP: { + liquidation_fee: 'Balance', + max_collateraization_rate: 'U256', + stability_fee: 'Balance' + }, + SocketIndex: 'i32', + Currency: 'Balances', + BridgeChainId: 'u8', + ResourceId: '[u8; 32]', + DepositNonce: 'u64', + ProposalVotes: { + votes_for: 'Vec', + votes_against: 'Vec', + status: 'enum' + }, + Erc721Token: { + id: 'TokenId', + metadata: 'Vec' + }, + TokenId: 'U256' + } + } + ] +}; -export default opportunityTypes as OverrideBundleDefinition; +export default definitions; diff --git a/packages/apps-config/src/api/spec/standard.ts b/packages/apps-config/src/api/spec/standard.ts index c5ae7ee..a7f68c4 100644 --- a/packages/apps-config/src/api/spec/standard.ts +++ b/packages/apps-config/src/api/spec/standard.ts @@ -1,9 +1,92 @@ // Copyright 2017-2026 @pezkuwi/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 +// structs need to be in order +/* eslint-disable sort-keys */ + import type { OverrideBundleDefinition } from '@pezkuwi/types/types'; -// @ts-expect-error No definitions provided in package -import { standardTypes } from '@digitalnative/type-definitions'; +// The standardTypes bundle of @digitalnative/type-definitions 1.1.27 (MIT, Digital Native), +// kept here as data: the package depends on an old @polkadot/api tree. +const definitions: OverrideBundleDefinition = { + types: [ + { + minmax: [ + 0, + undefined + ], + types: { + AccountInfo: 'AccountInfoWithTripleRefCount', + Address: 'MultiAddress', + LookupSource: 'MultiAddress', + Account: { + nonce: 'U256', + balance: 'U256' + }, + Transaction: { + nonce: 'U256', + action: 'String', + gas_price: 'u64', + gas_limit: 'u64', + value: 'U256', + input: 'Vec', + signature: 'Signature' + }, + Signature: { + v: 'u64', + r: 'H256', + s: 'H256' + }, + XCurrencyId: { + chain_id: 'ChainId', + currency_id: 'Bytes' + }, + CurrencyIdOf: 'CurrencyId', + CurrencyId: { + _enum: { + Token: 'TokenSymbol' + } + }, + TokenSymbol: { + _enum: [ + 'ACA', + 'AUSD', + 'DOT', + 'XBTC', + 'LDOT', + 'RENBTC', + 'SDN', + 'PLM' + ] + }, + AmountOf: 'Amount', + Amount: 'i128', + DataVersion: 'u64', + RequestIdentifier: 'u64', + SpecIndex: 'Vec', + CDP: { + liquidation_fee: 'Balance', + max_collateraization_rate: 'U256', + stability_fee: 'Balance' + }, + SocketIndex: 'i32', + Currency: 'Balances', + BridgeChainId: 'u8', + ResourceId: '[u8; 32]', + DepositNonce: 'u64', + ProposalVotes: { + votes_for: 'Vec', + votes_against: 'Vec', + status: 'enum' + }, + Erc721Token: { + id: 'TokenId', + metadata: 'Vec' + }, + TokenId: 'U256' + } + } + ] +}; -export default standardTypes as OverrideBundleDefinition; +export default definitions;