From b747c5055cf0ba677dc57b19edc6c8d889282f00 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Wed, 7 Sep 2022 16:24:22 +0500 Subject: [PATCH 1/2] typescript object and arg bindings no longer extend Record --- .../bindings/typescript/app/templates/types-ts.mustache | 4 ++-- .../typescript/plugin/templates/module-ts.mustache | 2 +- .../typescript/plugin/templates/types-ts.mustache | 6 +++--- .../test-cases/cases/bind/sanity/output/app-ts/types.ts | 8 ++++---- .../cases/bind/sanity/output/plugin-ts/module.ts | 8 ++++---- .../cases/bind/sanity/output/plugin-ts/types.ts | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/schema/bind/src/bindings/typescript/app/templates/types-ts.mustache b/packages/schema/bind/src/bindings/typescript/app/templates/types-ts.mustache index 5502866937..f02416fdc8 100644 --- a/packages/schema/bind/src/bindings/typescript/app/templates/types-ts.mustache +++ b/packages/schema/bind/src/bindings/typescript/app/templates/types-ts.mustache @@ -88,7 +88,7 @@ export type {{#detectKeyword}}{{type}}{{/detectKeyword}} = {{type}}Enum | {{type {{#methods}} /* URI: "{{parent.uri}}" */ -interface {{parent.type}}_Args_{{name}} extends Record { +interface {{parent.type}}_Args_{{name}} { {{#arguments}} {{name}}{{^required}}?{{/required}}: {{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}; {{/arguments}} @@ -106,7 +106,7 @@ export const {{type}} = { return client.invoke<{{#return}}{{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}{{/return}}>({ uri, method: "{{name}}", - args + args: args as unknown as Record }); }{{^last}},{{/last}} {{^last}} diff --git a/packages/schema/bind/src/bindings/typescript/plugin/templates/module-ts.mustache b/packages/schema/bind/src/bindings/typescript/plugin/templates/module-ts.mustache index 717bf883ab..2b5ca88c84 100644 --- a/packages/schema/bind/src/bindings/typescript/plugin/templates/module-ts.mustache +++ b/packages/schema/bind/src/bindings/typescript/plugin/templates/module-ts.mustache @@ -11,7 +11,7 @@ import { {{#moduleType}} {{#methods}} -export interface Args_{{name}} extends Record { +export interface Args_{{name}} { {{#arguments}} {{name}}{{^required}}?{{/required}}: {{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}; {{/arguments}} diff --git a/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache b/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache index 7dd990679c..50875ebe45 100644 --- a/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache +++ b/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache @@ -98,7 +98,7 @@ export type {{#detectKeyword}}{{type}}{{/detectKeyword}} = {{type}}Enum | {{type {{#importedModuleTypes}} {{#methods}} /* URI: "{{parent.uri}}" */ -interface {{parent.type}}_Args_{{name}} extends Record { +interface {{parent.type}}_Args_{{name}} { {{#arguments}} {{name}}{{^required}}?{{/required}}: {{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}; {{/arguments}} @@ -116,7 +116,7 @@ export const {{type}} = { return client.invoke<{{#return}}{{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}{{/return}}>({ uri: "{{parent.uri}}", method: "{{name}}", - args + args: args as unknown as Record }); }{{^last}},{{/last}} {{^last}} @@ -141,7 +141,7 @@ export class {{#detectKeyword}}{{type}}{{/detectKeyword}} { return client.invoke<{{#return}}{{#toTypescript}}{{toGraphQLType}}{{/toTypescript}}{{/return}}>({ uri: this.uri, method: "{{name}}", - args + args: args as unknown as Record }); } {{^last}} diff --git a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts index 367707c37f..7e05acf86d 100644 --- a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts +++ b/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts @@ -143,7 +143,7 @@ export type TestImport_Enum = TestImport_EnumEnum | TestImport_EnumString; /// Imported Modules START /// /* URI: "testimport.uri.eth" */ -interface TestImport_Module_Args_importedMethod extends Record { +interface TestImport_Module_Args_importedMethod { str: Types.String; optStr?: Types.String | null; u: Types.UInt; @@ -160,7 +160,7 @@ interface TestImport_Module_Args_importedMethod extends Record } /* URI: "testimport.uri.eth" */ -interface TestImport_Module_Args_anotherMethod extends Record { +interface TestImport_Module_Args_anotherMethod { arg: Array; } @@ -174,7 +174,7 @@ export const TestImport_Module = { return client.invoke({ uri, method: "importedMethod", - args + args: args as unknown as Record }); }, @@ -186,7 +186,7 @@ export const TestImport_Module = { return client.invoke({ uri, method: "anotherMethod", - args + args: args as unknown as Record }); } } diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts index d5f83d6b66..be2a490077 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts @@ -9,7 +9,7 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_moduleMethod extends Record { +export interface Args_moduleMethod { str: Types.String; optStr?: Types.String | null; en: Types.CustomEnum; @@ -23,21 +23,21 @@ export interface Args_moduleMethod extends Record { mapOfArrOfObj: Map>; } -export interface Args_objectMethod extends Record { +export interface Args_objectMethod { object: Types.AnotherType; optObject?: Types.AnotherType | null; objectArray: Array; optObjectArray?: Array | null; } -export interface Args_optionalEnvMethod extends Record { +export interface Args_optionalEnvMethod { object: Types.AnotherType; optObject?: Types.AnotherType | null; objectArray: Array; optObjectArray?: Array | null; } -export interface Args_if extends Record { +export interface Args_if { if: Types._else; } diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts index 308ec77eb0..9b0cddff40 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts @@ -156,7 +156,7 @@ export type TestImport_Enum = TestImport_EnumEnum | TestImport_EnumString; /// Imported Modules START /// /* URI: "testimport.uri.eth" */ -interface TestImport_Module_Args_importedMethod extends Record { +interface TestImport_Module_Args_importedMethod { str: Types.String; optStr?: Types.String | null; u: Types.UInt; @@ -173,7 +173,7 @@ interface TestImport_Module_Args_importedMethod extends Record } /* URI: "testimport.uri.eth" */ -interface TestImport_Module_Args_anotherMethod extends Record { +interface TestImport_Module_Args_anotherMethod { arg: Array; } @@ -191,7 +191,7 @@ export class TestImport_Module { return client.invoke({ uri: this.uri, method: "importedMethod", - args + args: args as unknown as Record }); } @@ -202,7 +202,7 @@ export class TestImport_Module { return client.invoke({ uri: this.uri, method: "anotherMethod", - args + args: args as unknown as Record }); } } From a5d42ba5b8158c9daf56fef3c48135dd14974886 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Wed, 7 Sep 2022 21:00:17 +0500 Subject: [PATCH 2/2] updated expected values in plugin codegen tests --- .../001-sanity/expected/wrap/module.ts | 4 +- .../codegen/001-sanity/expected/wrap/types.ts | 112 +++++++++--------- .../002-single-module/expected/wrap/module.ts | 2 +- .../002-single-module/expected/wrap/types.ts | 112 +++++++++--------- .../codegen/003-env/expected/wrap/module.ts | 2 +- .../expected/wrap/module.ts | 2 +- .../005-custom-config/expected/wrap/module.ts | 4 +- .../005-custom-config/expected/wrap/types.ts | 112 +++++++++--------- .../expected/wrap/module.ts | 4 +- .../expected/wrap/types.ts | 112 +++++++++--------- 10 files changed, 233 insertions(+), 233 deletions(-) diff --git a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/module.ts index 5d68d6b00e..69fb521c72 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/module.ts @@ -9,12 +9,12 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_methodOne extends Record { +export interface Args_methodOne { str: Types.String; optStr?: Types.String | null; } -export interface Args_methodTwo extends Record { +export interface Args_methodTwo { arg: Types.UInt32; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/types.ts b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/types.ts index f503d1720d..3172a4e4b0 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/types.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/wrap/types.ts @@ -159,7 +159,7 @@ export interface Ethereum_Access { /// Imported Modules START /// /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractView extends Record { +interface Ethereum_Module_Args_callContractView { address: Types.String; method: Types.String; args?: Array | null; @@ -167,7 +167,7 @@ interface Ethereum_Module_Args_callContractView extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_callContractStatic { address: Types.String; method: Types.String; args?: Array | null; @@ -176,72 +176,72 @@ interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_getBalance { address: Types.String; blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeParams extends Record { +interface Ethereum_Module_Args_encodeParams { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeFunction extends Record { +interface Ethereum_Module_Args_encodeFunction { method: Types.String; args?: Array | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityPack extends Record { +interface Ethereum_Module_Args_solidityPack { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityKeccak256 extends Record { +interface Ethereum_Module_Args_solidityKeccak256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_soliditySha256 extends Record { +interface Ethereum_Module_Args_soliditySha256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerAddress extends Record { +interface Ethereum_Module_Args_getSignerAddress { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerBalance extends Record { +interface Ethereum_Module_Args_getSignerBalance { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerTransactionCount extends Record { +interface Ethereum_Module_Args_getSignerTransactionCount { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getGasPrice extends Record { +interface Ethereum_Module_Args_getGasPrice { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateTransactionGas extends Record { +interface Ethereum_Module_Args_estimateTransactionGas { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_estimateContractCallGas { address: Types.String; method: Types.String; args?: Array | null; @@ -250,22 +250,22 @@ interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_checkAddress { address: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toWei extends Record { +interface Ethereum_Module_Args_toWei { eth: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toEth extends Record { +interface Ethereum_Module_Args_toEth { wei: Types.BigInt; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_awaitTransaction extends Record { +interface Ethereum_Module_Args_awaitTransaction { txHash: Types.String; confirmations: Types.UInt32; timeout: Types.UInt32; @@ -273,7 +273,7 @@ interface Ethereum_Module_Args_awaitTransaction extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_waitForEvent extends Record { +interface Ethereum_Module_Args_waitForEvent { address: Types.String; event: Types.String; args?: Array | null; @@ -282,17 +282,17 @@ interface Ethereum_Module_Args_waitForEvent extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getNetwork extends Record { +interface Ethereum_Module_Args_getNetwork { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_requestAccounts extends Record { +interface Ethereum_Module_Args_requestAccounts { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethod { address: Types.String; method: Types.String; args?: Array | null; @@ -301,7 +301,7 @@ interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethodAndWait { address: Types.String; method: Types.String; args?: Array | null; @@ -310,19 +310,19 @@ interface Ethereum_Module_Args_callContractMethodAndWait extends Record { +interface Ethereum_Module_Args_sendTransaction { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendTransactionAndWait extends Record { +interface Ethereum_Module_Args_sendTransactionAndWait { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_deployContract extends Record { +interface Ethereum_Module_Args_deployContract { abi: Types.String; bytecode: Types.String; args?: Array | null; @@ -330,13 +330,13 @@ interface Ethereum_Module_Args_deployContract extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_signMessage extends Record { +interface Ethereum_Module_Args_signMessage { message: Types.String; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendRPC extends Record { +interface Ethereum_Module_Args_sendRPC { method: Types.String; params: Array; connection?: Types.Ethereum_Connection | null; @@ -351,7 +351,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractView", - args + args: args as unknown as Record }); }, @@ -362,7 +362,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractStatic", - args + args: args as unknown as Record }); }, @@ -373,7 +373,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getBalance", - args + args: args as unknown as Record }); }, @@ -384,7 +384,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeParams", - args + args: args as unknown as Record }); }, @@ -395,7 +395,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeFunction", - args + args: args as unknown as Record }); }, @@ -406,7 +406,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityPack", - args + args: args as unknown as Record }); }, @@ -417,7 +417,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityKeccak256", - args + args: args as unknown as Record }); }, @@ -428,7 +428,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "soliditySha256", - args + args: args as unknown as Record }); }, @@ -439,7 +439,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerAddress", - args + args: args as unknown as Record }); }, @@ -450,7 +450,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerBalance", - args + args: args as unknown as Record }); }, @@ -461,7 +461,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerTransactionCount", - args + args: args as unknown as Record }); }, @@ -472,7 +472,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getGasPrice", - args + args: args as unknown as Record }); }, @@ -483,7 +483,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateTransactionGas", - args + args: args as unknown as Record }); }, @@ -494,7 +494,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateContractCallGas", - args + args: args as unknown as Record }); }, @@ -505,7 +505,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "checkAddress", - args + args: args as unknown as Record }); }, @@ -516,7 +516,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toWei", - args + args: args as unknown as Record }); }, @@ -527,7 +527,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toEth", - args + args: args as unknown as Record }); }, @@ -538,7 +538,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "awaitTransaction", - args + args: args as unknown as Record }); }, @@ -549,7 +549,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "waitForEvent", - args + args: args as unknown as Record }); }, @@ -560,7 +560,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getNetwork", - args + args: args as unknown as Record }); }, @@ -571,7 +571,7 @@ export const Ethereum_Module = { return client.invoke>({ uri: "ens/ethereum.polywrap.eth", method: "requestAccounts", - args + args: args as unknown as Record }); }, @@ -582,7 +582,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethod", - args + args: args as unknown as Record }); }, @@ -593,7 +593,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethodAndWait", - args + args: args as unknown as Record }); }, @@ -604,7 +604,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransaction", - args + args: args as unknown as Record }); }, @@ -615,7 +615,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransactionAndWait", - args + args: args as unknown as Record }); }, @@ -626,7 +626,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "deployContract", - args + args: args as unknown as Record }); }, @@ -637,7 +637,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "signMessage", - args + args: args as unknown as Record }); }, @@ -648,7 +648,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendRPC", - args + args: args as unknown as Record }); } } diff --git a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/module.ts index cc9669e5be..d180a0c0e0 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/module.ts @@ -9,7 +9,7 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_method extends Record { +export interface Args_method { str: Types.String; optStr?: Types.String | null; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/types.ts b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/types.ts index f503d1720d..3172a4e4b0 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/types.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/wrap/types.ts @@ -159,7 +159,7 @@ export interface Ethereum_Access { /// Imported Modules START /// /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractView extends Record { +interface Ethereum_Module_Args_callContractView { address: Types.String; method: Types.String; args?: Array | null; @@ -167,7 +167,7 @@ interface Ethereum_Module_Args_callContractView extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_callContractStatic { address: Types.String; method: Types.String; args?: Array | null; @@ -176,72 +176,72 @@ interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_getBalance { address: Types.String; blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeParams extends Record { +interface Ethereum_Module_Args_encodeParams { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeFunction extends Record { +interface Ethereum_Module_Args_encodeFunction { method: Types.String; args?: Array | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityPack extends Record { +interface Ethereum_Module_Args_solidityPack { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityKeccak256 extends Record { +interface Ethereum_Module_Args_solidityKeccak256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_soliditySha256 extends Record { +interface Ethereum_Module_Args_soliditySha256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerAddress extends Record { +interface Ethereum_Module_Args_getSignerAddress { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerBalance extends Record { +interface Ethereum_Module_Args_getSignerBalance { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerTransactionCount extends Record { +interface Ethereum_Module_Args_getSignerTransactionCount { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getGasPrice extends Record { +interface Ethereum_Module_Args_getGasPrice { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateTransactionGas extends Record { +interface Ethereum_Module_Args_estimateTransactionGas { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_estimateContractCallGas { address: Types.String; method: Types.String; args?: Array | null; @@ -250,22 +250,22 @@ interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_checkAddress { address: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toWei extends Record { +interface Ethereum_Module_Args_toWei { eth: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toEth extends Record { +interface Ethereum_Module_Args_toEth { wei: Types.BigInt; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_awaitTransaction extends Record { +interface Ethereum_Module_Args_awaitTransaction { txHash: Types.String; confirmations: Types.UInt32; timeout: Types.UInt32; @@ -273,7 +273,7 @@ interface Ethereum_Module_Args_awaitTransaction extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_waitForEvent extends Record { +interface Ethereum_Module_Args_waitForEvent { address: Types.String; event: Types.String; args?: Array | null; @@ -282,17 +282,17 @@ interface Ethereum_Module_Args_waitForEvent extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getNetwork extends Record { +interface Ethereum_Module_Args_getNetwork { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_requestAccounts extends Record { +interface Ethereum_Module_Args_requestAccounts { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethod { address: Types.String; method: Types.String; args?: Array | null; @@ -301,7 +301,7 @@ interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethodAndWait { address: Types.String; method: Types.String; args?: Array | null; @@ -310,19 +310,19 @@ interface Ethereum_Module_Args_callContractMethodAndWait extends Record { +interface Ethereum_Module_Args_sendTransaction { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendTransactionAndWait extends Record { +interface Ethereum_Module_Args_sendTransactionAndWait { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_deployContract extends Record { +interface Ethereum_Module_Args_deployContract { abi: Types.String; bytecode: Types.String; args?: Array | null; @@ -330,13 +330,13 @@ interface Ethereum_Module_Args_deployContract extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_signMessage extends Record { +interface Ethereum_Module_Args_signMessage { message: Types.String; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendRPC extends Record { +interface Ethereum_Module_Args_sendRPC { method: Types.String; params: Array; connection?: Types.Ethereum_Connection | null; @@ -351,7 +351,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractView", - args + args: args as unknown as Record }); }, @@ -362,7 +362,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractStatic", - args + args: args as unknown as Record }); }, @@ -373,7 +373,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getBalance", - args + args: args as unknown as Record }); }, @@ -384,7 +384,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeParams", - args + args: args as unknown as Record }); }, @@ -395,7 +395,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeFunction", - args + args: args as unknown as Record }); }, @@ -406,7 +406,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityPack", - args + args: args as unknown as Record }); }, @@ -417,7 +417,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityKeccak256", - args + args: args as unknown as Record }); }, @@ -428,7 +428,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "soliditySha256", - args + args: args as unknown as Record }); }, @@ -439,7 +439,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerAddress", - args + args: args as unknown as Record }); }, @@ -450,7 +450,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerBalance", - args + args: args as unknown as Record }); }, @@ -461,7 +461,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerTransactionCount", - args + args: args as unknown as Record }); }, @@ -472,7 +472,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getGasPrice", - args + args: args as unknown as Record }); }, @@ -483,7 +483,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateTransactionGas", - args + args: args as unknown as Record }); }, @@ -494,7 +494,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateContractCallGas", - args + args: args as unknown as Record }); }, @@ -505,7 +505,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "checkAddress", - args + args: args as unknown as Record }); }, @@ -516,7 +516,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toWei", - args + args: args as unknown as Record }); }, @@ -527,7 +527,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toEth", - args + args: args as unknown as Record }); }, @@ -538,7 +538,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "awaitTransaction", - args + args: args as unknown as Record }); }, @@ -549,7 +549,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "waitForEvent", - args + args: args as unknown as Record }); }, @@ -560,7 +560,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getNetwork", - args + args: args as unknown as Record }); }, @@ -571,7 +571,7 @@ export const Ethereum_Module = { return client.invoke>({ uri: "ens/ethereum.polywrap.eth", method: "requestAccounts", - args + args: args as unknown as Record }); }, @@ -582,7 +582,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethod", - args + args: args as unknown as Record }); }, @@ -593,7 +593,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethodAndWait", - args + args: args as unknown as Record }); }, @@ -604,7 +604,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransaction", - args + args: args as unknown as Record }); }, @@ -615,7 +615,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransactionAndWait", - args + args: args as unknown as Record }); }, @@ -626,7 +626,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "deployContract", - args + args: args as unknown as Record }); }, @@ -637,7 +637,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "signMessage", - args + args: args as unknown as Record }); }, @@ -648,7 +648,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendRPC", - args + args: args as unknown as Record }); } } diff --git a/packages/test-cases/cases/cli/plugin/codegen/003-env/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/003-env/expected/wrap/module.ts index adb37990bf..9cd107891c 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/003-env/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/003-env/expected/wrap/module.ts @@ -9,7 +9,7 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_method extends Record { +export interface Args_method { str: Types.String; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/004-env-sanitization/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/004-env-sanitization/expected/wrap/module.ts index adb37990bf..9cd107891c 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/004-env-sanitization/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/004-env-sanitization/expected/wrap/module.ts @@ -9,7 +9,7 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_method extends Record { +export interface Args_method { str: Types.String; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/module.ts index 5d68d6b00e..69fb521c72 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/module.ts @@ -9,12 +9,12 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_methodOne extends Record { +export interface Args_methodOne { str: Types.String; optStr?: Types.String | null; } -export interface Args_methodTwo extends Record { +export interface Args_methodTwo { arg: Types.UInt32; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/types.ts b/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/types.ts index f503d1720d..3172a4e4b0 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/types.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/005-custom-config/expected/wrap/types.ts @@ -159,7 +159,7 @@ export interface Ethereum_Access { /// Imported Modules START /// /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractView extends Record { +interface Ethereum_Module_Args_callContractView { address: Types.String; method: Types.String; args?: Array | null; @@ -167,7 +167,7 @@ interface Ethereum_Module_Args_callContractView extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_callContractStatic { address: Types.String; method: Types.String; args?: Array | null; @@ -176,72 +176,72 @@ interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_getBalance { address: Types.String; blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeParams extends Record { +interface Ethereum_Module_Args_encodeParams { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeFunction extends Record { +interface Ethereum_Module_Args_encodeFunction { method: Types.String; args?: Array | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityPack extends Record { +interface Ethereum_Module_Args_solidityPack { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityKeccak256 extends Record { +interface Ethereum_Module_Args_solidityKeccak256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_soliditySha256 extends Record { +interface Ethereum_Module_Args_soliditySha256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerAddress extends Record { +interface Ethereum_Module_Args_getSignerAddress { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerBalance extends Record { +interface Ethereum_Module_Args_getSignerBalance { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerTransactionCount extends Record { +interface Ethereum_Module_Args_getSignerTransactionCount { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getGasPrice extends Record { +interface Ethereum_Module_Args_getGasPrice { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateTransactionGas extends Record { +interface Ethereum_Module_Args_estimateTransactionGas { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_estimateContractCallGas { address: Types.String; method: Types.String; args?: Array | null; @@ -250,22 +250,22 @@ interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_checkAddress { address: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toWei extends Record { +interface Ethereum_Module_Args_toWei { eth: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toEth extends Record { +interface Ethereum_Module_Args_toEth { wei: Types.BigInt; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_awaitTransaction extends Record { +interface Ethereum_Module_Args_awaitTransaction { txHash: Types.String; confirmations: Types.UInt32; timeout: Types.UInt32; @@ -273,7 +273,7 @@ interface Ethereum_Module_Args_awaitTransaction extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_waitForEvent extends Record { +interface Ethereum_Module_Args_waitForEvent { address: Types.String; event: Types.String; args?: Array | null; @@ -282,17 +282,17 @@ interface Ethereum_Module_Args_waitForEvent extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getNetwork extends Record { +interface Ethereum_Module_Args_getNetwork { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_requestAccounts extends Record { +interface Ethereum_Module_Args_requestAccounts { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethod { address: Types.String; method: Types.String; args?: Array | null; @@ -301,7 +301,7 @@ interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethodAndWait { address: Types.String; method: Types.String; args?: Array | null; @@ -310,19 +310,19 @@ interface Ethereum_Module_Args_callContractMethodAndWait extends Record { +interface Ethereum_Module_Args_sendTransaction { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendTransactionAndWait extends Record { +interface Ethereum_Module_Args_sendTransactionAndWait { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_deployContract extends Record { +interface Ethereum_Module_Args_deployContract { abi: Types.String; bytecode: Types.String; args?: Array | null; @@ -330,13 +330,13 @@ interface Ethereum_Module_Args_deployContract extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_signMessage extends Record { +interface Ethereum_Module_Args_signMessage { message: Types.String; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendRPC extends Record { +interface Ethereum_Module_Args_sendRPC { method: Types.String; params: Array; connection?: Types.Ethereum_Connection | null; @@ -351,7 +351,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractView", - args + args: args as unknown as Record }); }, @@ -362,7 +362,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractStatic", - args + args: args as unknown as Record }); }, @@ -373,7 +373,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getBalance", - args + args: args as unknown as Record }); }, @@ -384,7 +384,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeParams", - args + args: args as unknown as Record }); }, @@ -395,7 +395,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeFunction", - args + args: args as unknown as Record }); }, @@ -406,7 +406,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityPack", - args + args: args as unknown as Record }); }, @@ -417,7 +417,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityKeccak256", - args + args: args as unknown as Record }); }, @@ -428,7 +428,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "soliditySha256", - args + args: args as unknown as Record }); }, @@ -439,7 +439,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerAddress", - args + args: args as unknown as Record }); }, @@ -450,7 +450,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerBalance", - args + args: args as unknown as Record }); }, @@ -461,7 +461,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerTransactionCount", - args + args: args as unknown as Record }); }, @@ -472,7 +472,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getGasPrice", - args + args: args as unknown as Record }); }, @@ -483,7 +483,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateTransactionGas", - args + args: args as unknown as Record }); }, @@ -494,7 +494,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateContractCallGas", - args + args: args as unknown as Record }); }, @@ -505,7 +505,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "checkAddress", - args + args: args as unknown as Record }); }, @@ -516,7 +516,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toWei", - args + args: args as unknown as Record }); }, @@ -527,7 +527,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toEth", - args + args: args as unknown as Record }); }, @@ -538,7 +538,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "awaitTransaction", - args + args: args as unknown as Record }); }, @@ -549,7 +549,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "waitForEvent", - args + args: args as unknown as Record }); }, @@ -560,7 +560,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getNetwork", - args + args: args as unknown as Record }); }, @@ -571,7 +571,7 @@ export const Ethereum_Module = { return client.invoke>({ uri: "ens/ethereum.polywrap.eth", method: "requestAccounts", - args + args: args as unknown as Record }); }, @@ -582,7 +582,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethod", - args + args: args as unknown as Record }); }, @@ -593,7 +593,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethodAndWait", - args + args: args as unknown as Record }); }, @@ -604,7 +604,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransaction", - args + args: args as unknown as Record }); }, @@ -615,7 +615,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransactionAndWait", - args + args: args as unknown as Record }); }, @@ -626,7 +626,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "deployContract", - args + args: args as unknown as Record }); }, @@ -637,7 +637,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "signMessage", - args + args: args as unknown as Record }); }, @@ -648,7 +648,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendRPC", - args + args: args as unknown as Record }); } } diff --git a/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/module.ts b/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/module.ts index 5d68d6b00e..69fb521c72 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/module.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/module.ts @@ -9,12 +9,12 @@ import { MaybeAsync } from "@polywrap/core-js"; -export interface Args_methodOne extends Record { +export interface Args_methodOne { str: Types.String; optStr?: Types.String | null; } -export interface Args_methodTwo extends Record { +export interface Args_methodTwo { arg: Types.UInt32; } diff --git a/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/types.ts b/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/types.ts index f503d1720d..3172a4e4b0 100644 --- a/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/types.ts +++ b/packages/test-cases/cases/cli/plugin/codegen/006-custom-manifest-file/expected/wrap/types.ts @@ -159,7 +159,7 @@ export interface Ethereum_Access { /// Imported Modules START /// /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractView extends Record { +interface Ethereum_Module_Args_callContractView { address: Types.String; method: Types.String; args?: Array | null; @@ -167,7 +167,7 @@ interface Ethereum_Module_Args_callContractView extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_callContractStatic { address: Types.String; method: Types.String; args?: Array | null; @@ -176,72 +176,72 @@ interface Ethereum_Module_Args_callContractStatic extends Record { +interface Ethereum_Module_Args_getBalance { address: Types.String; blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeParams extends Record { +interface Ethereum_Module_Args_encodeParams { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_encodeFunction extends Record { +interface Ethereum_Module_Args_encodeFunction { method: Types.String; args?: Array | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityPack extends Record { +interface Ethereum_Module_Args_solidityPack { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_solidityKeccak256 extends Record { +interface Ethereum_Module_Args_solidityKeccak256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_soliditySha256 extends Record { +interface Ethereum_Module_Args_soliditySha256 { types: Array; values: Array; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerAddress extends Record { +interface Ethereum_Module_Args_getSignerAddress { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerBalance extends Record { +interface Ethereum_Module_Args_getSignerBalance { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getSignerTransactionCount extends Record { +interface Ethereum_Module_Args_getSignerTransactionCount { blockTag?: Types.BigInt | null; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getGasPrice extends Record { +interface Ethereum_Module_Args_getGasPrice { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateTransactionGas extends Record { +interface Ethereum_Module_Args_estimateTransactionGas { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_estimateContractCallGas { address: Types.String; method: Types.String; args?: Array | null; @@ -250,22 +250,22 @@ interface Ethereum_Module_Args_estimateContractCallGas extends Record { +interface Ethereum_Module_Args_checkAddress { address: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toWei extends Record { +interface Ethereum_Module_Args_toWei { eth: Types.String; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_toEth extends Record { +interface Ethereum_Module_Args_toEth { wei: Types.BigInt; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_awaitTransaction extends Record { +interface Ethereum_Module_Args_awaitTransaction { txHash: Types.String; confirmations: Types.UInt32; timeout: Types.UInt32; @@ -273,7 +273,7 @@ interface Ethereum_Module_Args_awaitTransaction extends Record } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_waitForEvent extends Record { +interface Ethereum_Module_Args_waitForEvent { address: Types.String; event: Types.String; args?: Array | null; @@ -282,17 +282,17 @@ interface Ethereum_Module_Args_waitForEvent extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_getNetwork extends Record { +interface Ethereum_Module_Args_getNetwork { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_requestAccounts extends Record { +interface Ethereum_Module_Args_requestAccounts { connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethod { address: Types.String; method: Types.String; args?: Array | null; @@ -301,7 +301,7 @@ interface Ethereum_Module_Args_callContractMethod extends Record { +interface Ethereum_Module_Args_callContractMethodAndWait { address: Types.String; method: Types.String; args?: Array | null; @@ -310,19 +310,19 @@ interface Ethereum_Module_Args_callContractMethodAndWait extends Record { +interface Ethereum_Module_Args_sendTransaction { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendTransactionAndWait extends Record { +interface Ethereum_Module_Args_sendTransactionAndWait { tx: Types.Ethereum_TxRequest; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_deployContract extends Record { +interface Ethereum_Module_Args_deployContract { abi: Types.String; bytecode: Types.String; args?: Array | null; @@ -330,13 +330,13 @@ interface Ethereum_Module_Args_deployContract extends Record { } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_signMessage extends Record { +interface Ethereum_Module_Args_signMessage { message: Types.String; connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.polywrap.eth" */ -interface Ethereum_Module_Args_sendRPC extends Record { +interface Ethereum_Module_Args_sendRPC { method: Types.String; params: Array; connection?: Types.Ethereum_Connection | null; @@ -351,7 +351,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractView", - args + args: args as unknown as Record }); }, @@ -362,7 +362,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractStatic", - args + args: args as unknown as Record }); }, @@ -373,7 +373,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getBalance", - args + args: args as unknown as Record }); }, @@ -384,7 +384,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeParams", - args + args: args as unknown as Record }); }, @@ -395,7 +395,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "encodeFunction", - args + args: args as unknown as Record }); }, @@ -406,7 +406,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityPack", - args + args: args as unknown as Record }); }, @@ -417,7 +417,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "solidityKeccak256", - args + args: args as unknown as Record }); }, @@ -428,7 +428,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "soliditySha256", - args + args: args as unknown as Record }); }, @@ -439,7 +439,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerAddress", - args + args: args as unknown as Record }); }, @@ -450,7 +450,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerBalance", - args + args: args as unknown as Record }); }, @@ -461,7 +461,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getSignerTransactionCount", - args + args: args as unknown as Record }); }, @@ -472,7 +472,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getGasPrice", - args + args: args as unknown as Record }); }, @@ -483,7 +483,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateTransactionGas", - args + args: args as unknown as Record }); }, @@ -494,7 +494,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "estimateContractCallGas", - args + args: args as unknown as Record }); }, @@ -505,7 +505,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "checkAddress", - args + args: args as unknown as Record }); }, @@ -516,7 +516,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toWei", - args + args: args as unknown as Record }); }, @@ -527,7 +527,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "toEth", - args + args: args as unknown as Record }); }, @@ -538,7 +538,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "awaitTransaction", - args + args: args as unknown as Record }); }, @@ -549,7 +549,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "waitForEvent", - args + args: args as unknown as Record }); }, @@ -560,7 +560,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "getNetwork", - args + args: args as unknown as Record }); }, @@ -571,7 +571,7 @@ export const Ethereum_Module = { return client.invoke>({ uri: "ens/ethereum.polywrap.eth", method: "requestAccounts", - args + args: args as unknown as Record }); }, @@ -582,7 +582,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethod", - args + args: args as unknown as Record }); }, @@ -593,7 +593,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "callContractMethodAndWait", - args + args: args as unknown as Record }); }, @@ -604,7 +604,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransaction", - args + args: args as unknown as Record }); }, @@ -615,7 +615,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendTransactionAndWait", - args + args: args as unknown as Record }); }, @@ -626,7 +626,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "deployContract", - args + args: args as unknown as Record }); }, @@ -637,7 +637,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "signMessage", - args + args: args as unknown as Record }); }, @@ -648,7 +648,7 @@ export const Ethereum_Module = { return client.invoke({ uri: "ens/ethereum.polywrap.eth", method: "sendRPC", - args + args: args as unknown as Record }); } }