From 605f095a6d76c8733909a778bd47002f3f578842 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:48:16 -0500 Subject: [PATCH] Update adatper msg factory --- .changeset/fluffy-queens-attend.md | 5 +++++ .../modules/msg-factory/Adapter.msg-factory.ts | 8 ++++---- .../src/utils/modules/msg-factory/Adapter.types.ts | 14 ++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 .changeset/fluffy-queens-attend.md diff --git a/.changeset/fluffy-queens-attend.md b/.changeset/fluffy-queens-attend.md new file mode 100644 index 00000000..0768f69e --- /dev/null +++ b/.changeset/fluffy-queens-attend.md @@ -0,0 +1,5 @@ +--- +"@abstract-money/core": patch +--- + +Update adapter execute msg factory with proper api diff --git a/packages/core/src/utils/modules/msg-factory/Adapter.msg-factory.ts b/packages/core/src/utils/modules/msg-factory/Adapter.msg-factory.ts index c8cb42ce..350f051c 100644 --- a/packages/core/src/utils/modules/msg-factory/Adapter.msg-factory.ts +++ b/packages/core/src/utils/modules/msg-factory/Adapter.msg-factory.ts @@ -33,18 +33,18 @@ import { export abstract class AdapterExecuteMsgFactory { /** * Make a request to an adapter module. - * @param accountAddress - * @param request + * @param accountAddress optionally specify the account address to execute the request on. If not specified, the request must come from the account itself. + * @param msg the message to execute on the adapter */ static executeAdapter = ({ accountAddress, - request, + ...rest }: CamelCasedProperties< AdapterRequestMsg >): AdapterExecuteMsg => { return ModuleExecuteMsgFactory.module({ account_address: accountAddress, - request, + msg: 'msg' in rest ? rest.msg : rest.request, }) } diff --git a/packages/core/src/utils/modules/msg-factory/Adapter.types.ts b/packages/core/src/utils/modules/msg-factory/Adapter.types.ts index 457ef94c..29380fae 100644 --- a/packages/core/src/utils/modules/msg-factory/Adapter.types.ts +++ b/packages/core/src/utils/modules/msg-factory/Adapter.types.ts @@ -6,10 +6,16 @@ export type AdapterBaseExecuteMsg = { to_remove?: string[] | null } } -export type AdapterRequestMsg = { - account_address?: string | null - request: TAppMsg -} +export type AdapterRequestMsg = + | { + account_address?: string | null + msg: TAppMsg + } + | /** @deprecated */ { + account_address?: string | null + /** @deprecated */ + request: TAppMsg + } export type AdapterExecuteMsg = ModuleExecuteMsg< AdapterBaseExecuteMsg,