Skip to content

Commit

Permalink
chore: add new rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco committed Mar 18, 2024
1 parent e7c16c3 commit 1360e80
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 30 deletions.
52 changes: 52 additions & 0 deletions packages/type-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,43 @@ export const mTypes = {
symbol: "Vec<u8>"
},
TokenId: "u32",
L1Update: {
pendingDeposits: "Vec<Deposit>",
pendingCancelResultions: "Vec<CancelResolution>",
pendingWithdrawalResolutions: "Vec<WithdrawalResolution>",
pendingL2UpdatesToRemove: "Vec<L2UpdatesToRemove>",
},
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<u128>",
blockHash: "H256"
}
};

export const mRpc = {
Expand Down Expand Up @@ -310,6 +347,21 @@ export const mRpc = {
}
],
type: "bool"
},
update_eth_raw: {
description: "",
params: [
{
name: "payload",
type: "Vec<u8>"
},
{
name: 'at',
type: 'Hash',
isOptional: true
}
],
type: "Option<L1Update>"
}
},
metamask: {
Expand Down
95 changes: 65 additions & 30 deletions packages/types/src/interfaces/definitions.ts
Original file line number Diff line number Diff line change
@@ -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<BlockNumber>",
stateRoot: "Hash",
extrinsicsRoot: "Hash",
digest: "Digest",
seed: "ShufflingSeed",
count: "BlockNumber"
},
RpcAssetMetadata: {
tokenId: "TokenId",
decimals: "u32",
name: "Vec<u8>",
symbol: "Vec<u8>"
},
TokenId: "u32",
ShufflingSeed: {
seed: "H256",
proof: "H512"
},
MultiSignature: {
_enum: {
Ed25519: 'Ed25519Signature',
Sr25519: 'Sr25519Signature',
Ecdsa: 'EcdsaSignature',
Eth: 'EcdsaSignature',
}
},
Header: {
parentHash: "Hash",
number: "Compact<BlockNumber>",
stateRoot: "Hash",
extrinsicsRoot: "Hash",
digest: "Digest",
seed: "ShufflingSeed",
count: "BlockNumber"
},
RpcAssetMetadata: {
tokenId: "TokenId",
decimals: "u32",
name: "Vec<u8>",
symbol: "Vec<u8>"
},
TokenId: "u32",
L1Update: {
pendingDeposits: "Vec<Deposit>",
pendingCancelResultions: "Vec<CancelResolution>",
pendingWithdrawalResolutions: "Vec<WithdrawalResolution>",
pendingL2UpdatesToRemove: "Vec<L2UpdatesToRemove>",
},
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<u128>",
blockHash: "H256"
}
}
};


export { default as pos } from './pos/definitions.js';
Expand Down
15 changes: 15 additions & 0 deletions packages/types/src/interfaces/rolldown/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ export default {
}
],
type: "bool"
},
update_eth_raw: {
description: "",
params: [
{
name: "payload",
type: "Vec<u8>"
},
{
name: 'at',
type: 'Hash',
isOptional: true
}
],
type: "Option<L1Update>"
}
}
}

0 comments on commit 1360e80

Please sign in to comment.