diff --git a/.changeset/wicked-socks-breathe.md b/.changeset/wicked-socks-breathe.md new file mode 100644 index 00000000000..c142bd311f0 --- /dev/null +++ b/.changeset/wicked-socks-breathe.md @@ -0,0 +1,6 @@ +--- +"@fuel-ts/abi-coder": patch +"@fuel-ts/abi-typegen": patch +--- + +chore: added `messagesTypes` to `JsonAbi` diff --git a/packages/abi-coder/src/types/JsonAbi.ts b/packages/abi-coder/src/types/JsonAbi.ts index 6df0b2d9d6e..2e481d27aaf 100644 --- a/packages/abi-coder/src/types/JsonAbi.ts +++ b/packages/abi-coder/src/types/JsonAbi.ts @@ -6,6 +6,7 @@ export interface JsonAbi { readonly types: readonly JsonAbiType[]; readonly loggedTypes: readonly JsonAbiLoggedType[]; readonly functions: readonly JsonAbiFunction[]; + readonly messagesTypes: readonly JsonAbiMessagesType[]; readonly configurables: readonly JsonAbiConfigurable[]; readonly encoding?: string; } @@ -16,17 +17,27 @@ export interface JsonAbiType { readonly components: readonly JsonAbiArgument[] | null; readonly typeParameters: readonly number[] | null; } + export interface JsonAbiArgument { readonly type: number; readonly name: string; readonly typeArguments: readonly JsonAbiArgument[] | null; } +export interface JsonAbiArgumentWithoutName { + readonly type: number; + readonly typeArguments: readonly JsonAbiArgumentWithoutName[] | null; +} + export interface JsonAbiLoggedType { readonly logId: string; readonly loggedType: JsonAbiArgument; } +export interface JsonAbiMessagesType { + readonly messageDataType: JsonAbiArgumentWithoutName; +} + export interface JsonAbiFunction { readonly name: string; readonly inputs: readonly JsonAbiArgument[]; diff --git a/packages/abi-typegen/src/types/interfaces/IRawAbi.ts b/packages/abi-typegen/src/types/interfaces/IRawAbi.ts index a0c46accbde..ee8753614f6 100644 --- a/packages/abi-typegen/src/types/interfaces/IRawAbi.ts +++ b/packages/abi-typegen/src/types/interfaces/IRawAbi.ts @@ -1,6 +1,7 @@ import type { IRawAbiConfigurable } from './IRawAbiConfigurable'; import type { IRawAbiFunction } from './IRawAbiFunction'; import type { IRawAbiLoggedTypes } from './IRawAbiLoggedTypes'; +import type { IRawAbiMessagesType } from './IRawAbiMessagesType'; import type { IRawAbiTypeRoot } from './IRawAbiType'; export interface IRawAbi { @@ -8,4 +9,5 @@ export interface IRawAbi { functions: IRawAbiFunction[]; loggedTypes: IRawAbiLoggedTypes[]; configurables: IRawAbiConfigurable[]; + messagesTypes: IRawAbiMessagesType[]; } diff --git a/packages/abi-typegen/src/types/interfaces/IRawAbiMessagesType.ts b/packages/abi-typegen/src/types/interfaces/IRawAbiMessagesType.ts new file mode 100644 index 00000000000..4d6993cb35f --- /dev/null +++ b/packages/abi-typegen/src/types/interfaces/IRawAbiMessagesType.ts @@ -0,0 +1,8 @@ +export interface IRawAbiMessagesType { + messageDataType: IRawAbiMessageDataType; +} + +export interface IRawAbiMessageDataType { + type: number; + typeArguments: null | IRawAbiMessageDataType[]; +} diff --git a/packages/account/test/fixtures/predicate-abi.ts b/packages/account/test/fixtures/predicate-abi.ts index df0ab35435b..c1f6d092238 100644 --- a/packages/account/test/fixtures/predicate-abi.ts +++ b/packages/account/test/fixtures/predicate-abi.ts @@ -34,5 +34,6 @@ export const predicateAbi: JsonAbi = { }, ], loggedTypes: [], + messagesTypes: [], configurables: [], }; diff --git a/packages/account/test/fixtures/transaction-summary.ts b/packages/account/test/fixtures/transaction-summary.ts index 1410ae72831..1b0b3e8c2a1 100644 --- a/packages/account/test/fixtures/transaction-summary.ts +++ b/packages/account/test/fixtures/transaction-summary.ts @@ -256,6 +256,7 @@ export const MOCK_ABI_MAP: AbiMap = { }, ], loggedTypes: [], + messagesTypes: [], configurables: [], }, }; diff --git a/packages/account/test/fuel-wallet-connector.test.ts b/packages/account/test/fuel-wallet-connector.test.ts index 4653a92a21d..5ac5b2af478 100644 --- a/packages/account/test/fuel-wallet-connector.test.ts +++ b/packages/account/test/fuel-wallet-connector.test.ts @@ -286,6 +286,7 @@ describe('Fuel Connector', () => { types: [], loggedTypes: [], functions: [], + messagesTypes: [], configurables: [], }); expect(isAdded).toEqual(true); diff --git a/packages/program/src/contract.test.ts b/packages/program/src/contract.test.ts index 78e3aa3123c..d861b27d4d0 100644 --- a/packages/program/src/contract.test.ts +++ b/packages/program/src/contract.test.ts @@ -33,6 +33,7 @@ const ABI: JsonAbi = { }, ], loggedTypes: [], + messagesTypes: [], configurables: [], }; diff --git a/packages/script/test/mocks.ts b/packages/script/test/mocks.ts index dbb32496a4b..6c7b8a9516f 100644 --- a/packages/script/test/mocks.ts +++ b/packages/script/test/mocks.ts @@ -3,6 +3,7 @@ import type { JsonAbi } from '@fuel-ts/abi-coder'; export const jsonAbiFragmentMock: JsonAbi = { configurables: [], loggedTypes: [], + messagesTypes: [], types: [ { typeId: 0, @@ -88,5 +89,6 @@ export const jsonAbiMock: JsonAbi = { }, ], loggedTypes: [], + messagesTypes: [], configurables: [], };