Skip to content

Commit a9d3a03

Browse files
committed
Update react-query to use normal funds in mutations
1 parent 8dc8c22 commit a9d3a03

File tree

2 files changed

+31
-36
lines changed

2 files changed

+31
-36
lines changed

packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,9 @@ export function useSg721BurnMutation(options?: Omit<UseMutationOptions<ExecuteRe
11431143
args: {
11441144
fee,
11451145
memo,
1146-
_funds
1146+
funds
11471147
} = {}
1148-
}) => client.burn(msg, fee, memo, _funds), options);
1148+
}) => client.burn(msg, fee, memo, funds), options);
11491149
}
11501150
export interface Sg721MintMutation {
11511151
client: Sg721Client;
@@ -1168,9 +1168,9 @@ export function useSg721MintMutation(options?: Omit<UseMutationOptions<ExecuteRe
11681168
args: {
11691169
fee,
11701170
memo,
1171-
_funds
1171+
funds
11721172
} = {}
1173-
}) => client.mint(msg, fee, memo, _funds), options);
1173+
}) => client.mint(msg, fee, memo, funds), options);
11741174
}
11751175
export interface Sg721RevokeAllMutation {
11761176
client: Sg721Client;
@@ -1190,9 +1190,9 @@ export function useSg721RevokeAllMutation(options?: Omit<UseMutationOptions<Exec
11901190
args: {
11911191
fee,
11921192
memo,
1193-
_funds
1193+
funds
11941194
} = {}
1195-
}) => client.revokeAll(msg, fee, memo, _funds), options);
1195+
}) => client.revokeAll(msg, fee, memo, funds), options);
11961196
}
11971197
export interface Sg721ApproveAllMutation {
11981198
client: Sg721Client;
@@ -1213,9 +1213,9 @@ export function useSg721ApproveAllMutation(options?: Omit<UseMutationOptions<Exe
12131213
args: {
12141214
fee,
12151215
memo,
1216-
_funds
1216+
funds
12171217
} = {}
1218-
}) => client.approveAll(msg, fee, memo, _funds), options);
1218+
}) => client.approveAll(msg, fee, memo, funds), options);
12191219
}
12201220
export interface Sg721RevokeMutation {
12211221
client: Sg721Client;
@@ -1236,9 +1236,9 @@ export function useSg721RevokeMutation(options?: Omit<UseMutationOptions<Execute
12361236
args: {
12371237
fee,
12381238
memo,
1239-
_funds
1239+
funds
12401240
} = {}
1241-
}) => client.revoke(msg, fee, memo, _funds), options);
1241+
}) => client.revoke(msg, fee, memo, funds), options);
12421242
}
12431243
export interface Sg721ApproveMutation {
12441244
client: Sg721Client;
@@ -1260,9 +1260,9 @@ export function useSg721ApproveMutation(options?: Omit<UseMutationOptions<Execut
12601260
args: {
12611261
fee,
12621262
memo,
1263-
_funds
1263+
funds
12641264
} = {}
1265-
}) => client.approve(msg, fee, memo, _funds), options);
1265+
}) => client.approve(msg, fee, memo, funds), options);
12661266
}
12671267
export interface Sg721SendNftMutation {
12681268
client: Sg721Client;
@@ -1284,9 +1284,9 @@ export function useSg721SendNftMutation(options?: Omit<UseMutationOptions<Execut
12841284
args: {
12851285
fee,
12861286
memo,
1287-
_funds
1287+
funds
12881288
} = {}
1289-
}) => client.sendNft(msg, fee, memo, _funds), options);
1289+
}) => client.sendNft(msg, fee, memo, funds), options);
12901290
}
12911291
export interface Sg721TransferNftMutation {
12921292
client: Sg721Client;
@@ -1307,9 +1307,9 @@ export function useSg721TransferNftMutation(options?: Omit<UseMutationOptions<Ex
13071307
args: {
13081308
fee,
13091309
memo,
1310-
_funds
1310+
funds
13111311
} = {}
1312-
}) => client.transferNft(msg, fee, memo, _funds), options);
1312+
}) => client.transferNft(msg, fee, memo, funds), options);
13131313
}"
13141314
`;
13151315

@@ -1330,9 +1330,9 @@ export function useOwnershipUpdateOwnershipMutation(options?: Omit<UseMutationOp
13301330
args: {
13311331
fee,
13321332
memo,
1333-
_funds
1333+
funds
13341334
} = {}
1335-
}) => client.updateOwnership(msg, fee, memo, _funds), options);
1335+
}) => client.updateOwnership(msg, fee, memo, funds), options);
13361336
}
13371337
export interface OwnershipSetFactoryMutation {
13381338
client: OwnershipClient;
@@ -1352,8 +1352,8 @@ export function useOwnershipSetFactoryMutation(options?: Omit<UseMutationOptions
13521352
args: {
13531353
fee,
13541354
memo,
1355-
_funds
1355+
funds
13561356
} = {}
1357-
}) => client.setFactory(msg, fee, memo, _funds), options);
1357+
}) => client.setFactory(msg, fee, memo, funds), options);
13581358
}"
13591359
`;

packages/wasm-ast-types/src/react-query/react-query.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,7 @@ export const createReactQueryMutationArgsInterface = ({
431431
t.tsTypeLiteral([
432432
propertySignature('fee', OPTIONAL_FEE_PARAM.typeAnnotation, true),
433433
propertySignature('memo', OPTIONAL_MEMO_PARAM.typeAnnotation, true),
434-
{
435-
...propertySignature(
436-
'funds',
437-
OPTIONAL_FUNDS_PARAM.typeAnnotation,
438-
true
439-
),
440-
value: '_funds'
441-
}
434+
propertySignature('funds', OPTIONAL_FUNDS_PARAM.typeAnnotation, true)
442435
])
443436
)
444437
);
@@ -573,9 +566,11 @@ export const createReactQueryMutationHook = ({
573566
t.objectProperty(
574567
t.identifier('args'),
575568
t.assignmentPattern(
576-
t.objectPattern(
577-
FIXED_EXECUTE_PARAMS.map((param) => shorthandProperty(param.name))
578-
),
569+
t.objectPattern([
570+
shorthandProperty('fee'),
571+
shorthandProperty('memo'),
572+
shorthandProperty('funds')
573+
]),
579574
t.objectExpression([])
580575
)
581576
)
@@ -611,11 +606,11 @@ export const createReactQueryMutationHook = ({
611606
t.identifier('client'),
612607
t.identifier(execMethodName)
613608
),
614-
(hasMsg ? [t.identifier('msg')] : []).concat(
615-
FIXED_EXECUTE_PARAMS.map((param) =>
616-
t.identifier(param.name)
617-
)
618-
)
609+
(hasMsg ? [t.identifier('msg')] : []).concat([
610+
t.identifier('fee'),
611+
t.identifier('memo'),
612+
t.identifier('funds')
613+
])
619614
),
620615
false // not async
621616
),

0 commit comments

Comments
 (0)