@typemove/sui 1.5.2 → 1.5.3-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,8 +121,11 @@ export class SuiCodegen extends AbstractCodegen<
121
121
 
122
122
  private generateArgs(module: InternalMoveModule, func: InternalMoveFunction) {
123
123
  const args = []
124
+ const argsLen = func.params.length
124
125
  for (const [idx, arg] of func.params.entries()) {
125
- if (arg.reference) {
126
+ if (idx === argsLen - 1 && arg.qname === '0x2::tx_context::TxContext') {
127
+ // no op
128
+ } else if (arg.reference) {
126
129
  args.push({
127
130
  paramType: `${this.ADDRESS_TYPE} | ObjectCallArg | TransactionArgument`,
128
131
  callValue: `_args.push(transactionArgumentOrObject(args[${idx}], tx))`
@@ -197,7 +200,7 @@ export class SuiCodegen extends AbstractCodegen<
197
200
  return `export function ${camel(normalizeToJSName(func.name))}${genericString}(tx: TransactionBlock,
198
201
  args: [${args.map((a) => a.paramType).join(',')}],
199
202
  ${typeParamArg.length > 0 ? `typeArguments: [${typeParamArg}]` : ``} ):
200
- TransactionArgument & [ ${'TransactionArgument,'.repeat(func.params.length)} ] {
203
+ TransactionArgument & [ ${'TransactionArgument,'.repeat(args.length)} ] {
201
204
  const _args: any[] = []
202
205
  ${args.map((a) => a.callValue).join('\n')}
203
206
 
@@ -99,15 +99,12 @@ export namespace oracle {
99
99
  args: [
100
100
  string | ObjectCallArg | TransactionArgument,
101
101
  string | TransactionArgument,
102
- string | ObjectCallArg | TransactionArgument,
103
102
  ],
104
103
  typeArguments: [TypeDescriptor<T0> | string],
105
- ): TransactionArgument &
106
- [TransactionArgument, TransactionArgument, TransactionArgument] {
104
+ ): TransactionArgument & [TransactionArgument, TransactionArgument] {
107
105
  const _args: any[] = [];
108
106
  _args.push(transactionArgumentOrObject(args[0], tx));
109
107
  _args.push(transactionArgumentOrPure(args[1], tx));
110
- _args.push(transactionArgumentOrObject(args[2], tx));
111
108
 
112
109
  // @ts-ignore
113
110
  return tx.moveCall({
@@ -143,15 +140,11 @@ export namespace oracle {
143
140
  }
144
141
  export function newOracle<T0 = any>(
145
142
  tx: TransactionBlock,
146
- args: [
147
- bigint | TransactionArgument,
148
- string | ObjectCallArg | TransactionArgument,
149
- ],
143
+ args: [bigint | TransactionArgument],
150
144
  typeArguments: [TypeDescriptor<T0> | string],
151
- ): TransactionArgument & [TransactionArgument, TransactionArgument] {
145
+ ): TransactionArgument & [TransactionArgument] {
152
146
  const _args: any[] = [];
153
147
  _args.push(transactionArgumentOrPure(args[0], tx));
154
- _args.push(transactionArgumentOrObject(args[1], tx));
155
148
 
156
149
  // @ts-ignore
157
150
  return tx.moveCall({
@@ -173,7 +166,6 @@ export namespace oracle {
173
166
  bigint | TransactionArgument,
174
167
  bigint | TransactionArgument,
175
168
  bigint | TransactionArgument,
176
- string | ObjectCallArg | TransactionArgument,
177
169
  ],
178
170
  typeArguments: [TypeDescriptor<T0> | string],
179
171
  ): TransactionArgument &
@@ -183,7 +175,6 @@ export namespace oracle {
183
175
  TransactionArgument,
184
176
  TransactionArgument,
185
177
  TransactionArgument,
186
- TransactionArgument,
187
178
  ] {
188
179
  const _args: any[] = [];
189
180
  _args.push(transactionArgumentOrObject(args[0], tx));
@@ -191,7 +182,6 @@ export namespace oracle {
191
182
  _args.push(transactionArgumentOrPure(args[2], tx));
192
183
  _args.push(transactionArgumentOrPure(args[3], tx));
193
184
  _args.push(transactionArgumentOrPure(args[4], tx));
194
- _args.push(transactionArgumentOrObject(args[5], tx));
195
185
 
196
186
  // @ts-ignore
197
187
  return tx.moveCall({
@@ -212,7 +202,6 @@ export namespace oracle {
212
202
  args: [
213
203
  string | ObjectCallArg | TransactionArgument,
214
204
  string | TransactionArgument,
215
- string | ObjectCallArg | TransactionArgument,
216
205
  ],
217
206
  typeArguments: [TypeDescriptor<T0> | string],
218
207
  ): Promise<TypedDevInspectResults<[]>> {
@@ -245,10 +234,7 @@ export namespace oracle {
245
234
  }
246
235
  export async function newOracle<T0 = any>(
247
236
  client: SuiClient,
248
- args: [
249
- bigint | TransactionArgument,
250
- string | ObjectCallArg | TransactionArgument,
251
- ],
237
+ args: [bigint | TransactionArgument],
252
238
  typeArguments: [TypeDescriptor<T0> | string],
253
239
  ): Promise<TypedDevInspectResults<[]>> {
254
240
  const tx = new TransactionBlock();
@@ -270,7 +256,6 @@ export namespace oracle {
270
256
  bigint | TransactionArgument,
271
257
  bigint | TransactionArgument,
272
258
  bigint | TransactionArgument,
273
- string | ObjectCallArg | TransactionArgument,
274
259
  ],
275
260
  typeArguments: [TypeDescriptor<T0> | string],
276
261
  ): Promise<TypedDevInspectResults<[]>> {