diff --git a/docs/packages/fuel-ts-abi-coder/classes/B256Coder.md b/docs/packages/fuel-ts-abi-coder/classes/B256Coder.md index dd6ba1da18e..36b44e2b8b2 100644 --- a/docs/packages/fuel-ts-abi-coder/classes/B256Coder.md +++ b/docs/packages/fuel-ts-abi-coder/classes/B256Coder.md @@ -102,7 +102,7 @@ ___ #### Defined in -[abi-coder/src/coders/b256.ts:28](https://github.com/FuelLabs/fuels-ts/blob/master/packages/abi-coder/src/coders/b256.ts#L28) +[abi-coder/src/coders/b256.ts:27](https://github.com/FuelLabs/fuels-ts/blob/master/packages/abi-coder/src/coders/b256.ts#L27) ___ diff --git a/docs/packages/fuel-ts-contract/classes/ContractFactory.md b/docs/packages/fuel-ts-contract/classes/ContractFactory.md index 015a81ef5a2..0e951683736 100644 --- a/docs/packages/fuel-ts-contract/classes/ContractFactory.md +++ b/docs/packages/fuel-ts-contract/classes/ContractFactory.md @@ -26,7 +26,7 @@ nav_order: 1 #### Defined in -[contract/src/contract-factory.ts:17](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L17) +[contract/src/contract-factory.ts:18](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L18) ## Properties @@ -36,7 +36,7 @@ nav_order: 1 #### Defined in -[contract/src/contract-factory.ts:13](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L13) +[contract/src/contract-factory.ts:14](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L14) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[contract/src/contract-factory.ts:14](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L14) +[contract/src/contract-factory.ts:15](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L15) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[contract/src/contract-factory.ts:15](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L15) +[contract/src/contract-factory.ts:16](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L16) ## Accessors @@ -70,7 +70,7 @@ ___ #### Defined in -[contract/src/contract-factory.ts:36](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L36) +[contract/src/contract-factory.ts:37](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L37) ## Methods @@ -90,7 +90,7 @@ ___ #### Defined in -[contract/src/contract-factory.ts:40](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L40) +[contract/src/contract-factory.ts:41](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L41) ___ @@ -104,4 +104,4 @@ ___ #### Defined in -[contract/src/contract-factory.ts:44](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L44) +[contract/src/contract-factory.ts:45](https://github.com/FuelLabs/fuels-ts/blob/master/packages/contract/src/contract-factory.ts#L45) diff --git a/docs/packages/fuel-ts-providers/classes/Provider.md b/docs/packages/fuel-ts-providers/classes/Provider.md index 1d0430a04aa..f3e3e8aa837 100644 --- a/docs/packages/fuel-ts-providers/classes/Provider.md +++ b/docs/packages/fuel-ts-providers/classes/Provider.md @@ -26,7 +26,7 @@ A provider for connecting to a Fuel node #### Defined in -[providers/src/provider.ts:149](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L149) +[providers/src/provider.ts:153](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L153) ## Properties @@ -41,8 +41,8 @@ A provider for connecting to a Fuel node | `dryRun` | (`variables`: [`Exact`](../namespaces/internal.md#exact)<{ `encodedTransaction`: `string` }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlDryRunMutation`](../namespaces/internal.md#gqldryrunmutation)\> | | `endSession` | (`variables`: [`Exact`](../namespaces/internal.md#exact)<{ `sessionId`: `string` }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlEndSessionMutation`](../namespaces/internal.md#gqlendsessionmutation)\> | | `execute` | (`variables`: [`Exact`](../namespaces/internal.md#exact)<{ `op`: `string` ; `sessionId`: `string` }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlExecuteMutation`](../namespaces/internal.md#gqlexecutemutation)\> | -| `getBlock` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ `blockHeight?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`number`\> ; `blockId?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetBlockQuery`](../namespaces/internal.md#gqlgetblockquery)\> | -| `getBlockWithTransactions` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ `blockHeight?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`number`\> ; `blockId?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetBlockWithTransactionsQuery`](../namespaces/internal.md#gqlgetblockwithtransactionsquery)\> | +| `getBlock` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ `blockHeight?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> ; `blockId?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetBlockQuery`](../namespaces/internal.md#gqlgetblockquery)\> | +| `getBlockWithTransactions` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ `blockHeight?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> ; `blockId?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetBlockWithTransactionsQuery`](../namespaces/internal.md#gqlgetblockwithtransactionsquery)\> | | `getBlocks` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ `after?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> ; `before?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`string`\> ; `first?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`number`\> ; `last?`: [`InputMaybe`](../namespaces/internal.md#inputmaybe)<`number`\> }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetBlocksQuery`](../namespaces/internal.md#gqlgetblocksquery)\> | | `getChain` | (`variables?`: [`Exact`](../namespaces/internal.md#exact)<{ [key: string]: `never`; }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetChainQuery`](../namespaces/internal.md#gqlgetchainquery)\> | | `getCoin` | (`variables`: [`Exact`](../namespaces/internal.md#exact)<{ `coinId`: `string` }\>, `requestHeaders?`: `HeadersInit`) => `Promise`<[`GqlGetCoinQuery`](../namespaces/internal.md#gqlgetcoinquery)\> | @@ -59,7 +59,7 @@ A provider for connecting to a Fuel node #### Defined in -[providers/src/provider.ts:147](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L147) +[providers/src/provider.ts:151](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L151) ___ @@ -87,7 +87,7 @@ Executes a transaction without actually submitting it to the chain #### Defined in -[providers/src/provider.ts:227](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L227) +[providers/src/provider.ts:233](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L233) ___ @@ -109,7 +109,7 @@ Returns block matching the given ID or type #### Defined in -[providers/src/provider.ts:439](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L439) +[providers/src/provider.ts:444](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L444) ___ @@ -125,7 +125,7 @@ Returns the current block number #### Defined in -[providers/src/provider.ts:178](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L178) +[providers/src/provider.ts:182](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L182) ___ @@ -147,13 +147,13 @@ Returns block matching the given ID or type, including transaction data #### Defined in -[providers/src/provider.ts:470](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L470) +[providers/src/provider.ts:475](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L475) ___ ### getCoins -▸ **getCoins**(`owner`, `color?`, `paginationArgs?`): `Promise`<[`Coin`](../index.md#coin)[]\> +▸ **getCoins**(`owner`, `assetId?`, `paginationArgs?`): `Promise`<[`Coin`](../index.md#coin)[]\> Returns coins for the given owner @@ -161,8 +161,8 @@ Returns coins for the given owner | Name | Type | | :------ | :------ | -| `owner` | `string` | -| `color?` | `string` | +| `owner` | `BytesLike` | +| `assetId?` | `BytesLike` | | `paginationArgs?` | [`CursorPaginationArgs`](../index.md#cursorpaginationargs) | #### Returns @@ -171,7 +171,7 @@ Returns coins for the given owner #### Defined in -[providers/src/provider.ts:241](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L241) +[providers/src/provider.ts:247](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L247) ___ @@ -186,7 +186,7 @@ Returns coins for the given owner satisfying the spend query | Name | Type | | :------ | :------ | | `owner` | `string` | -| `spendQuery` | { `amount`: `BigNumber` ; `color`: `string` }[] | +| `spendQuery` | { `amount`: `BigNumber` ; `assetId`: `string` }[] | | `maxInputs?` | `number` | #### Returns @@ -195,7 +195,7 @@ Returns coins for the given owner satisfying the spend query #### Defined in -[providers/src/provider.ts:272](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L272) +[providers/src/provider.ts:277](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L277) ___ @@ -211,7 +211,7 @@ Returns the network configuration of the connected Fuel node #### Defined in -[providers/src/provider.ts:168](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L168) +[providers/src/provider.ts:172](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L172) ___ @@ -233,7 +233,7 @@ Get transaction with the given ID #### Defined in -[providers/src/provider.ts:504](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L504) +[providers/src/provider.ts:509](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L509) ___ @@ -249,7 +249,7 @@ Returns the version of the connected Fuel node #### Defined in -[providers/src/provider.ts:160](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L160) +[providers/src/provider.ts:164](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L164) ___ @@ -271,7 +271,7 @@ Submits a transaction to the chain to be executed #### Defined in -[providers/src/provider.ts:186](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L186) +[providers/src/provider.ts:190](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L190) ___ @@ -286,7 +286,7 @@ Submits a Create transaction to the chain for contract deployment | Name | Type | Default value | | :------ | :------ | :------ | | `bytecode` | `BytesLike` | `undefined` | -| `salt` | `string` | `'0x0000000000000000000000000000000000000000000000000000000000000000'` | +| `salt` | `BytesLike` | `'0x0000000000000000000000000000000000000000000000000000000000000000'` | #### Returns @@ -294,7 +294,7 @@ Submits a Create transaction to the chain for contract deployment #### Defined in -[providers/src/provider.ts:305](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L305) +[providers/src/provider.ts:310](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L310) ___ @@ -317,4 +317,4 @@ Submits a Script transaction to the chain for contract execution #### Defined in -[providers/src/provider.ts:345](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L345) +[providers/src/provider.ts:350](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L350) diff --git a/docs/packages/fuel-ts-providers/enums/CoinStatus.md b/docs/packages/fuel-ts-providers/enums/CoinStatus.md index 14b8fd8d2c5..d540111906d 100644 --- a/docs/packages/fuel-ts-providers/enums/CoinStatus.md +++ b/docs/packages/fuel-ts-providers/enums/CoinStatus.md @@ -18,7 +18,7 @@ nav_order: 4 #### Defined in -[providers/src/operations.ts:113](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L113) +providers/src/__generated__/operations.ts:119 ___ @@ -28,4 +28,4 @@ ___ #### Defined in -[providers/src/operations.ts:114](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L114) +providers/src/__generated__/operations.ts:120 diff --git a/docs/packages/fuel-ts-providers/enums/internal-GqlReturnType.md b/docs/packages/fuel-ts-providers/enums/internal-GqlReturnType.md index 95054749d68..42773f4dfd0 100644 --- a/docs/packages/fuel-ts-providers/enums/internal-GqlReturnType.md +++ b/docs/packages/fuel-ts-providers/enums/internal-GqlReturnType.md @@ -18,7 +18,7 @@ nav_order: 4 #### Defined in -[providers/src/operations.ts:340](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L340) +providers/src/__generated__/operations.ts:357 ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[providers/src/operations.ts:341](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L341) +providers/src/__generated__/operations.ts:358 ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[providers/src/operations.ts:342](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L342) +providers/src/__generated__/operations.ts:359 diff --git a/docs/packages/fuel-ts-providers/index.md b/docs/packages/fuel-ts-providers/index.md index 1a945c6e6bf..896e1dd0844 100644 --- a/docs/packages/fuel-ts-providers/index.md +++ b/docs/packages/fuel-ts-providers/index.md @@ -41,7 +41,7 @@ A Fuel block #### Defined in -[providers/src/provider.ts:74](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L74) +[providers/src/provider.ts:78](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L78) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[providers/src/provider.ts:38](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L38) +[providers/src/provider.ts:42](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L42) ___ @@ -72,8 +72,8 @@ A Fuel coin | Name | Type | | :------ | :------ | | `amount` | `BigNumber` | +| `assetId` | `string` | | `blockCreated` | `BigNumber` | -| `color` | `string` | | `id` | `string` | | `maturity` | `BigNumber` | | `owner` | `string` | @@ -81,7 +81,7 @@ A Fuel coin #### Defined in -[providers/src/provider.ts:85](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L85) +[providers/src/provider.ts:89](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L89) ___ @@ -100,8 +100,8 @@ ___ | `inputs?` | [`TransactionRequestInput`](index.md#transactionrequestinput)[] | List of inputs | | `maturity?` | `BigNumberish` | Block until which tx cannot be included | | `outputs?` | [`TransactionRequestOutput`](index.md#transactionrequestoutput)[] | List of outputs | -| `salt` | `string` | Salt | -| `staticContracts?` | `string`[] | List of static contracts | +| `salt` | `BytesLike` | Salt | +| `staticContracts?` | `BytesLike`[] | List of static contracts | | `storageSlots?` | [`TransactionRequestStorageSlot`](namespaces/internal.md#transactionrequeststorageslot)[] | List of storage slots to initialize | | `type` | [`Create`](enums/TransactionType.md#create) | - | | `witnesses?` | [`TransactionRequestWitness`](namespaces/internal.md#transactionrequestwitness)[] | List of witnesses | @@ -131,7 +131,7 @@ https://relay.dev/graphql/connections.htm#sec-Arguments #### Defined in -[providers/src/provider.ts:122](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L122) +[providers/src/provider.ts:126](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L126) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[providers/src/provider.ts:62](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L62) +[providers/src/provider.ts:66](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L66) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[providers/src/provider.ts:54](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L54) +[providers/src/provider.ts:58](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L58) ___ @@ -233,7 +233,7 @@ ___ #### Defined in -[providers/src/provider.ts:42](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L42) +[providers/src/provider.ts:46](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/provider.ts#L46) ## Functions @@ -254,7 +254,7 @@ ___ #### Defined in -[providers/src/util.ts:41](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L41) +[providers/src/util.ts:44](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L44) ___ @@ -267,8 +267,8 @@ ___ | Name | Type | | :------ | :------ | | `bytecode` | `BytesLike` | -| `salt` | `string` | -| `stateRoot` | `string` | +| `salt` | `BytesLike` | +| `stateRoot` | `BytesLike` | #### Returns @@ -276,7 +276,7 @@ ___ #### Defined in -[providers/src/util.ts:35](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L35) +[providers/src/util.ts:34](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L34) ___ @@ -296,7 +296,7 @@ ___ #### Defined in -[providers/src/util.ts:22](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L22) +[providers/src/util.ts:21](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L21) ___ @@ -316,7 +316,7 @@ ___ #### Defined in -[providers/src/util.ts:48](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L48) +[providers/src/util.ts:51](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L51) ___ @@ -336,7 +336,7 @@ ___ #### Defined in -[providers/src/util.ts:111](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L111) +[providers/src/util.ts:114](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/util.ts#L114) ___ diff --git a/docs/packages/fuel-ts-providers/namespaces/internal.md b/docs/packages/fuel-ts-providers/namespaces/internal.md index 81c69794804..4b5a01b5ca0 100644 --- a/docs/packages/fuel-ts-providers/namespaces/internal.md +++ b/docs/packages/fuel-ts-providers/namespaces/internal.md @@ -24,7 +24,7 @@ nav_order: 3 | Name | Type | Description | | :------ | :------ | :------ | -| `color` | `BytesLike` | Color of coins | +| `assetId` | `BytesLike` | Asset ID of coins | | `to` | `BytesLike` | Receiving address or script hash | | `type` | `OutputType.Change` | - | @@ -43,7 +43,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumberish` | Amount of coins | -| `color` | `BytesLike` | Color of the coins | +| `assetId` | `BytesLike` | Asset ID of the coins | | `id` | `BytesLike` | UTXO ID | | `maturity?` | `BigNumberish` | UTXO being spent must have been created at least this many blocks ago | | `owner` | `BytesLike` | Owning address or script hash | @@ -67,7 +67,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumberish` | Amount of coins to send | -| `color` | `BytesLike` | Color of coins | +| `assetId` | `BytesLike` | Asset ID of coins | | `to` | `BytesLike` | Receiving address or script hash | | `type` | [`Coin`](../index.md#coin) | - | @@ -141,7 +141,7 @@ ___ #### Defined in -[providers/src/operations.ts:7](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L7) +providers/src/__generated__/operations.ts:7 ___ @@ -153,12 +153,12 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | -| `color?` | [`InputMaybe`](internal.md#inputmaybe)<[`Scalars`](internal.md#scalars)[``"HexString256"``]\> | color of the coins | -| `owner` | [`Scalars`](internal.md#scalars)[``"HexString256"``] | address of the owner | +| `assetId?` | [`InputMaybe`](internal.md#inputmaybe)<[`Scalars`](internal.md#scalars)[``"AssetId"``]\> | asset ID of the coins | +| `owner` | [`Scalars`](internal.md#scalars)[``"Address"``] | address of the owner | #### Defined in -[providers/src/operations.ts:98](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L98) +providers/src/__generated__/operations.ts:104 ___ @@ -171,11 +171,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Mutation"`` | -| `dryRun` | { `__typename`: ``"Receipt"`` ; `data?`: `string` \| ``null`` ; `id?`: `string` \| ``null`` ; `rawPayload`: `string` }[] | +| `dryRun` | { `__typename`: ``"Receipt"`` ; `data?`: `string` \| ``null`` ; `rawPayload`: `string` }[] | #### Defined in -[providers/src/operations.ts:792](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L792) +providers/src/__generated__/operations.ts:803 ___ @@ -192,7 +192,7 @@ ___ #### Defined in -[providers/src/operations.ts:816](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L816) +providers/src/__generated__/operations.ts:825 ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[providers/src/operations.ts:823](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L823) +providers/src/__generated__/operations.ts:832 ___ @@ -226,7 +226,7 @@ ___ #### Defined in -[providers/src/operations.ts:647](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L647) +providers/src/__generated__/operations.ts:658 ___ @@ -239,11 +239,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `block?` | { `__typename`: ``"Block"`` ; `height`: `string` ; `id`: `string` ; `producer`: `string` ; `time`: `string` ; `transactions`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` }[] } \| ``null`` | +| `block?` | { `__typename`: ``"Block"`` ; `height`: `string` ; `id`: `string` ; `producer`: `string` ; `time`: `string` ; `transactions`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` }[] } \| ``null`` | #### Defined in -[providers/src/operations.ts:664](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L664) +providers/src/__generated__/operations.ts:675 ___ @@ -262,7 +262,7 @@ ___ #### Defined in -[providers/src/operations.ts:704](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L704) +providers/src/__generated__/operations.ts:715 ___ @@ -290,7 +290,7 @@ ___ #### Defined in -[providers/src/operations.ts:479](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L479) +providers/src/__generated__/operations.ts:495 ___ @@ -303,11 +303,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `coin?` | { `__typename`: ``"Coin"`` ; `amount`: `string` ; `blockCreated`: `string` ; `color`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } \| ``null`` | +| `coin?` | { `__typename`: ``"Coin"`` ; `amount`: `string` ; `assetId`: `string` ; `blockCreated`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } \| ``null`` | #### Defined in -[providers/src/operations.ts:726](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L726) +providers/src/__generated__/operations.ts:737 ___ @@ -320,13 +320,13 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `coins` | { `__typename`: ``"CoinConnection"`` ; `edges?`: ({ `__typename`: ``"CoinEdge"`` ; `node`: { `__typename`: ``"Coin"`` ; `amount`: `string` ; `blockCreated`: `string` ; `color`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } } \| ``null``)[] \| ``null`` } | +| `coins` | { `__typename`: ``"CoinConnection"`` ; `edges?`: ({ `__typename`: ``"CoinEdge"`` ; `node`: { `__typename`: ``"Coin"`` ; `amount`: `string` ; `assetId`: `string` ; `blockCreated`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } } \| ``null``)[] \| ``null`` } | | `coins.__typename` | ``"CoinConnection"`` | -| `coins.edges?` | ({ `__typename`: ``"CoinEdge"`` ; `node`: { `__typename`: ``"Coin"`` ; `amount`: `string` ; `blockCreated`: `string` ; `color`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } } \| ``null``)[] \| ``null`` | +| `coins.edges?` | ({ `__typename`: ``"CoinEdge"`` ; `node`: { `__typename`: ``"Coin"`` ; `amount`: `string` ; `assetId`: `string` ; `blockCreated`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` } } \| ``null``)[] \| ``null`` | #### Defined in -[providers/src/operations.ts:748](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L748) +providers/src/__generated__/operations.ts:759 ___ @@ -339,11 +339,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `coinsToSpend` | { `__typename`: ``"Coin"`` ; `amount`: `string` ; `blockCreated`: `string` ; `color`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` }[] | +| `coinsToSpend` | { `__typename`: ``"Coin"`` ; `amount`: `string` ; `assetId`: `string` ; `blockCreated`: `string` ; `maturity`: `string` ; `owner`: `string` ; `status`: [`CoinStatus`](../enums/CoinStatus.md) ; `utxoId`: `string` }[] | #### Defined in -[providers/src/operations.ts:774](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L774) +providers/src/__generated__/operations.ts:785 ___ @@ -356,11 +356,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `transaction?` | { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } \| ``null`` | +| `transaction?` | { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } \| ``null`` | #### Defined in -[providers/src/operations.ts:501](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L501) +providers/src/__generated__/operations.ts:517 ___ @@ -373,11 +373,11 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `transaction?` | { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `receipts?`: { `__typename`: ``"Receipt"`` ; `data?`: `string` \| ``null`` ; `id?`: `string` \| ``null`` ; `rawPayload`: `string` }[] \| ``null`` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } \| ``null`` | +| `transaction?` | { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `receipts?`: { `__typename`: ``"Receipt"`` ; `data?`: `string` \| ``null`` ; `rawPayload`: `string` }[] \| ``null`` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } \| ``null`` | #### Defined in -[providers/src/operations.ts:531](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L531) +providers/src/__generated__/operations.ts:547 ___ @@ -390,13 +390,13 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `transactionsByOwner` | { `__typename`: ``"TransactionConnection"`` ; `edges?`: ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` } | +| `transactionsByOwner` | { `__typename`: ``"TransactionConnection"`` ; `edges?`: ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` } | | `transactionsByOwner.__typename` | ``"TransactionConnection"`` | -| `transactionsByOwner.edges?` | ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` | +| `transactionsByOwner.edges?` | ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` | #### Defined in -[providers/src/operations.ts:610](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L610) +providers/src/__generated__/operations.ts:621 ___ @@ -409,13 +409,13 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Query"`` | -| `transactions` | { `__typename`: ``"TransactionConnection"`` ; `edges?`: ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` } | +| `transactions` | { `__typename`: ``"TransactionConnection"`` ; `edges?`: ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` } | | `transactions.__typename` | ``"TransactionConnection"`` | -| `transactions.edges?` | ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `blockId`: `string` ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `blockId`: `string` ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` | +| `transactions.edges?` | ({ `__typename`: ``"TransactionEdge"`` ; `node`: { `__typename`: ``"Transaction"`` ; `id`: `string` ; `rawPayload`: `string` ; `status?`: { `__typename`: ``"FailureStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `reason`: `string` ; `time`: `string` ; `type`: ``"FailureStatus"`` } \| { `__typename`: ``"SubmittedStatus"`` ; `time`: `string` ; `type`: ``"SubmittedStatus"`` } \| { `__typename`: ``"SuccessStatus"`` ; `block`: { `__typename`: ``"Block"`` ; `id`: `string` } ; `programState`: { `__typename`: ``"ProgramState"`` ; `data`: `string` ; `returnType`: [`GqlReturnType`](../enums/internal-GqlReturnType.md) } ; `time`: `string` ; `type`: ``"SuccessStatus"`` } \| ``null`` } } \| ``null``)[] \| ``null`` | #### Defined in -[providers/src/operations.ts:570](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L570) +providers/src/__generated__/operations.ts:581 ___ @@ -432,7 +432,7 @@ ___ #### Defined in -[providers/src/operations.ts:475](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L475) +providers/src/__generated__/operations.ts:491 ___ @@ -449,7 +449,7 @@ ___ #### Defined in -[providers/src/operations.ts:829](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L829) +providers/src/__generated__/operations.ts:838 ___ @@ -462,11 +462,11 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | [`Scalars`](internal.md#scalars)[``"U64"``] | address of the owner | -| `color` | [`Scalars`](internal.md#scalars)[``"HexString256"``] | color of the coins | +| `assetId` | [`Scalars`](internal.md#scalars)[``"AssetId"``] | asset ID of the coins | #### Defined in -[providers/src/operations.ts:345](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L345) +providers/src/__generated__/operations.ts:362 ___ @@ -483,7 +483,7 @@ ___ #### Defined in -[providers/src/operations.ts:810](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L810) +providers/src/__generated__/operations.ts:819 ___ @@ -496,11 +496,13 @@ ___ | Name | Type | | :------ | :------ | | `__typename` | ``"Mutation"`` | -| `submit` | `string` | +| `submit` | { `__typename`: ``"Transaction"`` ; `id`: `string` } | +| `submit.__typename` | ``"Transaction"`` | +| `submit.id` | `string` | #### Defined in -[providers/src/operations.ts:806](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L806) +providers/src/__generated__/operations.ts:812 ___ @@ -516,7 +518,7 @@ ___ #### Defined in -[providers/src/operations.ts:6](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L6) +providers/src/__generated__/operations.ts:6 ___ @@ -532,7 +534,7 @@ ___ #### Defined in -[providers/src/operations.ts:5](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L5) +providers/src/__generated__/operations.ts:5 ___ @@ -546,20 +548,26 @@ All built-in and custom scalars, mapped to their actual values | Name | Type | Description | | :------ | :------ | :------ | +| `Address` | `string` | - | +| `AssetId` | `string` | - | +| `BlockId` | `string` | - | | `Boolean` | `boolean` | - | +| `Bytes32` | `string` | - | +| `ContractId` | `string` | - | | `DateTime` | `string` | Implement the DateTime scalar The input/output is a string in RFC3339 format. | | `Float` | `number` | - | | `HexString` | `string` | - | -| `HexString256` | `string` | - | -| `HexStringUtxoId` | `string` | - | | `ID` | `string` | - | | `Int` | `number` | - | +| `Salt` | `string` | - | | `String` | `string` | - | +| `TransactionId` | `string` | - | | `U64` | `string` | - | +| `UtxoId` | `string` | - | #### Defined in -[providers/src/operations.ts:11](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/operations.ts#L11) +providers/src/__generated__/operations.ts:11 ___ @@ -615,7 +623,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumberish` | Amount of coins to withdraw | -| `color` | `BytesLike` | Color of coins | +| `assetId` | `BytesLike` | Asset ID of coins | | `to` | `BytesLike` | Receiving address | | `type` | `OutputType.Withdrawal` | - | diff --git a/docs/packages/fuel-ts-transactions/index.md b/docs/packages/fuel-ts-transactions/index.md index 268b2259863..b34a36c6410 100644 --- a/docs/packages/fuel-ts-transactions/index.md +++ b/docs/packages/fuel-ts-transactions/index.md @@ -66,7 +66,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins (u64) | -| `color` | `string` | Color of the coins (b256) | +| `assetId` | `string` | Asset ID of the coins (b256) | | `maturity` | `BigNumber` | UTXO being spent must have been created at least this many blocks ago (u64) | | `owner` | `string` | Owning address or script hash (b256) | | `predicate` | `string` | Predicate bytecode (byte[]) | @@ -122,7 +122,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins to send (u64) | -| `color` | `string` | Color of coins (b256) | +| `assetId` | `string` | Asset ID of coins (b256) | | `to` | `string` | Receiving address or script hash (b256) | | `type` | [`Change`](enums/OutputType.md#change) | - | @@ -141,7 +141,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins to send (u64) | -| `color` | `string` | Color of coins (b256) | +| `assetId` | `string` | Asset ID of coins (b256) | | `to` | `string` | Receiving address or script hash (b256) | | `type` | [`Coin`](enums/OutputType.md#coin) | - | @@ -197,7 +197,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins to send (u64) | -| `color` | `string` | Color of coins (b256) | +| `assetId` | `string` | Asset ID of coins (b256) | | `to` | `string` | Receiving address or script hash (b256) | | `type` | [`Variable`](enums/OutputType.md#variable) | - | @@ -216,7 +216,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins to withdraw (u64) | -| `color` | `string` | Color of coins (b256) | +| `assetId` | `string` | Asset ID of coins (b256) | | `to` | `string` | Receiving address (b256) | | `type` | [`Withdrawal`](enums/OutputType.md#withdrawal) | - | @@ -245,7 +245,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins to forward, i.e. $rB (u64) | -| `color` | `string` | Color of coins to forward, i.e. MEM[$rC, 32] (b256) | +| `assetId` | `string` | Asset ID of coins to forward, i.e. MEM[$rC, 32] (b256) | | `from` | `string` | Contract ID of current context if in an internal context, zero otherwise (b256) | | `gas` | `BigNumber` | Gas to forward, i.e. $rD (u64) | | `is` | `BigNumber` | Value of register $is (u64) | @@ -417,7 +417,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins transferred (u64) | -| `color` | `string` | Color of coins transferred (b256) | +| `assetId` | `string` | Asset ID of coins transferred (b256) | | `from` | `string` | Contract ID of current context if in an internal context, zero otherwise (b256) | | `is` | `BigNumber` | Value of register $is (u64) | | `pc` | `BigNumber` | Value of register $pc (u64) | @@ -439,7 +439,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | | `amount` | `BigNumber` | Amount of coins transferred (u64) | -| `color` | `string` | Color of coins transferred (b256) | +| `assetId` | `string` | Asset ID of coins transferred (b256) | | `from` | `string` | Contract ID of current context if in an internal context, zero otherwise (b256) | | `is` | `BigNumber` | Value of register $is (u64) | | `pc` | `BigNumber` | Value of register $pc (u64) | diff --git a/package-lock.json b/package-lock.json index 2499c3d6b67..e949e213206 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26998,7 +26998,7 @@ "@ethersproject/bignumber": "^5.5.0", "@ethersproject/bytes": "^5.5.0", "@ethersproject/logger": "^5.5.0", - "@ethersproject/random": "*", + "@ethersproject/random": "^5.5.1", "@fuel-ts/abi-coder": "0.3.0", "@fuel-ts/providers": "0.3.0", "@fuel-ts/transactions": "0.3.0" diff --git a/packages/abi-coder/src/interface.test.ts b/packages/abi-coder/src/interface.test.ts index 9f9bc991f4b..1938db3d046 100644 --- a/packages/abi-coder/src/interface.test.ts +++ b/packages/abi-coder/src/interface.test.ts @@ -178,7 +178,7 @@ describe('Interface', () => { ); }); - it('can remove the first 3 arguments from the abi if they have gas, coin and color arguments', () => { + it('can remove the first 3 arguments from the abi if they have gas, coin and asset_id arguments', () => { const json = { type: 'function', inputs: [ @@ -191,7 +191,7 @@ describe('Interface', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { name: 'arg', type: 'u64' }, @@ -238,7 +238,7 @@ describe('Interface', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { @@ -286,7 +286,7 @@ describe('Interface', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { diff --git a/packages/contract/src/contract.test.ts b/packages/contract/src/contract.test.ts index 27152998321..f9a02f600a9 100644 --- a/packages/contract/src/contract.test.ts +++ b/packages/contract/src/contract.test.ts @@ -108,7 +108,7 @@ describe('Contract', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { name: 'value', type: 'u64' }, @@ -128,7 +128,7 @@ describe('Contract', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { name: 'amount', type: 'u64' }, @@ -148,7 +148,7 @@ describe('Contract', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { name: 'amount', type: '()' }, diff --git a/packages/contract/src/test-contract/src/main.sw b/packages/contract/src/test-contract/src/main.sw index 8ec98572b10..f0ef1187499 100644 --- a/packages/contract/src/test-contract/src/main.sw +++ b/packages/contract/src/test-contract/src/main.sw @@ -6,23 +6,23 @@ use std::storage::get; abi TestContract { fn initialize_counter(gas_: u64, amount_: u64, coin_: b256, value: u64) -> u64; fn increment_counter(gas_: u64, amount_: u64, coin_: b256, amount: u64) -> u64; - fn counter(gas_: u64, amount_: u64, color_: b256, value: ()) -> u64; + fn counter(gas_: u64, amount_: u64, asset_id_: b256, value: ()) -> u64; } const COUNTER_KEY = 0x0000000000000000000000000000000000000000000000000000000000000000; impl TestContract for Contract { - fn initialize_counter(gas_: u64, amount_: u64, color_: b256, value: u64) -> u64 { + fn initialize_counter(gas_: u64, amount_: u64, asset_id_: b256, value: u64) -> u64 { store(COUNTER_KEY, value); value } - fn increment_counter(gas_: u64, amount_: u64, color_: b256, amount: u64) -> u64 { + fn increment_counter(gas_: u64, amount_: u64, asset_id_: b256, amount: u64) -> u64 { let value: u64 = get(COUNTER_KEY); let value = value + amount; store(COUNTER_KEY, value); value } - fn counter(gas_: u64, amount_: u64, color_: b256, value: ()) -> u64 { + fn counter(gas_: u64, amount_: u64, asset_id_: b256, value: ()) -> u64 { let value: u64 = get(COUNTER_KEY); value } diff --git a/packages/example-contract/src/main.sw b/packages/example-contract/src/main.sw index 567a898e59d..4d2fc51898b 100644 --- a/packages/example-contract/src/main.sw +++ b/packages/example-contract/src/main.sw @@ -1,11 +1,11 @@ contract; abi MyContract { - fn return_input(gas_: u64, coin_: u64, color_: b256, input: u64) -> u64; + fn return_input(gas_: u64, coin_: u64, asset_id_: b256, input: u64) -> u64; } impl MyContract for Contract { - fn return_input(gas_: u64, coin_: u64, color_: b256, input: u64) -> u64 { + fn return_input(gas_: u64, coin_: u64, asset_id_: b256, input: u64) -> u64 { input } } diff --git a/packages/hasher/src/hasher.ts b/packages/hasher/src/hasher.ts index 5324b86a5f8..49f9ab0e7bc 100644 --- a/packages/hasher/src/hasher.ts +++ b/packages/hasher/src/hasher.ts @@ -73,7 +73,7 @@ export function hashTransaction(transactionRequest: TransactionRequest) { case OutputType.Change: { outputClone.to = ZERO_B256; outputClone.amount = BigNumber.from(0); - outputClone.color = ZERO_B256; + outputClone.assetId = ZERO_B256; return outputClone; } // Zero out on signing: amount diff --git a/packages/providers/codegen.json b/packages/providers/codegen.json index 8489e457cf6..d7d72984110 100644 --- a/packages/providers/codegen.json +++ b/packages/providers/codegen.json @@ -14,9 +14,15 @@ "scalars": { "DateTime": "string", "HexString": "string", - "HexString256": "string", - "HexStringUtxoId": "string", - "U64": "string" + "Bytes32": "string", + "UtxoId": "string", + "U64": "string", + "Address": "string", + "BlockId": "string", + "TransactionId": "string", + "AssetId": "string", + "ContractId": "string", + "Salt": "string" }, "useTypeImports": true, "nonOptionalTypename": true, diff --git a/packages/providers/fuel-core-schema.graphql b/packages/providers/fuel-core-schema.graphql index c5369957bd1..9feee2e2ec6 100644 --- a/packages/providers/fuel-core-schema.graphql +++ b/packages/providers/fuel-core-schema.graphql @@ -3,12 +3,16 @@ Directs the executor to query only when the field exists. """ directive @ifdef on FIELD +scalar Address + +scalar AssetId + type Block { - id: HexString256! + id: BlockId! height: U64! transactions: [Transaction!]! time: DateTime! - producer: HexString256! + producer: Address! } type BlockConnection { @@ -38,6 +42,10 @@ type BlockEdge { cursor: String! } +scalar BlockId + +scalar Bytes32 + type ChainInfo { name: String! latestBlock: Block! @@ -46,16 +54,16 @@ type ChainInfo { } type ChangeOutput { - to: HexString256! - amount: Int! - color: HexString256! + to: Address! + amount: U64! + assetId: AssetId! } type Coin { - utxoId: HexStringUtxoId! - owner: HexString256! + utxoId: UtxoId! + owner: Address! amount: U64! - color: HexString256! + assetId: AssetId! maturity: U64! status: CoinStatus! blockCreated: U64! @@ -92,18 +100,18 @@ input CoinFilterInput { """ address of the owner """ - owner: HexString256! + owner: Address! """ - color of the coins + asset ID of the coins """ - color: HexString256 + assetId: AssetId } type CoinOutput { - to: HexString256! - amount: Int! - color: HexString256! + to: Address! + amount: U64! + assetId: AssetId! } enum CoinStatus { @@ -111,15 +119,22 @@ enum CoinStatus { SPENT } +type Contract { + id: ContractId! + bytecode: HexString! +} + type ContractCreated { - contractId: HexString256! - stateRoot: HexString256! + contract: Contract! + stateRoot: Bytes32! } +scalar ContractId + type ContractOutput { inputIndex: Int! - balanceRoot: HexString256! - stateRoot: HexString256! + balanceRoot: Bytes32! + stateRoot: Bytes32! } """ @@ -130,7 +145,7 @@ The input/output is a string in RFC3339 format. scalar DateTime type FailureStatus { - blockId: HexString256! + block: Block! time: DateTime! reason: String! programState: ProgramState @@ -138,28 +153,24 @@ type FailureStatus { scalar HexString -scalar HexString256 - -scalar HexStringUtxoId - union Input = InputCoin | InputContract type InputCoin { - utxoId: HexStringUtxoId! - owner: HexString256! - amount: Int! - color: HexString256! + utxoId: UtxoId! + owner: Address! + amount: U64! + assetId: AssetId! witnessIndex: Int! - maturity: Int! + maturity: U64! predicate: HexString! predicateData: HexString! } type InputContract { - utxoId: HexStringUtxoId! - balanceRoot: HexString256! - stateRoot: HexString256! - contractId: HexString256! + utxoId: UtxoId! + balanceRoot: Bytes32! + stateRoot: Bytes32! + contract: Contract! } type Mutation { @@ -176,7 +187,7 @@ type Mutation { """ Submits transaction to the pool """ - submit(tx: HexString!): HexString256! + submit(tx: HexString!): Transaction! } union Output = @@ -224,34 +235,34 @@ type Query { """ id of the block """ - id: HexString256 + id: BlockId """ height of the block """ - height: Int + height: U64 ): Block - blocks(after: String, before: String, first: Int, last: Int): BlockConnection! + blocks(first: Int, after: String, last: Int, before: String): BlockConnection! chain: ChainInfo! version: String! transaction( """ id of the transaction """ - id: HexString256! + id: TransactionId! ): Transaction transactions( - after: String - before: String first: Int + after: String last: Int + before: String ): TransactionConnection! transactionsByOwner( - owner: HexString256! - after: String - before: String + owner: Address! first: Int + after: String last: Int + before: String ): TransactionConnection! """ @@ -262,20 +273,20 @@ type Query { """ utxo_id of the coin """ - utxoId: HexStringUtxoId! + utxoId: UtxoId! ): Coin coins( - after: String - before: String + filter: CoinFilterInput! first: Int + after: String last: Int - filter: CoinFilterInput! + before: String ): CoinConnection! coinsToSpend( """ The Address of the utxo owner """ - owner: HexString256! + owner: Address! """ The total amount of each asset type to spend @@ -287,22 +298,28 @@ type Query { """ maxInputs: Int ): [Coin!]! + contract( + """ + ID of the Contract + """ + id: ContractId! + ): Contract } type Receipt { - id: HexString256 + contract: Contract pc: U64 is: U64 - to: HexString256 - toAddress: HexString256 + to: Contract + toAddress: Address amount: U64 - color: HexString256 + assetId: AssetId gas: U64 a: U64 b: U64 val: U64 ptr: U64 - digest: HexString256 + digest: Bytes32 reason: U64 ra: U64 rb: U64 @@ -335,11 +352,13 @@ enum ReturnType { REVERT } +scalar Salt + input SpendQueryElementInput { """ - color of the coins + asset ID of the coins """ - color: HexString256! + assetId: AssetId! """ address of the owner @@ -352,31 +371,31 @@ type SubmittedStatus { } type SuccessStatus { - blockId: HexString256! + block: Block! time: DateTime! programState: ProgramState! } type Transaction { - id: HexString256! - inputColors: [HexString256!]! - inputContracts: [HexString256!]! - gasPrice: Int! - gasLimit: Int! - bytePrice: Int! - maturity: Int! + id: TransactionId! + inputAssetIds: [AssetId!]! + inputContracts: [Contract!]! + gasPrice: U64! + gasLimit: U64! + bytePrice: U64! + maturity: U64! isScript: Boolean! inputs: [Input!]! outputs: [Output!]! witnesses: [HexString!]! - receiptsRoot: HexString256 + receiptsRoot: Bytes32 status: TransactionStatus receipts: [Receipt!] script: HexString scriptData: HexString bytecodeWitnessIndex: Int - salt: HexString256 - staticContracts: [HexString256!] + salt: Salt + staticContracts: [Contract!] storageSlots: [HexString!] """ @@ -412,18 +431,22 @@ type TransactionEdge { cursor: String! } +scalar TransactionId + union TransactionStatus = SubmittedStatus | SuccessStatus | FailureStatus scalar U64 +scalar UtxoId + type VariableOutput { - to: HexString256! - amount: Int! - color: HexString256! + to: Address! + amount: U64! + assetId: AssetId! } type WithdrawalOutput { - to: HexString256! - amount: Int! - color: HexString256! + to: Address! + amount: U64! + assetId: AssetId! } diff --git a/packages/providers/src/operations.graphql b/packages/providers/src/operations.graphql index ffddaa94030..474df097792 100644 --- a/packages/providers/src/operations.graphql +++ b/packages/providers/src/operations.graphql @@ -1,3 +1,8 @@ +# This file contains the queries used by Provider. +# +# Running `npm -w @fuel-ts/providers run build-operations` will +# generate `operations.ts` from this file. + # Fragments fragment transactionFragment on Transaction { id @@ -8,7 +13,9 @@ fragment transactionFragment on Transaction { time } ... on SuccessStatus { - blockId + block { + id + } time programState { returnType @@ -16,7 +23,9 @@ fragment transactionFragment on Transaction { } } ... on FailureStatus { - blockId + block { + id + } time reason } @@ -24,7 +33,6 @@ fragment transactionFragment on Transaction { } fragment receiptFragment on Receipt { - id data rawPayload } @@ -43,7 +51,7 @@ fragment coinFragment on Coin { utxoId owner amount - color + assetId maturity status blockCreated @@ -65,13 +73,13 @@ query getChain { } } -query getTransaction($transactionId: HexString256!) { +query getTransaction($transactionId: TransactionId!) { transaction(id: $transactionId) { ...transactionFragment } } -query getTransactionWithReceipts($transactionId: HexString256!) { +query getTransactionWithReceipts($transactionId: TransactionId!) { transaction(id: $transactionId) { ...transactionFragment receipts { @@ -96,7 +104,7 @@ query getTransactions( } query getTransactionsByOwner( - $owner: HexString256! + $owner: Address! $after: String $before: String $first: Int @@ -117,13 +125,13 @@ query getTransactionsByOwner( } } -query getBlock($blockId: HexString256, $blockHeight: Int) { +query getBlock($blockId: BlockId, $blockHeight: U64) { block(id: $blockId, height: $blockHeight) { ...blockFragment } } -query getBlockWithTransactions($blockId: HexString256, $blockHeight: Int) { +query getBlockWithTransactions($blockId: BlockId, $blockHeight: U64) { block(id: $blockId, height: $blockHeight) { ...blockFragment transactions { @@ -142,7 +150,7 @@ query getBlocks($after: String, $before: String, $first: Int, $last: Int) { } } -query getCoin($coinId: HexStringUtxoId!) { +query getCoin($coinId: UtxoId!) { coin(utxoId: $coinId) { ...coinFragment } @@ -171,7 +179,7 @@ query getCoins( } query getCoinsToSpend( - $owner: HexString256! + $owner: Address! $spendQuery: [SpendQueryElementInput!]! $maxInputs: Int ) { @@ -187,7 +195,9 @@ mutation dryRun($encodedTransaction: HexString!) { } mutation submit($encodedTransaction: HexString!) { - submit(tx: $encodedTransaction) + submit(tx: $encodedTransaction) { + id + } } mutation startSession { diff --git a/packages/providers/src/operations.ts b/packages/providers/src/operations.ts new file mode 100644 index 00000000000..b86f8cf40da --- /dev/null +++ b/packages/providers/src/operations.ts @@ -0,0 +1,1319 @@ +import type { GraphQLClient } from 'graphql-request'; +import type * as Dom from 'graphql-request/dist/types.dom'; +import gql from 'graphql-tag'; + +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + Address: string; + AssetId: string; + BlockId: string; + Bytes32: string; + ContractId: string; + /** + * Implement the DateTime scalar + * + * The input/output is a string in RFC3339 format. + */ + DateTime: string; + HexString: string; + Salt: string; + TransactionId: string; + U64: string; + UtxoId: string; +}; + +export type GqlBlock = { + __typename: 'Block'; + height: Scalars['U64']; + id: Scalars['BlockId']; + producer: Scalars['Address']; + time: Scalars['DateTime']; + transactions: Array; +}; + +export type GqlBlockConnection = { + __typename: 'BlockConnection'; + /** A list of edges. */ + edges?: Maybe>>; + /** Information to aid in pagination. */ + pageInfo: GqlPageInfo; +}; + +/** An edge in a connection. */ +export type GqlBlockEdge = { + __typename: 'BlockEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: GqlBlock; +}; + +export type GqlChainInfo = { + __typename: 'ChainInfo'; + baseChainHeight: Scalars['U64']; + latestBlock: GqlBlock; + name: Scalars['String']; + peerCount: Scalars['Int']; +}; + +export type GqlChangeOutput = { + __typename: 'ChangeOutput'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + to: Scalars['Address']; +}; + +export type GqlCoin = { + __typename: 'Coin'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + blockCreated: Scalars['U64']; + maturity: Scalars['U64']; + owner: Scalars['Address']; + status: GqlCoinStatus; + utxoId: Scalars['UtxoId']; +}; + +export type GqlCoinConnection = { + __typename: 'CoinConnection'; + /** A list of edges. */ + edges?: Maybe>>; + /** Information to aid in pagination. */ + pageInfo: GqlPageInfo; +}; + +/** An edge in a connection. */ +export type GqlCoinEdge = { + __typename: 'CoinEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: GqlCoin; +}; + +export type GqlCoinFilterInput = { + /** asset ID of the coins */ + assetId?: InputMaybe; + /** address of the owner */ + owner: Scalars['Address']; +}; + +export type GqlCoinOutput = { + __typename: 'CoinOutput'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + to: Scalars['Address']; +}; + +export enum GqlCoinStatus { + Spent = 'SPENT', + Unspent = 'UNSPENT', +} + +export type GqlContract = { + __typename: 'Contract'; + bytecode: Scalars['HexString']; + id: Scalars['ContractId']; +}; + +export type GqlContractCreated = { + __typename: 'ContractCreated'; + contract: GqlContract; + stateRoot: Scalars['Bytes32']; +}; + +export type GqlContractOutput = { + __typename: 'ContractOutput'; + balanceRoot: Scalars['Bytes32']; + inputIndex: Scalars['Int']; + stateRoot: Scalars['Bytes32']; +}; + +export type GqlFailureStatus = { + __typename: 'FailureStatus'; + block: GqlBlock; + programState?: Maybe; + reason: Scalars['String']; + time: Scalars['DateTime']; +}; + +export type GqlInput = GqlInputCoin | GqlInputContract; + +export type GqlInputCoin = { + __typename: 'InputCoin'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + maturity: Scalars['U64']; + owner: Scalars['Address']; + predicate: Scalars['HexString']; + predicateData: Scalars['HexString']; + utxoId: Scalars['UtxoId']; + witnessIndex: Scalars['Int']; +}; + +export type GqlInputContract = { + __typename: 'InputContract'; + balanceRoot: Scalars['Bytes32']; + contract: GqlContract; + stateRoot: Scalars['Bytes32']; + utxoId: Scalars['UtxoId']; +}; + +export type GqlMutation = { + __typename: 'Mutation'; + /** dry-run the transaction using a fork of current state, no changes are committed. */ + dryRun: Array; + endSession: Scalars['Boolean']; + execute: Scalars['Boolean']; + reset: Scalars['Boolean']; + startSession: Scalars['ID']; + /** Submits transaction to the pool */ + submit: GqlTransaction; +}; + +export type GqlMutationDryRunArgs = { + tx: Scalars['HexString']; +}; + +export type GqlMutationEndSessionArgs = { + id: Scalars['ID']; +}; + +export type GqlMutationExecuteArgs = { + id: Scalars['ID']; + op: Scalars['String']; +}; + +export type GqlMutationResetArgs = { + id: Scalars['ID']; +}; + +export type GqlMutationSubmitArgs = { + tx: Scalars['HexString']; +}; + +export type GqlOutput = + | GqlChangeOutput + | GqlCoinOutput + | GqlContractCreated + | GqlContractOutput + | GqlVariableOutput + | GqlWithdrawalOutput; + +/** Information about pagination in a connection */ +export type GqlPageInfo = { + __typename: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type GqlProgramState = { + __typename: 'ProgramState'; + data: Scalars['HexString']; + returnType: GqlReturnType; +}; + +export type GqlQuery = { + __typename: 'Query'; + block?: Maybe; + blocks: GqlBlockConnection; + chain: GqlChainInfo; + coin?: Maybe; + coins: GqlCoinConnection; + coinsToSpend: Array; + contract?: Maybe; + /** Returns true when the GraphQL API is serving requests. */ + health: Scalars['Boolean']; + memory: Scalars['String']; + register: Scalars['U64']; + transaction?: Maybe; + transactions: GqlTransactionConnection; + transactionsByOwner: GqlTransactionConnection; + version: Scalars['String']; +}; + +export type GqlQueryBlockArgs = { + height?: InputMaybe; + id?: InputMaybe; +}; + +export type GqlQueryBlocksArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type GqlQueryCoinArgs = { + utxoId: Scalars['UtxoId']; +}; + +export type GqlQueryCoinsArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter: GqlCoinFilterInput; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type GqlQueryCoinsToSpendArgs = { + maxInputs?: InputMaybe; + owner: Scalars['Address']; + spendQuery: Array; +}; + +export type GqlQueryContractArgs = { + id: Scalars['ContractId']; +}; + +export type GqlQueryMemoryArgs = { + id: Scalars['ID']; + size: Scalars['U64']; + start: Scalars['U64']; +}; + +export type GqlQueryRegisterArgs = { + id: Scalars['ID']; + register: Scalars['U64']; +}; + +export type GqlQueryTransactionArgs = { + id: Scalars['TransactionId']; +}; + +export type GqlQueryTransactionsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type GqlQueryTransactionsByOwnerArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + owner: Scalars['Address']; +}; + +export type GqlReceipt = { + __typename: 'Receipt'; + a?: Maybe; + amount?: Maybe; + assetId?: Maybe; + b?: Maybe; + contract?: Maybe; + data?: Maybe; + digest?: Maybe; + gas?: Maybe; + gasUsed?: Maybe; + is?: Maybe; + len?: Maybe; + pc?: Maybe; + ptr?: Maybe; + ra?: Maybe; + rawPayload: Scalars['HexString']; + rb?: Maybe; + rc?: Maybe; + rd?: Maybe; + reason?: Maybe; + receiptType: GqlReceiptType; + result?: Maybe; + to?: Maybe; + toAddress?: Maybe; + val?: Maybe; +}; + +export enum GqlReceiptType { + Call = 'CALL', + Log = 'LOG', + LogData = 'LOG_DATA', + Panic = 'PANIC', + Return = 'RETURN', + ReturnData = 'RETURN_DATA', + Revert = 'REVERT', + ScriptResult = 'SCRIPT_RESULT', + Transfer = 'TRANSFER', + TransferOut = 'TRANSFER_OUT', +} + +export enum GqlReturnType { + Return = 'RETURN', + ReturnData = 'RETURN_DATA', + Revert = 'REVERT', +} + +export type GqlSpendQueryElementInput = { + /** address of the owner */ + amount: Scalars['U64']; + /** asset ID of the coins */ + assetId: Scalars['AssetId']; +}; + +export type GqlSubmittedStatus = { + __typename: 'SubmittedStatus'; + time: Scalars['DateTime']; +}; + +export type GqlSuccessStatus = { + __typename: 'SuccessStatus'; + block: GqlBlock; + programState: GqlProgramState; + time: Scalars['DateTime']; +}; + +export type GqlTransaction = { + __typename: 'Transaction'; + bytePrice: Scalars['U64']; + bytecodeWitnessIndex?: Maybe; + gasLimit: Scalars['U64']; + gasPrice: Scalars['U64']; + id: Scalars['TransactionId']; + inputAssetIds: Array; + inputContracts: Array; + inputs: Array; + isScript: Scalars['Boolean']; + maturity: Scalars['U64']; + outputs: Array; + /** Return the transaction bytes using canonical encoding */ + rawPayload: Scalars['HexString']; + receipts?: Maybe>; + receiptsRoot?: Maybe; + salt?: Maybe; + script?: Maybe; + scriptData?: Maybe; + staticContracts?: Maybe>; + status?: Maybe; + storageSlots?: Maybe>; + witnesses: Array; +}; + +export type GqlTransactionConnection = { + __typename: 'TransactionConnection'; + /** A list of edges. */ + edges?: Maybe>>; + /** Information to aid in pagination. */ + pageInfo: GqlPageInfo; +}; + +/** An edge in a connection. */ +export type GqlTransactionEdge = { + __typename: 'TransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: GqlTransaction; +}; + +export type GqlTransactionStatus = GqlFailureStatus | GqlSubmittedStatus | GqlSuccessStatus; + +export type GqlVariableOutput = { + __typename: 'VariableOutput'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + to: Scalars['Address']; +}; + +export type GqlWithdrawalOutput = { + __typename: 'WithdrawalOutput'; + amount: Scalars['U64']; + assetId: Scalars['AssetId']; + to: Scalars['Address']; +}; + +export type GqlTransactionFragmentFragment = { + __typename: 'Transaction'; + id: string; + rawPayload: string; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; +}; + +export type GqlReceiptFragmentFragment = { + __typename: 'Receipt'; + data?: string | null; + rawPayload: string; +}; + +export type GqlBlockFragmentFragment = { + __typename: 'Block'; + id: string; + height: string; + producer: string; + time: string; + transactions: Array<{ __typename: 'Transaction'; id: string }>; +}; + +export type GqlCoinFragmentFragment = { + __typename: 'Coin'; + utxoId: string; + owner: string; + amount: string; + assetId: string; + maturity: string; + status: GqlCoinStatus; + blockCreated: string; +}; + +export type GqlGetVersionQueryVariables = Exact<{ [key: string]: never }>; + +export type GqlGetVersionQuery = { __typename: 'Query'; version: string }; + +export type GqlGetChainQueryVariables = Exact<{ [key: string]: never }>; + +export type GqlGetChainQuery = { + __typename: 'Query'; + chain: { + __typename: 'ChainInfo'; + name: string; + baseChainHeight: string; + peerCount: number; + latestBlock: { + __typename: 'Block'; + id: string; + height: string; + producer: string; + time: string; + transactions: Array<{ __typename: 'Transaction'; id: string }>; + }; + }; +}; + +export type GqlGetTransactionQueryVariables = Exact<{ + transactionId: Scalars['TransactionId']; +}>; + +export type GqlGetTransactionQuery = { + __typename: 'Query'; + transaction?: { + __typename: 'Transaction'; + id: string; + rawPayload: string; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; + } | null; +}; + +export type GqlGetTransactionWithReceiptsQueryVariables = Exact<{ + transactionId: Scalars['TransactionId']; +}>; + +export type GqlGetTransactionWithReceiptsQuery = { + __typename: 'Query'; + transaction?: { + __typename: 'Transaction'; + id: string; + rawPayload: string; + receipts?: Array<{ __typename: 'Receipt'; data?: string | null; rawPayload: string }> | null; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; + } | null; +}; + +export type GqlGetTransactionsQueryVariables = Exact<{ + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}>; + +export type GqlGetTransactionsQuery = { + __typename: 'Query'; + transactions: { + __typename: 'TransactionConnection'; + edges?: Array<{ + __typename: 'TransactionEdge'; + node: { + __typename: 'Transaction'; + id: string; + rawPayload: string; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; + }; + } | null> | null; + }; +}; + +export type GqlGetTransactionsByOwnerQueryVariables = Exact<{ + owner: Scalars['Address']; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}>; + +export type GqlGetTransactionsByOwnerQuery = { + __typename: 'Query'; + transactionsByOwner: { + __typename: 'TransactionConnection'; + edges?: Array<{ + __typename: 'TransactionEdge'; + node: { + __typename: 'Transaction'; + id: string; + rawPayload: string; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; + }; + } | null> | null; + }; +}; + +export type GqlGetBlockQueryVariables = Exact<{ + blockId?: InputMaybe; + blockHeight?: InputMaybe; +}>; + +export type GqlGetBlockQuery = { + __typename: 'Query'; + block?: { + __typename: 'Block'; + id: string; + height: string; + producer: string; + time: string; + transactions: Array<{ __typename: 'Transaction'; id: string }>; + } | null; +}; + +export type GqlGetBlockWithTransactionsQueryVariables = Exact<{ + blockId?: InputMaybe; + blockHeight?: InputMaybe; +}>; + +export type GqlGetBlockWithTransactionsQuery = { + __typename: 'Query'; + block?: { + __typename: 'Block'; + id: string; + height: string; + producer: string; + time: string; + transactions: Array<{ + __typename: 'Transaction'; + id: string; + rawPayload: string; + status?: + | { + __typename: 'FailureStatus'; + time: string; + reason: string; + type: 'FailureStatus'; + block: { __typename: 'Block'; id: string }; + } + | { __typename: 'SubmittedStatus'; time: string; type: 'SubmittedStatus' } + | { + __typename: 'SuccessStatus'; + time: string; + type: 'SuccessStatus'; + block: { __typename: 'Block'; id: string }; + programState: { __typename: 'ProgramState'; returnType: GqlReturnType; data: string }; + } + | null; + }>; + } | null; +}; + +export type GqlGetBlocksQueryVariables = Exact<{ + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}>; + +export type GqlGetBlocksQuery = { + __typename: 'Query'; + blocks: { + __typename: 'BlockConnection'; + edges?: Array<{ + __typename: 'BlockEdge'; + node: { + __typename: 'Block'; + id: string; + height: string; + producer: string; + time: string; + transactions: Array<{ __typename: 'Transaction'; id: string }>; + }; + } | null> | null; + }; +}; + +export type GqlGetCoinQueryVariables = Exact<{ + coinId: Scalars['UtxoId']; +}>; + +export type GqlGetCoinQuery = { + __typename: 'Query'; + coin?: { + __typename: 'Coin'; + utxoId: string; + owner: string; + amount: string; + assetId: string; + maturity: string; + status: GqlCoinStatus; + blockCreated: string; + } | null; +}; + +export type GqlGetCoinsQueryVariables = Exact<{ + filter: GqlCoinFilterInput; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}>; + +export type GqlGetCoinsQuery = { + __typename: 'Query'; + coins: { + __typename: 'CoinConnection'; + edges?: Array<{ + __typename: 'CoinEdge'; + node: { + __typename: 'Coin'; + utxoId: string; + owner: string; + amount: string; + assetId: string; + maturity: string; + status: GqlCoinStatus; + blockCreated: string; + }; + } | null> | null; + }; +}; + +export type GqlGetCoinsToSpendQueryVariables = Exact<{ + owner: Scalars['Address']; + spendQuery: Array | GqlSpendQueryElementInput; + maxInputs?: InputMaybe; +}>; + +export type GqlGetCoinsToSpendQuery = { + __typename: 'Query'; + coinsToSpend: Array<{ + __typename: 'Coin'; + utxoId: string; + owner: string; + amount: string; + assetId: string; + maturity: string; + status: GqlCoinStatus; + blockCreated: string; + }>; +}; + +export type GqlDryRunMutationVariables = Exact<{ + encodedTransaction: Scalars['HexString']; +}>; + +export type GqlDryRunMutation = { + __typename: 'Mutation'; + dryRun: Array<{ __typename: 'Receipt'; data?: string | null; rawPayload: string }>; +}; + +export type GqlSubmitMutationVariables = Exact<{ + encodedTransaction: Scalars['HexString']; +}>; + +export type GqlSubmitMutation = { + __typename: 'Mutation'; + submit: { __typename: 'Transaction'; id: string }; +}; + +export type GqlStartSessionMutationVariables = Exact<{ [key: string]: never }>; + +export type GqlStartSessionMutation = { __typename: 'Mutation'; startSession: string }; + +export type GqlEndSessionMutationVariables = Exact<{ + sessionId: Scalars['ID']; +}>; + +export type GqlEndSessionMutation = { __typename: 'Mutation'; endSession: boolean }; + +export type GqlExecuteMutationVariables = Exact<{ + sessionId: Scalars['ID']; + op: Scalars['String']; +}>; + +export type GqlExecuteMutation = { __typename: 'Mutation'; execute: boolean }; + +export type GqlResetMutationVariables = Exact<{ + sessionId: Scalars['ID']; +}>; + +export type GqlResetMutation = { __typename: 'Mutation'; reset: boolean }; + +export const TransactionFragmentFragmentDoc = gql` + fragment transactionFragment on Transaction { + id + rawPayload + status { + type: __typename + ... on SubmittedStatus { + time + } + ... on SuccessStatus { + block { + id + } + time + programState { + returnType + data + } + } + ... on FailureStatus { + block { + id + } + time + reason + } + } + } +`; +export const ReceiptFragmentFragmentDoc = gql` + fragment receiptFragment on Receipt { + data + rawPayload + } +`; +export const BlockFragmentFragmentDoc = gql` + fragment blockFragment on Block { + id + height + producer + transactions { + id + } + time + } +`; +export const CoinFragmentFragmentDoc = gql` + fragment coinFragment on Coin { + utxoId + owner + amount + assetId + maturity + status + blockCreated + } +`; +export const GetVersionDocument = gql` + query getVersion { + version + } +`; +export const GetChainDocument = gql` + query getChain { + chain { + name + latestBlock { + ...blockFragment + } + baseChainHeight + peerCount + } + } + ${BlockFragmentFragmentDoc} +`; +export const GetTransactionDocument = gql` + query getTransaction($transactionId: TransactionId!) { + transaction(id: $transactionId) { + ...transactionFragment + } + } + ${TransactionFragmentFragmentDoc} +`; +export const GetTransactionWithReceiptsDocument = gql` + query getTransactionWithReceipts($transactionId: TransactionId!) { + transaction(id: $transactionId) { + ...transactionFragment + receipts { + ...receiptFragment + } + } + } + ${TransactionFragmentFragmentDoc} + ${ReceiptFragmentFragmentDoc} +`; +export const GetTransactionsDocument = gql` + query getTransactions($after: String, $before: String, $first: Int, $last: Int) { + transactions(after: $after, before: $before, first: $first, last: $last) { + edges { + node { + ...transactionFragment + } + } + } + } + ${TransactionFragmentFragmentDoc} +`; +export const GetTransactionsByOwnerDocument = gql` + query getTransactionsByOwner( + $owner: Address! + $after: String + $before: String + $first: Int + $last: Int + ) { + transactionsByOwner(owner: $owner, after: $after, before: $before, first: $first, last: $last) { + edges { + node { + ...transactionFragment + } + } + } + } + ${TransactionFragmentFragmentDoc} +`; +export const GetBlockDocument = gql` + query getBlock($blockId: BlockId, $blockHeight: U64) { + block(id: $blockId, height: $blockHeight) { + ...blockFragment + } + } + ${BlockFragmentFragmentDoc} +`; +export const GetBlockWithTransactionsDocument = gql` + query getBlockWithTransactions($blockId: BlockId, $blockHeight: U64) { + block(id: $blockId, height: $blockHeight) { + ...blockFragment + transactions { + ...transactionFragment + } + } + } + ${BlockFragmentFragmentDoc} + ${TransactionFragmentFragmentDoc} +`; +export const GetBlocksDocument = gql` + query getBlocks($after: String, $before: String, $first: Int, $last: Int) { + blocks(after: $after, before: $before, first: $first, last: $last) { + edges { + node { + ...blockFragment + } + } + } + } + ${BlockFragmentFragmentDoc} +`; +export const GetCoinDocument = gql` + query getCoin($coinId: UtxoId!) { + coin(utxoId: $coinId) { + ...coinFragment + } + } + ${CoinFragmentFragmentDoc} +`; +export const GetCoinsDocument = gql` + query getCoins( + $filter: CoinFilterInput! + $after: String + $before: String + $first: Int + $last: Int + ) { + coins(filter: $filter, after: $after, before: $before, first: $first, last: $last) { + edges { + node { + ...coinFragment + } + } + } + } + ${CoinFragmentFragmentDoc} +`; +export const GetCoinsToSpendDocument = gql` + query getCoinsToSpend( + $owner: Address! + $spendQuery: [SpendQueryElementInput!]! + $maxInputs: Int + ) { + coinsToSpend(owner: $owner, spendQuery: $spendQuery, maxInputs: $maxInputs) { + ...coinFragment + } + } + ${CoinFragmentFragmentDoc} +`; +export const DryRunDocument = gql` + mutation dryRun($encodedTransaction: HexString!) { + dryRun(tx: $encodedTransaction) { + ...receiptFragment + } + } + ${ReceiptFragmentFragmentDoc} +`; +export const SubmitDocument = gql` + mutation submit($encodedTransaction: HexString!) { + submit(tx: $encodedTransaction) { + id + } + } +`; +export const StartSessionDocument = gql` + mutation startSession { + startSession + } +`; +export const EndSessionDocument = gql` + mutation endSession($sessionId: ID!) { + endSession(id: $sessionId) + } +`; +export const ExecuteDocument = gql` + mutation execute($sessionId: ID!, $op: String!) { + execute(id: $sessionId, op: $op) + } +`; +export const ResetDocument = gql` + mutation reset($sessionId: ID!) { + reset(id: $sessionId) + } +`; + +export type SdkFunctionWrapper = ( + action: (requestHeaders?: Record) => Promise, + operationName: string +) => Promise; + +const defaultWrapper: SdkFunctionWrapper = (action, _operationName) => action(); + +export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { + return { + getVersion( + variables?: GqlGetVersionQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetVersionDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getVersion' + ); + }, + getChain( + variables?: GqlGetChainQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetChainDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getChain' + ); + }, + getTransaction( + variables: GqlGetTransactionQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetTransactionDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getTransaction' + ); + }, + getTransactionWithReceipts( + variables: GqlGetTransactionWithReceiptsQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request( + GetTransactionWithReceiptsDocument, + variables, + { ...requestHeaders, ...wrappedRequestHeaders } + ), + 'getTransactionWithReceipts' + ); + }, + getTransactions( + variables?: GqlGetTransactionsQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetTransactionsDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getTransactions' + ); + }, + getTransactionsByOwner( + variables: GqlGetTransactionsByOwnerQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request( + GetTransactionsByOwnerDocument, + variables, + { ...requestHeaders, ...wrappedRequestHeaders } + ), + 'getTransactionsByOwner' + ); + }, + getBlock( + variables?: GqlGetBlockQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetBlockDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getBlock' + ); + }, + getBlockWithTransactions( + variables?: GqlGetBlockWithTransactionsQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request( + GetBlockWithTransactionsDocument, + variables, + { ...requestHeaders, ...wrappedRequestHeaders } + ), + 'getBlockWithTransactions' + ); + }, + getBlocks( + variables?: GqlGetBlocksQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetBlocksDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getBlocks' + ); + }, + getCoin( + variables: GqlGetCoinQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetCoinDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getCoin' + ); + }, + getCoins( + variables: GqlGetCoinsQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetCoinsDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getCoins' + ); + }, + getCoinsToSpend( + variables: GqlGetCoinsToSpendQueryVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetCoinsToSpendDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'getCoinsToSpend' + ); + }, + dryRun( + variables: GqlDryRunMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(DryRunDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'dryRun' + ); + }, + submit( + variables: GqlSubmitMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(SubmitDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'submit' + ); + }, + startSession( + variables?: GqlStartSessionMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(StartSessionDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'startSession' + ); + }, + endSession( + variables: GqlEndSessionMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(EndSessionDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'endSession' + ); + }, + execute( + variables: GqlExecuteMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(ExecuteDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'execute' + ); + }, + reset( + variables: GqlResetMutationVariables, + requestHeaders?: Dom.RequestInit['headers'] + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(ResetDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'reset' + ); + }, + }; +} +export type Sdk = ReturnType; diff --git a/packages/providers/src/provider.test.ts b/packages/providers/src/provider.test.ts index bc322f25160..e46b847a8e0 100644 --- a/packages/providers/src/provider.test.ts +++ b/packages/providers/src/provider.test.ts @@ -16,7 +16,7 @@ describe('Provider', () => { const version = await provider.getVersion(); - expect(version).toEqual('0.3.2'); + expect(version).toEqual('0.4.1'); }); it('can call()', async () => { @@ -24,9 +24,9 @@ describe('Provider', () => { const callResult = await provider.call({ type: TransactionType.Script, - gasPrice: BigNumber.from(Math.floor(Math.random() * 999)), + gasPrice: BigNumber.from(0), gasLimit: BigNumber.from(1000000), - bytePrice: BigNumber.from(Math.floor(Math.random() * 999)), + bytePrice: BigNumber.from(0), script: /* Opcode::ADDI(0x10, REG_ZERO, 0xCA) @@ -35,7 +35,7 @@ describe('Provider', () => { Opcode::RET(REG_ONE) */ arrayify('0x504000ca504400ba3341100024040000'), - scriptData: Uint8Array.from([]), + scriptData: randomBytes(32), }); const expectedReceipts: Receipt[] = [ @@ -119,13 +119,13 @@ describe('Provider', () => { const sender = '0x0101010101010101010101010101010101010101010101010101010101010101'; const receiverA = randomBytes(32); const receiverB = randomBytes(32); - const colorA = '0x0000000000000000000000000000000000000000000000000000000000000000'; - const colorB = '0x0101010101010101010101010101010101010101010101010101010101010101'; + const assetIdA = '0x0000000000000000000000000000000000000000000000000000000000000000'; + const assetIdB = '0x0101010101010101010101010101010101010101010101010101010101010101'; const amount = BigNumber.from(1); const coins = await provider.getCoinsToSpend(sender, [ - { color: colorA, amount: amount.mul(2) }, - { color: colorB, amount: amount.mul(2) }, + { assetId: assetIdA, amount: amount.mul(2) }, + { assetId: assetIdB, amount: amount.mul(2) }, ]); const response = await provider.sendTransaction({ @@ -144,27 +144,29 @@ describe('Provider', () => { { type: OutputType.Coin, to: receiverA, - color: colorA, + assetId: assetIdA, amount, }, { type: OutputType.Coin, to: receiverA, - color: colorB, + assetId: assetIdB, amount, }, { type: OutputType.Coin, to: receiverB, - color: colorA, + assetId: assetIdA, amount, }, { type: OutputType.Coin, to: receiverB, - color: colorB, + assetId: assetIdB, amount, }, + { type: OutputType.Change, assetId: assetIdA, to: sender }, + { type: OutputType.Change, assetId: assetIdB, to: sender }, ], witnesses: ['0x'], }); @@ -174,16 +176,16 @@ describe('Provider', () => { const receiverACoins = await provider.getCoins(receiverA, undefined, { first: 9999 }); expect(receiverACoins).toEqual( expect.arrayContaining([ - expect.objectContaining({ color: colorA, amount }), - expect.objectContaining({ color: colorB, amount }), + expect.objectContaining({ assetId: assetIdA, amount }), + expect.objectContaining({ assetId: assetIdB, amount }), ]) ); const receiverBCoins = await provider.getCoins(receiverB, undefined, { first: 9999 }); expect(receiverBCoins).toEqual( expect.arrayContaining([ - expect.objectContaining({ color: colorA, amount }), - expect.objectContaining({ color: colorB, amount }), + expect.objectContaining({ assetId: assetIdA, amount }), + expect.objectContaining({ assetId: assetIdB, amount }), ]) ); }); @@ -258,7 +260,7 @@ describe('Provider', () => { ]); }); - it('can call a contract with gas, coin and color arguments ', async () => { + it('can call a contract with gas, coin and asset_id arguments ', async () => { const provider = new Provider('http://127.0.0.1:4000/graphql'); const iface = new Interface([ @@ -275,7 +277,7 @@ describe('Provider', () => { type: 'u64', }, { - name: 'color_', + name: 'asset_id_', type: 'b256', }, { name: 'value', type: 'u64' }, @@ -365,7 +367,7 @@ describe('Provider', () => { inputs: [ { name: 'gas_', type: 'u64' }, { name: 'amount_', type: 'u64' }, - { name: 'color', type: 'b256' }, + { name: 'asset_id', type: 'b256' }, { name: 'value', type: 'u64' }, ], name: 'barfoo', @@ -376,7 +378,7 @@ describe('Provider', () => { inputs: [ { name: 'gas_', type: 'u64' }, { name: 'amount_', type: 'u64' }, - { name: 'color', type: 'b256' }, + { name: 'asset_id', type: 'b256' }, { name: 'value', type: '()' }, ], name: 'foobar', diff --git a/packages/providers/src/provider.ts b/packages/providers/src/provider.ts index 28637e7d9ae..7ca6911d8e6 100644 --- a/packages/providers/src/provider.ts +++ b/packages/providers/src/provider.ts @@ -88,7 +88,7 @@ export type Block = { */ export type Coin = { id: string; - color: string; + assetId: string; amount: BigNumber; owner: string; status: CoinStatus; @@ -191,7 +191,9 @@ export default class Provider { const encodedTransaction = hexlify( new TransactionCoder('transaction').encode(transactionFromRequest(transactionRequest)) ); - const { submit: transactionId } = await this.operations.submit({ encodedTransaction }); + const { + submit: { id: transactionId }, + } = await this.operations.submit({ encodedTransaction }); return { id: transactionId, @@ -209,7 +211,7 @@ export default class Provider { case 'SuccessStatus': { return { receipts: transaction.receipts!.map(processGqlReceipt), - blockId: transaction.status.blockId, + blockId: transaction.status.block.id, time: transaction.status.time, programState: transaction.status.programState, }; @@ -245,22 +247,22 @@ export default class Provider { async getCoins( /** The address to get coins for */ owner: BytesLike, - /** The color of coins to get */ - color?: BytesLike, + /** The asset ID of coins to get */ + assetId?: BytesLike, /** Pagination arguments */ paginationArgs?: CursorPaginationArgs ): Promise { const result = await this.operations.getCoins({ first: 10, ...paginationArgs, - filter: { owner: hexlify(owner), color: color && hexlify(color) }, + filter: { owner: hexlify(owner), assetId: assetId && hexlify(assetId) }, }); const coins = result.coins.edges!.map((edge) => edge!.node!); return coins.map((coin) => ({ id: coin.utxoId, - color: coin.color, + assetId: coin.assetId, amount: BigNumber.from(coin.amount), owner: coin.owner, status: coin.status, @@ -276,14 +278,14 @@ export default class Provider { /** The address to get coins for */ owner: string, /** The spend query */ - spendQuery: { color: string; amount: BigNumber }[], + spendQuery: { assetId: string; amount: BigNumber }[], /** Maximum number of coins to return */ maxInputs?: number ): Promise { const result = await this.operations.getCoinsToSpend({ owner, spendQuery: spendQuery.map((e) => ({ - color: e.color, + assetId: e.assetId, amount: e.amount.toString(), })), maxInputs, @@ -294,7 +296,7 @@ export default class Provider { return coins.map((coin) => ({ id: coin.utxoId, status: coin.status, - color: coin.color, + assetId: coin.assetId, amount: BigNumber.from(coin.amount), owner: coin.owner, maturity: BigNumber.from(coin.maturity), @@ -391,7 +393,7 @@ export default class Provider { { type: InputType.Coin, id: `${hexlify(randomBytes(32))}00`, - color: '0x0000000000000000000000000000000000000000000000000000000000000000', + assetId: '0x0000000000000000000000000000000000000000000000000000000000000000', amount: BigNumber.from(0), owner: '0x0000000000000000000000000000000000000000000000000000000000000000', witnessIndex: 0, @@ -445,9 +447,9 @@ export default class Provider { ): Promise { let variables; if (typeof idOrHeight === 'number') { - variables = { blockHeight: idOrHeight }; + variables = { blockHeight: BigNumber.from(idOrHeight).toString() }; } else if (idOrHeight === 'latest') { - variables = { blockHeight: (await this.getBlockNumber()).toNumber() }; + variables = { blockHeight: (await this.getBlockNumber()).toString() }; } else { variables = { blockId: idOrHeight }; } @@ -476,9 +478,9 @@ export default class Provider { ): Promise<(Block & { transactions: Transaction[] }) | null> { let variables; if (typeof idOrHeight === 'number') { - variables = { blockHeight: idOrHeight }; + variables = { blockHeight: BigNumber.from(idOrHeight).toString() }; } else if (idOrHeight === 'latest') { - variables = { blockHeight: (await this.getBlockNumber()).toNumber() }; + variables = { blockHeight: (await this.getBlockNumber()).toString() }; } else { variables = { blockId: idOrHeight }; } diff --git a/packages/providers/src/test-contract/src/main.sw b/packages/providers/src/test-contract/src/main.sw index ebb94649e2b..ea316bf2324 100644 --- a/packages/providers/src/test-contract/src/main.sw +++ b/packages/providers/src/test-contract/src/main.sw @@ -15,11 +15,11 @@ abi TestContract { } impl TestContract for Contract { - fn foo(gas_: u64, amount_: u64, color_: b256, value: u64) -> u64 { + fn foo(gas_: u64, amount_: u64, asset_id_: b256, value: u64) -> u64 { log_u64(3735928559); value } - fn boo(gas_: u64, amount_: u64, color_: b256, value: TestStruct) -> TestStruct { + fn boo(gas_: u64, amount_: u64, asset_id_: b256, value: TestStruct) -> TestStruct { log_u64(3735928559); log_u64(value.b); TestStruct { @@ -27,10 +27,10 @@ impl TestContract for Contract { b: value.b + 1, } } - fn barfoo(gas_: u64, amount_: u64, color_: b256, value: u64) -> u64 { + fn barfoo(gas_: u64, amount_: u64, asset_id_: b256, value: u64) -> u64 { 63 } - fn foobar(gas_: u64, amount_: u64, color_: b256, value: ()) -> u64 { + fn foobar(gas_: u64, amount_: u64, asset_id_: b256, value: ()) -> u64 { 63 } } diff --git a/packages/providers/src/transaction-request/input.ts b/packages/providers/src/transaction-request/input.ts index d0e577c3302..7e9d346b347 100644 --- a/packages/providers/src/transaction-request/input.ts +++ b/packages/providers/src/transaction-request/input.ts @@ -13,8 +13,8 @@ type CoinTransactionRequestInput = { owner: BytesLike; /** Amount of coins */ amount: BigNumberish; - /** Color of the coins */ - color: BytesLike; + /** Asset ID of the coins */ + assetId: BytesLike; /** Index of witness that authorizes spending the coin */ witnessIndex: BigNumberish; /** UTXO being spent must have been created at least this many blocks ago */ @@ -44,7 +44,7 @@ export const inputify = (value: TransactionRequestInput): Input => { }, owner: hexlify(value.owner), amount: BigNumber.from(value.amount), - color: hexlify(value.color), + assetId: hexlify(value.assetId), witnessIndex: BigNumber.from(value.witnessIndex), maturity: BigNumber.from(value.maturity ?? 0), predicateLength: BigNumber.from(predicate.length), diff --git a/packages/providers/src/transaction-request/output.ts b/packages/providers/src/transaction-request/output.ts index aca9f3f1b12..ce83816cfbf 100644 --- a/packages/providers/src/transaction-request/output.ts +++ b/packages/providers/src/transaction-request/output.ts @@ -11,8 +11,8 @@ type CoinTransactionRequestOutput = { to: BytesLike; /** Amount of coins to send */ amount: BigNumberish; - /** Color of coins */ - color: BytesLike; + /** Asset ID of coins */ + assetId: BytesLike; }; type ContractTransactionRequestOutput = { type: OutputType.Contract; @@ -25,15 +25,15 @@ type WithdrawalTransactionRequestOutput = { to: BytesLike; /** Amount of coins to withdraw */ amount: BigNumberish; - /** Color of coins */ - color: BytesLike; + /** Asset ID of coins */ + assetId: BytesLike; }; type ChangeTransactionRequestOutput = { type: OutputType.Change; /** Receiving address or script hash */ to: BytesLike; - /** Color of coins */ - color: BytesLike; + /** Asset ID of coins */ + assetId: BytesLike; }; type VariableTransactionRequestOutput = { type: OutputType.Variable; @@ -60,7 +60,7 @@ export const outputify = (value: TransactionRequestOutput): Output => { type: OutputType.Coin, to: hexlify(value.to), amount: BigNumber.from(value.amount), - color: hexlify(value.color), + assetId: hexlify(value.assetId), }; } case OutputType.Contract: { @@ -76,7 +76,7 @@ export const outputify = (value: TransactionRequestOutput): Output => { type: OutputType.Withdrawal, to: hexlify(value.to), amount: BigNumber.from(value.amount), - color: hexlify(value.color), + assetId: hexlify(value.assetId), }; } case OutputType.Change: { @@ -84,7 +84,7 @@ export const outputify = (value: TransactionRequestOutput): Output => { type: OutputType.Change, to: hexlify(value.to), amount: BigNumber.from(0), - color: hexlify(value.color), + assetId: hexlify(value.assetId), }; } case OutputType.Variable: { @@ -92,7 +92,7 @@ export const outputify = (value: TransactionRequestOutput): Output => { type: OutputType.Variable, to: '0x00000000000000000000000000000000000000000000000000000000', amount: BigNumber.from(0), - color: '0x00000000000000000000000000000000000000000000000000000000', + assetId: '0x00000000000000000000000000000000000000000000000000000000', }; } case OutputType.ContractCreated: { diff --git a/packages/providers/src/util.ts b/packages/providers/src/util.ts index 76d8643bd1a..431b8e2d2c6 100644 --- a/packages/providers/src/util.ts +++ b/packages/providers/src/util.ts @@ -99,7 +99,7 @@ export const getSignableTransaction = (transaction: Transaction): Transaction => ...output, to: '0x00000000000000000000000000000000000000000000000000000000', amount: BigNumber.from(0), - color: '0x00000000000000000000000000000000000000000000000000000000', + assetId: '0x00000000000000000000000000000000000000000000000000000000', }; } default: { diff --git a/packages/testcases/src/sendTransaction.json b/packages/testcases/src/sendTransaction.json index ca38c2b2b82..ac8cb09e97c 100644 --- a/packages/testcases/src/sendTransaction.json +++ b/packages/testcases/src/sendTransaction.json @@ -10,7 +10,7 @@ { "type": 0, "id": "0x000000000000000000000000000000000000000000000000000000000000000000", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000", + "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000", "amount": "0x01", "owner": "0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e", "maturity": 0, @@ -23,7 +23,7 @@ { "type": 0, "to": "0xc7862855b418ba8f58878db434b21053a61a2025209889cc115989e8040ff077", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000", + "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000", "amount": "0x01" } ], @@ -35,7 +35,7 @@ "hashedTransaction": "0x1181ada1d07028b76e241502fd64107e6305a2010f86442de16dafd397fe755d", "signedTransaction": "0xa3f3174d5c75352e2e762530c59a7486a06f4f23940667d1e099f90f8bd374684e9925e5e4fbbe04afad8eb42cc282de3ad97c9014019d644cb975c108a94206", "getCoins": { - "color": "0x0000000000000000000000000000000000000000000000000000000000000000", + "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000", "amount": 1, "owner": "0xc7862855b418ba8f58878db434b21053a61a2025209889cc115989e8040ff077" } diff --git a/packages/testcases/src/signTransaction.json b/packages/testcases/src/signTransaction.json index 3b4de374541..1e6ac70d4f7 100644 --- a/packages/testcases/src/signTransaction.json +++ b/packages/testcases/src/signTransaction.json @@ -10,7 +10,7 @@ { "type": 0, "id": "0x000000000000000000000000000000000000000000000000000000000000000000", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000", + "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000", "amount": "0x989680", "owner": "0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e", "maturity": 0, @@ -23,7 +23,7 @@ { "type": 0, "to": "0xc7862855b418ba8f58878db434b21053a61a2025209889cc115989e8040ff077", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000", + "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000", "amount": 1 } ], diff --git a/packages/transactions/src/coders/input.test.ts b/packages/transactions/src/coders/input.test.ts index 00a281872a7..8b7a19170ad 100644 --- a/packages/transactions/src/coders/input.test.ts +++ b/packages/transactions/src/coders/input.test.ts @@ -13,7 +13,7 @@ describe('InputCoder', () => { utxoID: { transactionId: B256, outputIndex: BigNumber.from(0) }, owner: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, witnessIndex: BigNumber.from(0), maturity: BigNumber.from(0), predicateLength: BigNumber.from(0), diff --git a/packages/transactions/src/coders/input.ts b/packages/transactions/src/coders/input.ts index c7f6f9c8a09..b65ea86df1e 100644 --- a/packages/transactions/src/coders/input.ts +++ b/packages/transactions/src/coders/input.ts @@ -21,8 +21,8 @@ export type InputCoin = { owner: string; /** Amount of coins (u64) */ amount: BigNumber; - /** Color of the coins (b256) */ - color: string; + /** Asset ID of the coins (b256) */ + assetId: string; /** Index of witness that authorizes spending the coin (u8) */ witnessIndex: BigNumber; /** UTXO being spent must have been created at least this many blocks ago (u64) */ @@ -48,7 +48,7 @@ export class InputCoinCoder extends Coder { parts.push(new UtxoIdCoder('utxoID').encode(value.utxoID)); parts.push(new B256Coder('owner', 'address').encode(value.owner)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); parts.push(new NumberCoder('witnessIndex', 'u8').encode(value.witnessIndex)); parts.push(new NumberCoder('maturity', 'u64').encode(value.maturity)); parts.push(new NumberCoder('predicateLength', 'u16').encode(value.predicateLength)); @@ -71,8 +71,8 @@ export class InputCoinCoder extends Coder { const owner = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; [decoded, o] = new NumberCoder('witnessIndex', 'u8').decode(data, o); const witnessIndex = decoded; [decoded, o] = new NumberCoder('maturity', 'u64').decode(data, o); @@ -92,7 +92,7 @@ export class InputCoinCoder extends Coder { utxoID, owner, amount, - color, + assetId, witnessIndex, maturity, predicateLength, diff --git a/packages/transactions/src/coders/output.test.ts b/packages/transactions/src/coders/output.test.ts index 39573b05306..22073cfaa3c 100644 --- a/packages/transactions/src/coders/output.test.ts +++ b/packages/transactions/src/coders/output.test.ts @@ -12,7 +12,7 @@ describe('OutputCoder', () => { type: OutputType.Coin, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, }; const encoded = hexlify(new OutputCoder('output').encode(output)); @@ -52,7 +52,7 @@ describe('OutputCoder', () => { type: OutputType.Withdrawal, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, }; const encoded = hexlify(new OutputCoder('output').encode(output)); @@ -72,7 +72,7 @@ describe('OutputCoder', () => { type: OutputType.Change, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, }; const encoded = hexlify(new OutputCoder('output').encode(output)); @@ -92,7 +92,7 @@ describe('OutputCoder', () => { type: OutputType.Variable, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, }; const encoded = hexlify(new OutputCoder('output').encode(output)); diff --git a/packages/transactions/src/coders/output.ts b/packages/transactions/src/coders/output.ts index 5bf3f483935..ea08fa96bba 100644 --- a/packages/transactions/src/coders/output.ts +++ b/packages/transactions/src/coders/output.ts @@ -18,8 +18,8 @@ export type OutputCoin = { to: string; /** Amount of coins to send (u64) */ amount: BigNumber; - /** Color of coins (b256) */ - color: string; + /** Asset ID of coins (b256) */ + assetId: string; }; export class OutputCoinCoder extends Coder { @@ -32,7 +32,7 @@ export class OutputCoinCoder extends Coder { parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); return concat(parts); } @@ -45,15 +45,15 @@ export class OutputCoinCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; return [ { type: OutputType.Coin, to, amount, - color, + assetId, }, o, ]; @@ -114,8 +114,8 @@ export type OutputWithdrawal = { to: string; /** Amount of coins to withdraw (u64) */ amount: BigNumber; - /** Color of coins (b256) */ - color: string; + /** Asset ID of coins (b256) */ + assetId: string; }; export class OutputWithdrawalCoder extends Coder { @@ -128,7 +128,7 @@ export class OutputWithdrawalCoder extends Coder { parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); return concat(parts); } @@ -141,15 +141,15 @@ export class OutputWithdrawalCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; return [ { type: OutputType.Withdrawal, to, amount, - color, + assetId, }, o, ]; @@ -162,8 +162,8 @@ export type OutputChange = { to: string; /** Amount of coins to send (u64) */ amount: BigNumber; - /** Color of coins (b256) */ - color: string; + /** Asset ID of coins (b256) */ + assetId: string; }; export class OutputChangeCoder extends Coder { @@ -176,7 +176,7 @@ export class OutputChangeCoder extends Coder { parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); return concat(parts); } @@ -189,15 +189,15 @@ export class OutputChangeCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; return [ { type: OutputType.Change, to, amount, - color, + assetId, }, o, ]; @@ -210,8 +210,8 @@ export type OutputVariable = { to: string; /** Amount of coins to send (u64) */ amount: BigNumber; - /** Color of coins (b256) */ - color: string; + /** Asset ID of coins (b256) */ + assetId: string; }; export class OutputVariableCoder extends Coder { @@ -224,7 +224,7 @@ export class OutputVariableCoder extends Coder { parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); return concat(parts); } @@ -237,15 +237,15 @@ export class OutputVariableCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; return [ { type: OutputType.Variable, to, amount, - color, + assetId, }, o, ]; diff --git a/packages/transactions/src/coders/receipt.test.ts b/packages/transactions/src/coders/receipt.test.ts index 9e6b8a4f04c..718319d3606 100644 --- a/packages/transactions/src/coders/receipt.test.ts +++ b/packages/transactions/src/coders/receipt.test.ts @@ -13,7 +13,7 @@ describe('ReceiptCoder', () => { from: B256, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, gas: BigNumber.from(0), param1: BigNumber.from(0), param2: BigNumber.from(0), @@ -174,7 +174,7 @@ describe('ReceiptCoder', () => { from: B256, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, pc: BigNumber.from(0), is: BigNumber.from(0), }; @@ -197,7 +197,7 @@ describe('ReceiptCoder', () => { from: B256, to: B256, amount: BigNumber.from(0), - color: B256, + assetId: B256, pc: BigNumber.from(0), is: BigNumber.from(0), }; diff --git a/packages/transactions/src/coders/receipt.ts b/packages/transactions/src/coders/receipt.ts index 5326e90e5ca..2cde8fe97f7 100644 --- a/packages/transactions/src/coders/receipt.ts +++ b/packages/transactions/src/coders/receipt.ts @@ -25,8 +25,8 @@ export type ReceiptCall = { to: string; /** Amount of coins to forward, i.e. $rB (u64) */ amount: BigNumber; - /** Color of coins to forward, i.e. MEM[$rC, 32] (b256) */ - color: string; + /** Asset ID of coins to forward, i.e. MEM[$rC, 32] (b256) */ + assetId: string; /** Gas to forward, i.e. $rD (u64) */ gas: BigNumber; /** First parameter (u64) */ @@ -50,7 +50,7 @@ export class ReceiptCallCoder extends Coder { parts.push(new B256Coder('from', 'address').encode(value.from)); parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); parts.push(new NumberCoder('gas', 'u64').encode(value.gas)); parts.push(new NumberCoder('param1', 'u64').encode(value.param1)); parts.push(new NumberCoder('param2', 'u64').encode(value.param2)); @@ -70,8 +70,8 @@ export class ReceiptCallCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; [decoded, o] = new NumberCoder('gas', 'u64').decode(data, o); const gas = decoded; [decoded, o] = new NumberCoder('param1', 'u64').decode(data, o); @@ -89,7 +89,7 @@ export class ReceiptCallCoder extends Coder { from, to, amount, - color, + assetId, gas, param1, param2, @@ -487,8 +487,8 @@ export type ReceiptTransfer = { to: string; /** Amount of coins transferred (u64) */ amount: BigNumber; - /** Color of coins transferred (b256) */ - color: string; + /** Asset ID of coins transferred (b256) */ + assetId: string; /** Value of register $pc (u64) */ pc: BigNumber; /** Value of register $is (u64) */ @@ -506,7 +506,7 @@ export class ReceiptTransferCoder extends Coder { parts.push(new B256Coder('from', 'address').encode(value.from)); parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); parts.push(new NumberCoder('pc', 'u64').encode(value.pc)); parts.push(new NumberCoder('is', 'u64').encode(value.is)); @@ -523,8 +523,8 @@ export class ReceiptTransferCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; [decoded, o] = new NumberCoder('pc', 'u64').decode(data, o); const pc = decoded; [decoded, o] = new NumberCoder('is', 'u64').decode(data, o); @@ -536,7 +536,7 @@ export class ReceiptTransferCoder extends Coder { from, to, amount, - color, + assetId, pc, is, }, @@ -553,8 +553,8 @@ export type ReceiptTransferOut = { to: string; /** Amount of coins transferred (u64) */ amount: BigNumber; - /** Color of coins transferred (b256) */ - color: string; + /** Asset ID of coins transferred (b256) */ + assetId: string; /** Value of register $pc (u64) */ pc: BigNumber; /** Value of register $is (u64) */ @@ -572,7 +572,7 @@ export class ReceiptTransferOutCoder extends Coder { parts.push(new B256Coder('from', 'address').encode(value.from)); parts.push(new B256Coder('to', 'address').encode(value.to)); parts.push(new NumberCoder('amount', 'u64').encode(value.amount)); - parts.push(new B256Coder('color', 'b256').encode(value.color)); + parts.push(new B256Coder('assetId', 'b256').encode(value.assetId)); parts.push(new NumberCoder('pc', 'u64').encode(value.pc)); parts.push(new NumberCoder('is', 'u64').encode(value.is)); @@ -589,8 +589,8 @@ export class ReceiptTransferOutCoder extends Coder { const to = decoded; [decoded, o] = new NumberCoder('amount', 'u64').decode(data, o); const amount = decoded; - [decoded, o] = new B256Coder('color', 'b256').decode(data, o); - const color = decoded; + [decoded, o] = new B256Coder('assetId', 'b256').decode(data, o); + const assetId = decoded; [decoded, o] = new NumberCoder('pc', 'u64').decode(data, o); const pc = decoded; [decoded, o] = new NumberCoder('is', 'u64').decode(data, o); @@ -602,7 +602,7 @@ export class ReceiptTransferOutCoder extends Coder { from, to, amount, - color, + assetId, pc, is, }, diff --git a/packages/typechain-target-fuels/example/token.json b/packages/typechain-target-fuels/example/token.json index af6e48e7a48..e945e462cd3 100644 --- a/packages/typechain-target-fuels/example/token.json +++ b/packages/typechain-target-fuels/example/token.json @@ -3,7 +3,7 @@ "inputs": [ { "name": "gas", "type": "u64" }, { "name": "coins", "type": "u64" }, - { "name": "color", "type": "b256" }, + { "name": "asset_id", "type": "b256" }, { "name": "args", "type": "tuple", @@ -21,7 +21,7 @@ "inputs": [ { "name": "gas", "type": "u64" }, { "name": "coins", "type": "u64" }, - { "name": "color", "type": "b256" }, + { "name": "asset_id", "type": "b256" }, { "name": "args", "type": "tuple", diff --git a/packages/typechain-target-fuels/example/types/Token.d.ts b/packages/typechain-target-fuels/example/types/Token.d.ts index 27239a49be3..8872f0d6faf 100644 --- a/packages/typechain-target-fuels/example/types/Token.d.ts +++ b/packages/typechain-target-fuels/example/types/Token.d.ts @@ -35,7 +35,7 @@ export class Token extends Contract { mint( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -43,7 +43,7 @@ export class Token extends Contract { "mint(u64,u64,b256,(b256,u64))"( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -51,7 +51,7 @@ export class Token extends Contract { send( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -59,7 +59,7 @@ export class Token extends Contract { "send(u64,u64,b256,(b256,b256,u64))"( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -68,7 +68,7 @@ export class Token extends Contract { mint( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -76,7 +76,7 @@ export class Token extends Contract { "mint(u64,u64,b256,(b256,u64))"( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -84,7 +84,7 @@ export class Token extends Contract { send( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -92,7 +92,7 @@ export class Token extends Contract { "send(u64,u64,b256,(b256,b256,u64))"( gas: BigNumberish, coins: BigNumberish, - color: string, + assetId: string, args: ArgsStruct, overrides?: Overrides & { from?: string | Promise } ): Promise; diff --git a/packages/typechain-target-fuels/example/types/factories/Token__factory.ts b/packages/typechain-target-fuels/example/types/factories/Token__factory.ts index 3a39b815884..ac87171be2a 100644 --- a/packages/typechain-target-fuels/example/types/factories/Token__factory.ts +++ b/packages/typechain-target-fuels/example/types/factories/Token__factory.ts @@ -18,7 +18,7 @@ const _abi = [ type: "u64", }, { - name: "color", + name: "asset_id", type: "b256", }, { @@ -51,7 +51,7 @@ const _abi = [ type: "u64", }, { - name: "color", + name: "asset_id", type: "b256", }, { diff --git a/packages/typechain-target-fuels/src/parser/abiParser.test.ts b/packages/typechain-target-fuels/src/parser/abiParser.test.ts index 08da3c15b93..2b8a219485b 100644 --- a/packages/typechain-target-fuels/src/parser/abiParser.test.ts +++ b/packages/typechain-target-fuels/src/parser/abiParser.test.ts @@ -5,7 +5,7 @@ const ABI = [ inputs: [ { name: 'gas', type: 'u64' }, { name: 'coins', type: 'u64' }, - { name: 'color', type: 'b256' }, + { name: 'asset_id', type: 'b256' }, { name: 'args', type: 'tuple', @@ -23,7 +23,7 @@ const ABI = [ inputs: [ { name: 'gas', type: 'u64' }, { name: 'coins', type: 'u64' }, - { name: 'color', type: 'b256' }, + { name: 'asset_id', type: 'b256' }, { name: 'args', type: 'tuple', @@ -68,7 +68,7 @@ describe('ABI parser', () => { }, }, { - name: 'color', + name: 'asset_id', type: { type: 'b256', originalType: 'b256', @@ -132,7 +132,7 @@ describe('ABI parser', () => { }, }, { - name: 'color', + name: 'asset_id', type: { type: 'b256', originalType: 'b256', diff --git a/packages/wallet/src/wallet.test.ts b/packages/wallet/src/wallet.test.ts index 33c36368752..3ff01010fa2 100644 --- a/packages/wallet/src/wallet.test.ts +++ b/packages/wallet/src/wallet.test.ts @@ -70,7 +70,7 @@ describe('Wallet', () => { it('Send transaction with signature using wallet instance', async () => { const wallet = new Wallet(signTransactionTest.privateKey); - const { owner, color } = sendTransactionTest.getCoins; + const { owner, assetId } = sendTransactionTest.getCoins; const transactionRequest: ScriptTransactionRequest = { ...sendTransactionTest.transaction, scriptData: randomBytes(32), @@ -79,7 +79,7 @@ describe('Wallet', () => { // Wait transaction to end await transactionResponse.wait(); - const toCoins = await wallet.provider.getCoins(owner, color); + const toCoins = await wallet.provider.getCoins(owner, assetId); expect(toCoins[0]).toEqual( expect.objectContaining({ diff --git a/services/fuel-core/Dockerfile b/services/fuel-core/Dockerfile index 61beb2f83bc..19aa80106ea 100644 --- a/services/fuel-core/Dockerfile +++ b/services/fuel-core/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/fuellabs/fuel-core:v0.3.2 +FROM ghcr.io/fuellabs/fuel-core:v0.4.1 ARG IP=0.0.0.0 ARG PORT=4000 diff --git a/services/fuel-core/chainConfig.json b/services/fuel-core/chainConfig.json index 3cf64810c8e..19fea2b0a18 100644 --- a/services/fuel-core/chainConfig.json +++ b/services/fuel-core/chainConfig.json @@ -7,32 +7,32 @@ { "owner": "0x0101010101010101010101010101010101010101010101010101010101010101", "amount": "0x0000000000989680", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000" + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "owner": "0x0101010101010101010101010101010101010101010101010101010101010101", "amount": "0x0000000000989680", - "color": "0x0101010101010101010101010101010101010101010101010101010101010101" + "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101" }, { "owner": "0x0101010101010101010101010101010101010101010101010101010101010101", "amount": "0x0000000000989680", - "color": "0x0202020202020202020202020202020202020202020202020202020202020202" + "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202" }, { "owner": "0x0202020202020202020202020202020202020202020202020202020202020202", "amount": "0x0000000000989680", - "color": "0x0000000000000000000000000000000000000000000000000000000000000000" + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "owner": "0x0202020202020202020202020202020202020202020202020202020202020202", "amount": "0x0000000000989680", - "color": "0x0101010101010101010101010101010101010101010101010101010101010101" + "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101" }, { "owner": "0x0202020202020202020202020202020202020202020202020202020202020202", "amount": "0x0000000000989680", - "color": "0x0202020202020202020202020202020202020202020202020202020202020202" + "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202" } ] }