From d243a61b0276966212323a3c57ad769d65068a4e Mon Sep 17 00:00:00 2001 From: Shunji Zhan Date: Wed, 7 Feb 2024 16:01:51 +0800 Subject: [PATCH 1/2] add runtime types for acount call and create --- .../src/interfaces/runtime/definitions.ts | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index d79ac93..37f0e73 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -96,6 +96,78 @@ const acalaRuntimeDefs: Definitions = { params: [], type: 'BlockLimits', }, + account_call: { + description: 'call evm contract', + params: [ + { + name: 'from', + type: 'AccountId', + }, + { + name: 'to', + type: 'H160', + }, + { + name: 'data', + type: 'Vec', + }, + { + name: 'value', + type: 'Balance', + }, + { + name: 'gas_limit', + type: 'u64', + }, + { + name: 'storage_limit', + type: 'u32', + }, + { + name: 'access_list', + type: 'Option>', + }, + { + name: 'estimate', + type: 'bool', + }, + ], + type: 'Result', + }, + account_create: { + description: 'create evm contract', + params: [ + { + name: 'from', + type: 'AccountId', + }, + { + name: 'data', + type: 'Vec', + }, + { + name: 'value', + type: 'Balance', + }, + { + name: 'gas_limit', + type: 'u64', + }, + { + name: 'storage_limit', + type: 'u32', + }, + { + name: 'access_list', + type: 'Option>', + }, + { + name: 'estimate', + type: 'bool', + }, + ], + type: 'Result', + }, }, }, ], From d2d26727c74c719ca5012f6dc623f912a877fc4a Mon Sep 17 00:00:00 2001 From: Shunji Zhan Date: Wed, 7 Feb 2024 16:06:07 +0800 Subject: [PATCH 2/2] generate TS types --- packages/types/package.json | 2 +- packages/types/src/interfaces/augment-api-runtime.ts | 8 ++++++++ packages/types/src/interfaces/runtime/definitions.ts | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/types/package.json b/packages/types/package.json index fe0024d..8ed0404 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@acala-network/types", - "version": "6.1.0", + "version": "6.1.1-0", "description": "Acala types for @polkadot/api", "author": "Acala Developers ", "license": "Apache-2.0", diff --git a/packages/types/src/interfaces/augment-api-runtime.ts b/packages/types/src/interfaces/augment-api-runtime.ts index 788e152..514623e 100644 --- a/packages/types/src/interfaces/augment-api-runtime.ts +++ b/packages/types/src/interfaces/augment-api-runtime.ts @@ -109,6 +109,14 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0xe3df3f2aa8a5cc57/2 */ evmRuntimeRPCApi: { + /** + * call evm contract from substrate account + **/ + accountCall: AugmentedCall> | null | Uint8Array | Vec | (EthereumTransactionAccessListItem | { address?: any; storageKeys?: any } | string | Uint8Array)[], estimate: bool | boolean | Uint8Array) => Observable>>; + /** + * create evm contract from substrate account + **/ + accountCreate: AugmentedCall> | null | Uint8Array | Vec | (EthereumTransactionAccessListItem | { address?: any; storageKeys?: any } | string | Uint8Array)[], estimate: bool | boolean | Uint8Array) => Observable>>; /** * evm block limits **/ diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 37f0e73..a4e077e 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -97,7 +97,7 @@ const acalaRuntimeDefs: Definitions = { type: 'BlockLimits', }, account_call: { - description: 'call evm contract', + description: 'call evm contract from substrate account', params: [ { name: 'from', @@ -135,7 +135,7 @@ const acalaRuntimeDefs: Definitions = { type: 'Result', }, account_create: { - description: 'create evm contract', + description: 'create evm contract from substrate account', params: [ { name: 'from',