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,