From 1360e802ee04a0a152d9fd7da0fc22681db867bf Mon Sep 17 00:00:00 2001 From: devdanco Date: Mon, 18 Mar 2024 16:44:42 +0100 Subject: [PATCH] chore: add new rpc --- packages/type-definitions/src/index.ts | 52 ++++++++++ packages/types/src/interfaces/definitions.ts | 95 +++++++++++++------ .../src/interfaces/rolldown/definitions.ts | 15 +++ 3 files changed, 132 insertions(+), 30 deletions(-) diff --git a/packages/type-definitions/src/index.ts b/packages/type-definitions/src/index.ts index 7de79d8..b157a20 100644 --- a/packages/type-definitions/src/index.ts +++ b/packages/type-definitions/src/index.ts @@ -29,6 +29,43 @@ export const mTypes = { symbol: "Vec" }, TokenId: "u32", + L1Update: { + pendingDeposits: "Vec", + pendingCancelResultions: "Vec", + pendingWithdrawalResolutions: "Vec", + pendingL2UpdatesToRemove: "Vec", + }, + Deposit: { + requestId: "RequestId", + depositRecipient: "[u8; 20]", + tokenAddress: "[u8; 20]", + amount: "U256", + blockHash: "H256" + }, + RequestId: { + origin: "Origin", + id: "u128" + }, + Origin: { + _enum: ['L1', 'L2'] + }, + CancelResolution: { + requestId: "RequestId", + l2RequestId: "u128", + cancelJustified: "bool", + blockHash: "H256" + }, + WithdrawalResolution: { + requestId: "RequestId", + l2RequestId: "u128", + status: "bool", + blockHash: "H256" + }, + L2UpdatesToRemove: { + requestId: "RequestId", + l2UpdatesToRemove: "Vec", + blockHash: "H256" + } }; export const mRpc = { @@ -310,6 +347,21 @@ export const mRpc = { } ], type: "bool" + }, + update_eth_raw: { + description: "", + params: [ + { + name: "payload", + type: "Vec" + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: "Option" } }, metamask: { diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 9608692..40121e8 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -1,35 +1,70 @@ export default { - types: { - ShufflingSeed: { - seed: "H256", - proof: "H512" - }, - MultiSignature: { - _enum: { - Ed25519: 'Ed25519Signature', - Sr25519: 'Sr25519Signature', - Ecdsa: 'EcdsaSignature', - Eth: 'EcdsaSignature', - } - }, - Header: { - parentHash: "Hash", - number: "Compact", - stateRoot: "Hash", - extrinsicsRoot: "Hash", - digest: "Digest", - seed: "ShufflingSeed", - count: "BlockNumber" - }, - RpcAssetMetadata: { - tokenId: "TokenId", - decimals: "u32", - name: "Vec", - symbol: "Vec" - }, - TokenId: "u32", + ShufflingSeed: { + seed: "H256", + proof: "H512" + }, + MultiSignature: { + _enum: { + Ed25519: 'Ed25519Signature', + Sr25519: 'Sr25519Signature', + Ecdsa: 'EcdsaSignature', + Eth: 'EcdsaSignature', + } + }, + Header: { + parentHash: "Hash", + number: "Compact", + stateRoot: "Hash", + extrinsicsRoot: "Hash", + digest: "Digest", + seed: "ShufflingSeed", + count: "BlockNumber" + }, + RpcAssetMetadata: { + tokenId: "TokenId", + decimals: "u32", + name: "Vec", + symbol: "Vec" + }, + TokenId: "u32", + L1Update: { + pendingDeposits: "Vec", + pendingCancelResultions: "Vec", + pendingWithdrawalResolutions: "Vec", + pendingL2UpdatesToRemove: "Vec", + }, + Deposit: { + requestId: "RequestId", + depositRecipient: "[u8; 20]", + tokenAddress: "[u8; 20]", + amount: "U256", + blockHash: "H256" + }, + RequestId: { + origin: "Origin", + id: "u128" + }, + Origin: { + _enum: ['L1', 'L2'] + }, + CancelResolution: { + requestId: "RequestId", + l2RequestId: "u128", + cancelJustified: "bool", + blockHash: "H256" + }, + WithdrawalResolution: { + requestId: "RequestId", + l2RequestId: "u128", + status: "bool", + blockHash: "H256" + }, + L2UpdatesToRemove: { + requestId: "RequestId", + l2UpdatesToRemove: "Vec", + blockHash: "H256" } -} +}; export { default as pos } from './pos/definitions.js'; diff --git a/packages/types/src/interfaces/rolldown/definitions.ts b/packages/types/src/interfaces/rolldown/definitions.ts index 3e3d22f..d3d651a 100644 --- a/packages/types/src/interfaces/rolldown/definitions.ts +++ b/packages/types/src/interfaces/rolldown/definitions.ts @@ -41,6 +41,21 @@ export default { } ], type: "bool" + }, + update_eth_raw: { + description: "", + params: [ + { + name: "payload", + type: "Vec" + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: "Option" } } } \ No newline at end of file