From 737cd2a445d0e3745b63b5cb63890c8f622d5d30 Mon Sep 17 00:00:00 2001 From: JQQQ Date: Tue, 2 Jul 2024 11:57:27 +1200 Subject: [PATCH] fix avail chaintype name --- chainTypes/availChaintypes.ts | 181 ++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 chainTypes/availChaintypes.ts diff --git a/chainTypes/availChaintypes.ts b/chainTypes/availChaintypes.ts new file mode 100644 index 00000000..b30bef4e --- /dev/null +++ b/chainTypes/availChaintypes.ts @@ -0,0 +1,181 @@ +import { OverrideBundleDefinition } from "@polkadot/types/types"; + +const definitions: OverrideBundleDefinition = { + types: [ + { + minmax: [0, undefined], + types: { + AppId: "Compact", + DataLookupItem: { + appId: "AppId", + start: "Compact", + }, + CompactDataLookup: { + size: "Compact", + index: "Vec", + }, + KateCommitment: { + rows: "Compact", + cols: "Compact", + commitment: "Vec", + dataRoot: "H256", + }, + V3HeaderExtension: { + appLookup: "CompactDataLookup", + commitment: "KateCommitment", + }, + HeaderExtension: { + _enum: { + V1: null, + V2: null, + V3: "V3HeaderExtension", + }, + }, + DaHeader: { + parentHash: "Hash", + number: "Compact", + stateRoot: "Hash", + extrinsicsRoot: "Hash", + digest: "Digest", + extension: "HeaderExtension", + }, + Header: "DaHeader", + CheckAppIdExtra: { + appId: "AppId", + }, + CheckAppIdTypes: {}, + CheckAppId: { + extra: "CheckAppIdExtra", + types: "CheckAppIdTypes", + }, + BlockLengthColumns: "Compact", + BlockLengthRows: "Compact", + BlockLength: { + max: "PerDispatchClass", + cols: "BlockLengthColumns", + rows: "BlockLengthRows", + chunkSize: "Compact", + }, + PerDispatchClass: { + normal: "u32", + operational: "u32", + mandatory: "u32", + }, + DataProof: { + roots: "TxDataRoots", + proof: "Vec", + numberOfLeaves: "Compact", + leafIndex: "Compact", + leaf: "H256", + }, + TxDataRoots: { + dataRoot: "H256", + blobRoot: "H256", + bridgeRoot: "H256", + }, + ProofResponse: { + dataProof: "DataProof", + message: "Option", + }, + AddressedMessage: { + message: "Message", + from: "H256", + to: "H256", + originDomain: "u32", + destinationDomain: "u32", + id: "u64", + }, + Message: { + _enum: { + ArbitraryMessage: "ArbitraryMessage", + FungibleToken: "FungibleToken", + }, + }, + MessageType: { + _enum: ["ArbitraryMessage", "FungibleToken"], + }, + FungibleToken: { + assetId: "H256", + amount: "String", + }, + BoundedData: "Vec", + ArbitraryMessage: "BoundedData", + Cell: { + row: "u32", + col: "u32", + }, + }, + }, + ], + rpc: { + kate: { + blockLength: { + description: "Get Block Length", + params: [ + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "BlockLength", + }, + queryProof: { + description: "Generate the kate proof for the given `cells`", + params: [ + { + name: "cells", + type: "Vec", + }, + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "Vec<(U256, [u8; 48])>", + }, + queryDataProof: { + description: + "Generate the data proof for the given `transaction_index`", + params: [ + { + name: "transaction_index", + type: "u32", + }, + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "ProofResponse", + }, + queryRows: { + description: "Query rows based on their indices", + params: [ + { + name: "rows", + type: "Vec", + }, + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "Vec>", + }, + }, + }, + signedExtensions: { + CheckAppId: { + extrinsic: { + appId: "AppId", + }, + payload: {}, + }, + }, +}; + +export default { typesBundle: { spec: { avail: definitions } } }; diff --git a/package.json b/package.json index 6375197e..a872c00e 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "bittensorChaintypes": "./chainTypes/bittensorChainTypes.ts", "calamariChainTypes": "./chainTypes/calamariChainTypes.ts", "westmintChaintypes": "./chainTypes/westmintChaintypes.ts", - "availChainTypes": "./chainTypes/availChainTypes.ts" + "availChaintypes": "./chainTypes/availChaintypes.ts" }, "resolutions": { "ipfs-unixfs": "6.0.6"