From bc0d4f8099cb764f88127170c3e8d23c837d90ac Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Thu, 19 Aug 2021 12:58:01 -0500 Subject: [PATCH 1/2] plugin-ts codegen fix --- .../cli/src/__tests__/project/sample-types.ts | 375 ------------------ .../bind/src/bindings/plugin-ts/functions.ts | 4 +- packages/schema/parse/src/validate/types.ts | 2 +- yarn.lock | 9 +- 4 files changed, 3 insertions(+), 387 deletions(-) delete mode 100644 packages/cli/src/__tests__/project/sample-types.ts diff --git a/packages/cli/src/__tests__/project/sample-types.ts b/packages/cli/src/__tests__/project/sample-types.ts deleted file mode 100644 index 55ba42d882..0000000000 --- a/packages/cli/src/__tests__/project/sample-types.ts +++ /dev/null @@ -1,375 +0,0 @@ -import { Client, PluginModule } from "@web3api/core-js"; - -export interface QueryModule extends PluginModule { - getData: ( - input: Input_getData - ) => number; -} - -export interface Input_getData { - address: string; - connection?: Types.Ethereum_Connection | null; -} -export interface MutationModule extends PluginModule { - setData: ( - input: Input_setData - ) => Types.SetDataResult; - deployContract: ( - input: Input_deployContract - ) => string; -} - -export interface Input_setData { - options: Types.SetDataOptions; - connection?: Types.Ethereum_Connection | null; -} -export interface Input_deployContract { - connection?: Types.Ethereum_Connection | null; -} - -export const schema = `### Web3API Header START ### -scalar UInt -scalar UInt8 -scalar UInt16 -scalar UInt32 -scalar UInt64 -scalar Int -scalar Int8 -scalar Int16 -scalar Int32 -scalar Int64 -scalar Bytes -scalar BigInt - -directive @imported( - uri: String! - namespace: String! - nativeType: String! -) on OBJECT | ENUM - -directive @imports( - types: [String!]! -) on OBJECT -### Web3API Header END ### - -type Query @imports( - types: [ - "Ethereum_Query", - "Ethereum_Connection", - "Ethereum_TxOverrides", - "Ethereum_StaticTxResult", - "Ethereum_TxRequest", - "Ethereum_TxReceipt", - "Ethereum_Log", - "Ethereum_EventNotification" - ] -) { - getData( - address: String! - connection: Ethereum_Connection - ): UInt32! -} - -type Mutation @imports( - types: [ - "Ethereum_Mutation", - "Ethereum_Connection", - "Ethereum_TxOverrides", - "Ethereum_TxResponse", - "Ethereum_Access", - "Ethereum_TxReceipt", - "Ethereum_Log", - "Ethereum_TxRequest" - ] -) { - setData( - options: SetDataOptions! - connection: Ethereum_Connection - ): SetDataResult! - - deployContract( - connection: Ethereum_Connection - ): String! -} - -type SetDataOptions { - address: String! - value: UInt32! -} - -type SetDataResult { - txReceipt: String! - value: UInt32! -} - -### Imported Queries START ### - -type Ethereum_Query @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "Query" -) { - callContractView( - address: String! - method: String! - args: [String!] - connection: Ethereum_Connection - ): String! - - callContractStatic( - address: String! - method: String! - args: [String!] - connection: Ethereum_Connection - txOverrides: Ethereum_TxOverrides - ): Ethereum_StaticTxResult! - - encodeParams( - types: [String!]! - values: [String!]! - ): String! - - getSignerAddress( - connection: Ethereum_Connection - ): String! - - getSignerBalance( - blockTag: BigInt - connection: Ethereum_Connection - ): BigInt! - - getSignerTransactionCount( - blockTag: BigInt - connection: Ethereum_Connection - ): BigInt! - - getGasPrice( - connection: Ethereum_Connection - ): BigInt! - - estimateTransactionGas( - tx: Ethereum_TxRequest! - connection: Ethereum_Connection - ): BigInt! - - estimateContractCallGas( - address: String! - method: String! - args: [String!] - connection: Ethereum_Connection - txOverrides: Ethereum_TxOverrides - ): BigInt! - - checkAddress( - address: String! - ): Boolean! - - toWei( - eth: String! - ): BigInt! - - toEth( - wei: BigInt! - ): String! - - awaitTransaction( - txHash: String! - confirmations: UInt32! - timeout: UInt32! - connection: Ethereum_Connection - ): Ethereum_TxReceipt! - - waitForEvent( - address: String! - event: String! - args: [String!] - timeout: UInt32 - connection: Ethereum_Connection - ): Ethereum_EventNotification! -} - -type Ethereum_Mutation @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "Mutation" -) { - callContractMethod( - address: String! - method: String! - args: [String!] - connection: Ethereum_Connection - txOverrides: Ethereum_TxOverrides - ): Ethereum_TxResponse! - - callContractMethodAndWait( - address: String! - method: String! - args: [String!] - connection: Ethereum_Connection - txOverrides: Ethereum_TxOverrides - ): Ethereum_TxReceipt! - - sendTransaction( - tx: Ethereum_TxRequest! - connection: Ethereum_Connection - ): Ethereum_TxResponse! - - sendTransactionAndWait( - tx: Ethereum_TxRequest! - connection: Ethereum_Connection - ): Ethereum_TxReceipt! - - deployContract( - abi: String! - bytecode: String! - args: [String!] - connection: Ethereum_Connection - ): String! - - signMessage( - message: String! - connection: Ethereum_Connection - ): String! - - sendRPC( - method: String! - params: [String!]! - connection: Ethereum_Connection - ): String -} - -### Imported Queries END ### - -### Imported Objects START ### - -type Ethereum_Connection @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "Connection" -) { - node: String - networkNameOrChainId: String -} - -type Ethereum_TxOverrides @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "TxOverrides" -) { - gasLimit: BigInt - gasPrice: BigInt - value: BigInt -} - -type Ethereum_StaticTxResult @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "StaticTxResult" -) { - result: String! - error: Boolean! -} - -type Ethereum_TxRequest @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "TxRequest" -) { - to: String - from: String - nonce: UInt32 - gasLimit: BigInt - gasPrice: BigInt - data: String - value: BigInt - chainId: UInt32 - type: UInt32 -} - -type Ethereum_TxReceipt @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "TxReceipt" -) { - to: String! - from: String! - contractAddress: String! - transactionIndex: UInt32! - root: String - gasUsed: BigInt! - logsBloom: String! - transactionHash: String! - logs: [Ethereum_Log!]! - blockNumber: BigInt! - blockHash: String! - confirmations: UInt32! - cumulativeGasUsed: BigInt! - effectiveGasPrice: BigInt! - byzantium: Boolean! - type: UInt32! - status: UInt32 -} - -type Ethereum_Log @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "Log" -) { - blockNumber: BigInt! - blockHash: String! - transactionIndex: UInt32! - removed: Boolean! - address: String! - data: String! - topics: [String!]! - transactionHash: String! - logIndex: UInt32! -} - -type Ethereum_EventNotification @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "EventNotification" -) { - data: String! - address: String! - log: Ethereum_Log! -} - -type Ethereum_TxResponse @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "TxResponse" -) { - hash: String! - to: String - from: String! - nonce: UInt32! - gasLimit: BigInt! - gasPrice: BigInt - data: String! - value: BigInt! - chainId: UInt32! - blockNumber: BigInt - blockHash: String - timestamp: UInt32 - confirmations: UInt32! - raw: String - r: String - s: String - v: UInt32 - type: UInt32 - accessList: [Ethereum_Access!] -} - -type Ethereum_Access @imported( - uri: "w3://ens/ethereum.web3api.eth", - namespace: "Ethereum", - nativeType: "Access" -) { - address: String! - storageKeys: [String!]! -} - -### Imported Objects END ### -`; \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/plugin-ts/functions.ts b/packages/schema/bind/src/bindings/plugin-ts/functions.ts index d1d472ca2a..1f6ae267ae 100644 --- a/packages/schema/bind/src/bindings/plugin-ts/functions.ts +++ b/packages/schema/bind/src/bindings/plugin-ts/functions.ts @@ -20,12 +20,10 @@ export const toTypescript: MustacheFunction = () => { case "Int8": case "Int16": case "Int32": - case "Int64": case "UInt": case "UInt32": case "UInt8": case "UInt16": - case "UInt64": case "String": case "Boolean": case "Bytes": @@ -56,7 +54,7 @@ const toTypescriptArray = (type: string, nullable: boolean): string => { const applyNullable = (type: string, nullable: boolean): string => { if (nullable) { - return `${type} | undefined`; + return `${type} | null`; } else { return type; } diff --git a/packages/schema/parse/src/validate/types.ts b/packages/schema/parse/src/validate/types.ts index d4412e7e30..c7e3489202 100644 --- a/packages/schema/parse/src/validate/types.ts +++ b/packages/schema/parse/src/validate/types.ts @@ -65,7 +65,7 @@ export const getTypeDefinitionsValidator = (): SchemaValidator => { ScalarTypeDefinition: (node: ScalarTypeDefinitionNode) => { if (!isScalarType(node.name.value)) { throw Error( - `Custom scalar types are not supported. Supported scalars: ${scalarTypeNames}` + `Custom scalar types are not supported. Found: "${node.name.value}". Supported scalars: ${scalarTypeNames}` ); } }, diff --git a/yarn.lock b/yarn.lock index 31f0334013..2eac9411cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3865,7 +3865,7 @@ dependencies: "@types/node" "*" -"@types/semver@^7.3.4": +"@types/semver@7.3.8": version "7.3.8" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.8.tgz#508a27995498d7586dcecd77c25e289bfaf90c59" integrity sha512-D/2EJvAlCEtYFEYmmlGwbGXuK886HzyCc3nZX/tkFTQdEU8jZDAgiv08P162yB17y4ZXZoq7yFAnW4GDBb9Now== @@ -17329,13 +17329,6 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.3.4: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== - dependencies: - lru-cache "^6.0.0" - semver@7.3.5, semver@7.x, semver@^7.0.0, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" From 355674d2a2dbc28c7cacf289531a7de65c25e58e Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Thu, 19 Aug 2021 14:01:20 -0500 Subject: [PATCH 2/2] prep 0.0.1-prealpha.33 --- CHANGELOG.md | 4 ++ VERSION | 2 +- .../__tests__/plugin/expected-types/query.ts | 2 +- .../__tests__/plugin/expected-types/types.ts | 72 +++++++++---------- .../bind/sanity/output/plugin-ts/mutation.ts | 12 ++-- .../bind/sanity/output/plugin-ts/query.ts | 12 ++-- .../bind/sanity/output/plugin-ts/types.ts | 64 ++++++++--------- 7 files changed, 86 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ab63e498..08cff2eee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Web3API 0.0.1-prealpha.33 +## Bugs +* `@web3api/schema-bind`: Fixed plugin code generation oversight. Should be using `null` instead of `undefined`. + # Web3API 0.0.1-prealpha.32 ## Features * Improved the plugin developer experience by creating a new `w3 plugin codegen` command, which generated types based on the plugin's schema. For an example of how this works, see the updated plugin template project by running `w3 create plugin typescript my-plugin`. diff --git a/VERSION b/VERSION index 57961ef83a..cd26a18ba1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1-prealpha.32 \ No newline at end of file +0.0.1-prealpha.33 \ No newline at end of file diff --git a/packages/cli/src/__tests__/plugin/expected-types/query.ts b/packages/cli/src/__tests__/plugin/expected-types/query.ts index 8621ad7150..4694c2d51d 100644 --- a/packages/cli/src/__tests__/plugin/expected-types/query.ts +++ b/packages/cli/src/__tests__/plugin/expected-types/query.ts @@ -23,7 +23,7 @@ import { export interface Input_method extends Record { str: String; - optStr?: String | undefined; + optStr?: String | null; } export interface Module extends PluginModule { diff --git a/packages/cli/src/__tests__/plugin/expected-types/types.ts b/packages/cli/src/__tests__/plugin/expected-types/types.ts index 6a474eb31a..c728a32b10 100644 --- a/packages/cli/src/__tests__/plugin/expected-types/types.ts +++ b/packages/cli/src/__tests__/plugin/expected-types/types.ts @@ -22,22 +22,22 @@ export type Boolean = boolean; export interface Object { u: UInt; array: Array; - bytes?: Bytes | undefined; + bytes?: Bytes | null; } /// Imported Objects START /// /* URI: "ens/ethereum.web3api.eth" */ export interface Ethereum_Connection { - node?: String | undefined; - networkNameOrChainId?: String | undefined; + node?: String | null; + networkNameOrChainId?: String | null; } /* URI: "ens/ethereum.web3api.eth" */ export interface Ethereum_TxOverrides { - gasLimit?: BigInt | undefined; - gasPrice?: BigInt | undefined; - value?: BigInt | undefined; + gasLimit?: BigInt | null; + gasPrice?: BigInt | null; + value?: BigInt | null; } /* URI: "ens/ethereum.web3api.eth" */ @@ -48,15 +48,15 @@ export interface Ethereum_StaticTxResult { /* URI: "ens/ethereum.web3api.eth" */ export interface Ethereum_TxRequest { - to?: String | undefined; - from?: String | undefined; - nonce?: UInt32 | undefined; - gasLimit?: BigInt | undefined; - gasPrice?: BigInt | undefined; - data?: String | undefined; - value?: BigInt | undefined; - chainId?: UInt32 | undefined; - type?: UInt32 | undefined; + to?: String | null; + from?: String | null; + nonce?: UInt32 | null; + gasLimit?: BigInt | null; + gasPrice?: BigInt | null; + data?: String | null; + value?: BigInt | null; + chainId?: UInt32 | null; + type?: UInt32 | null; } /* URI: "ens/ethereum.web3api.eth" */ @@ -65,7 +65,7 @@ export interface Ethereum_TxReceipt { from: String; contractAddress: String; transactionIndex: UInt32; - root?: String | undefined; + root?: String | null; gasUsed: BigInt; logsBloom: String; transactionHash: String; @@ -77,7 +77,7 @@ export interface Ethereum_TxReceipt { effectiveGasPrice: BigInt; byzantium: Boolean; type: UInt32; - status?: UInt32 | undefined; + status?: UInt32 | null; } /* URI: "ens/ethereum.web3api.eth" */ @@ -108,17 +108,17 @@ export interface Ethereum_EventNotification { interface Ethereum_Query_Input_callContractView extends Record { address: String; method: String; - args?: Array | undefined; - connection?: Types.Ethereum_Connection | undefined; + args?: Array | null; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_callContractStatic extends Record { address: String; method: String; - args?: Array | undefined; - connection?: Types.Ethereum_Connection | undefined; - txOverrides?: Types.Ethereum_TxOverrides | undefined; + args?: Array | null; + connection?: Types.Ethereum_Connection | null; + txOverrides?: Types.Ethereum_TxOverrides | null; } /* URI: "ens/ethereum.web3api.eth" */ @@ -129,39 +129,39 @@ interface Ethereum_Query_Input_encodeParams extends Record { /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_getSignerAddress extends Record { - connection?: Types.Ethereum_Connection | undefined; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_getSignerBalance extends Record { - blockTag?: BigInt | undefined; - connection?: Types.Ethereum_Connection | undefined; + blockTag?: BigInt | null; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_getSignerTransactionCount extends Record { - blockTag?: BigInt | undefined; - connection?: Types.Ethereum_Connection | undefined; + blockTag?: BigInt | null; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_getGasPrice extends Record { - connection?: Types.Ethereum_Connection | undefined; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_estimateTransactionGas extends Record { tx: Types.Ethereum_TxRequest; - connection?: Types.Ethereum_Connection | undefined; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_estimateContractCallGas extends Record { address: String; method: String; - args?: Array | undefined; - connection?: Types.Ethereum_Connection | undefined; - txOverrides?: Types.Ethereum_TxOverrides | undefined; + args?: Array | null; + connection?: Types.Ethereum_Connection | null; + txOverrides?: Types.Ethereum_TxOverrides | null; } /* URI: "ens/ethereum.web3api.eth" */ @@ -184,16 +184,16 @@ interface Ethereum_Query_Input_awaitTransaction extends Record txHash: String; confirmations: UInt32; timeout: UInt32; - connection?: Types.Ethereum_Connection | undefined; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ interface Ethereum_Query_Input_waitForEvent extends Record { address: String; event: String; - args?: Array | undefined; - timeout?: UInt32 | undefined; - connection?: Types.Ethereum_Connection | undefined; + args?: Array | null; + timeout?: UInt32 | null; + connection?: Types.Ethereum_Connection | null; } /* URI: "ens/ethereum.web3api.eth" */ diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/mutation.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/mutation.ts index 57dba3206a..7e6876db14 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/mutation.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/mutation.ts @@ -23,18 +23,18 @@ import { export interface Input_mutationMethod extends Record { str: String; - optStr?: String | undefined; + optStr?: String | null; en: Types.CustomEnum; - optEnum?: Types.CustomEnum | undefined; + optEnum?: Types.CustomEnum | null; enumArray: Array; - optEnumArray?: Array | undefined; + optEnumArray?: Array | null; } export interface Input_objectMethod extends Record { object: Types.AnotherType; - optObject?: Types.AnotherType | undefined; + optObject?: Types.AnotherType | null; objectArray: Array; - optObjectArray?: Array | undefined; + optObjectArray?: Array | null; } export interface Module extends PluginModule { @@ -46,5 +46,5 @@ export interface Module extends PluginModule { objectMethod( input: Input_objectMethod, client: Client - ): MaybeAsync; + ): MaybeAsync; } diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/query.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/query.ts index 3b44183a0e..7eacf3393c 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/query.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/query.ts @@ -23,18 +23,18 @@ import { export interface Input_queryMethod extends Record { str: String; - optStr?: String | undefined; + optStr?: String | null; en: Types.CustomEnum; - optEnum?: Types.CustomEnum | undefined; + optEnum?: Types.CustomEnum | null; enumArray: Array; - optEnumArray?: Array | undefined; + optEnumArray?: Array | null; } export interface Input_objectMethod extends Record { object: Types.AnotherType; - optObject?: Types.AnotherType | undefined; + optObject?: Types.AnotherType | null; objectArray: Array; - optObjectArray?: Array | undefined; + optObjectArray?: Array | null; } export interface Module extends PluginModule { @@ -46,5 +46,5 @@ export interface Module extends PluginModule { objectMethod( input: Input_objectMethod, client: Client - ): MaybeAsync; + ): MaybeAsync; } 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 f4ef849eab..1329c15493 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 @@ -21,9 +21,9 @@ export type Boolean = boolean; export interface CustomType { str: String; - optStr?: String | undefined; + optStr?: String | null; u: UInt; - optU?: UInt | undefined; + optU?: UInt | null; u8: UInt8; u16: UInt16; u32: UInt32; @@ -32,32 +32,32 @@ export interface CustomType { i16: Int16; i32: Int32; bigint: BigInt; - optBigint?: BigInt | undefined; + optBigint?: BigInt | null; bytes: Bytes; - optBytes?: Bytes | undefined; + optBytes?: Bytes | null; boolean: Boolean; - optBoolean?: Boolean | undefined; + optBoolean?: Boolean | null; uArray: Array; - uOptArray?: Array | undefined; - optUOptArray?: Array | undefined; - optStrOptArray?: Array | undefined; + uOptArray?: Array | null; + optUOptArray?: Array | null; + optStrOptArray?: Array | null; uArrayArray: Array>; - uOptArrayOptArray: Array | undefined>; - uArrayOptArrayArray: Array> | undefined>; - crazyArray?: Array | undefined>> | undefined> | undefined; + uOptArrayOptArray: Array | null>; + uArrayOptArrayArray: Array> | null>; + crazyArray?: Array | null>> | null> | null; object: Types.AnotherType; - optObject?: Types.AnotherType | undefined; + optObject?: Types.AnotherType | null; objectArray: Array; - optObjectArray?: Array | undefined; + optObjectArray?: Array | null; en: Types.CustomEnum; - optEnum?: Types.CustomEnum | undefined; + optEnum?: Types.CustomEnum | null; enumArray: Array; - optEnumArray?: Array | undefined; + optEnumArray?: Array | null; } export interface AnotherType { - prop?: String | undefined; - circular?: Types.CustomType | undefined; + prop?: String | null; + circular?: Types.CustomType | null; } export enum CustomEnum { @@ -70,13 +70,13 @@ export enum CustomEnum { /* URI: "testimport.uri.eth" */ export interface TestImport_Object { object: Types.TestImport_AnotherObject; - optObject?: Types.TestImport_AnotherObject | undefined; + optObject?: Types.TestImport_AnotherObject | null; objectArray: Array; - optObjectArray?: Array | undefined; + optObjectArray?: Array | null; en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | undefined; + optEnum?: Types.TestImport_Enum | null; enumArray: Array; - optEnumArray?: Array | undefined; + optEnumArray?: Array | null; } /* URI: "testimport.uri.eth" */ @@ -97,18 +97,18 @@ export enum TestImport_Enum { /* URI: "testimport.uri.eth" */ interface TestImport_Query_Input_importedMethod extends Record { str: String; - optStr?: String | undefined; + optStr?: String | null; u: UInt; - optU?: UInt | undefined; - uArrayArray: Array | undefined>; + optU?: UInt | null; + uArrayArray: Array | null>; object: Types.TestImport_Object; - optObject?: Types.TestImport_Object | undefined; + optObject?: Types.TestImport_Object | null; objectArray: Array; - optObjectArray?: Array | undefined; + optObjectArray?: Array | null; en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | undefined; + optEnum?: Types.TestImport_Enum | null; enumArray: Array; - optEnumArray?: Array | undefined; + optEnumArray?: Array | null; } /* URI: "testimport.uri.eth" */ @@ -121,8 +121,8 @@ export const TestImport_Query = { importedMethod: async ( input: TestImport_Query_Input_importedMethod, client: Client - ): Promise> => { - return client.invoke({ + ): Promise> => { + return client.invoke({ uri: "testimport.uri.eth", module: "query", method: "importedMethod", @@ -160,8 +160,8 @@ export const TestImport_Mutation = { importedMethod: async ( input: TestImport_Mutation_Input_importedMethod, client: Client - ): Promise> => { - return client.invoke({ + ): Promise> => { + return client.invoke({ uri: "testimport.uri.eth", module: "mutation", method: "importedMethod",