@sentio/sdk 2.11.2-rc.2 → 2.11.3-rc.1

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.
@@ -31,6 +31,7 @@ class SuiCodegen extends AbstractCodegen {
31
31
  PREFIX = 'Sui';
32
32
  STRUCT_FIELD_NAME = 'fields';
33
33
  // GENERATE_ON_ENTRY = true
34
+ PAYLOAD_OPTIONAL = true;
34
35
  async fetchModules(account, network) {
35
36
  const client = getRpcClient(network);
36
37
  return await client.getNormalizedMoveModulesByPackage({ package: account });
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../../src/sui/codegen/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAA4B,MAAM,gBAAgB,CAAA;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,MAAM,GAAG,eAAe,EAAE,UAAU,GAAG,KAAK;IACzF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAM;KACP;IACD,MAAM,GAAG,GAAG,IAAI,UAAU,EAAE,CAAA;IAC5B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CA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port { SuiNetwork } from '../network.js'\nimport * as fs from 'fs'\nimport chalk from 'chalk'\nimport { InternalMoveModule, InternalMoveStruct } from '../../move/internal-models.js'\nimport { AbstractCodegen } from '../../move/abstract-codegen.js'\nimport { toInternalModule } from '../move-types.js'\nimport { moduleQname, SPLITTER, structQname, TypeDescriptor } from '../../move/index.js'\nimport { getMeaningfulFunctionParams } from '../utils.js'\n\nexport async function codegen(abisDir: string, outDir = 'src/types/sui', genExample = false) {\n if (!fs.existsSync(abisDir)) {\n return\n }\n const gen = new SuiCodegen()\n const numFiles = await gen.generate(abisDir, outDir)\n console.log(chalk.green(`Generated ${numFiles} for Sui`))\n}\n\nfunction getRpcEndpoint(network: SuiNetwork): string {\n switch (network) {\n case SuiNetwork.TEST_NET:\n return 'https://fullnode.testnet.sui.io/'\n }\n return 'https://fullnode.mainnet.sui.io/'\n}\n\nfunction getRpcClient(network: SuiNetwork): JsonRpcProvider {\n return new JsonRpcProvider(new Connection({ fullnode: getRpcEndpoint(network) }))\n}\n\nclass SuiCodegen extends AbstractCodegen<SuiMoveNormalizedModules, SuiNetwork> {\n ADDRESS_TYPE = 'SuiAddress'\n MAIN_NET = SuiNetwork.MAIN_NET\n TEST_NET = SuiNetwork.TEST_NET\n PREFIX = 'Sui'\n STRUCT_FIELD_NAME = 'fields'\n // GENERATE_ON_ENTRY = true\n\n async fetchModules(account: string, network: SuiNetwork): Promise<SuiMoveNormalizedModules> {\n const client = getRpcClient(network)\n return await client.getNormalizedMoveModulesByPackage({ package: account })\n }\n\n getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[] {\n return getMeaningfulFunctionParams(params)\n }\n\n toInternalModules(modules: SuiMoveNormalizedModules): InternalMoveModule[] {\n return Object.values(modules).map(toInternalModule)\n }\n\n getEventStructs(module: InternalMoveModule) {\n const qname = moduleQname(module)\n const eventMap = new Map<string, InternalMoveStruct>()\n\n for (const struct of module.structs) {\n const abilities = new Set(struct.abilities)\n if (abilities.has('Drop') && abilities.has('Copy')) {\n eventMap.set(qname + SPLITTER + struct.name, struct)\n }\n }\n return eventMap\n }\n\n readModulesFile(fullPath: string) {\n const res = super.readModulesFile(fullPath)\n if (res.result) {\n return res.result\n }\n return res\n }\n\n generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>): string {\n switch (structQname(module, struct)) {\n case '0x2::object::ID':\n return `export type ${struct.name} = string`\n case '0x2::coin::Coin':\n return `export type ${struct.name}<T> = string`\n case '0x1::option::Option':\n return `export type Option<T> = T | undefined`\n }\n return super.generateStructs(module, struct, events)\n }\n\n generateOnEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {\n switch (structQname(module, struct)) {\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n case '0x1::option::Option':\n return ''\n }\n return super.generateOnEvents(module, struct)\n }\n}\n"]}
1
+ {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../../src/sui/codegen/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAA4B,MAAM,gBAAgB,CAAA;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,MAAM,GAAG,eAAe,EAAE,UAAU,GAAG,KAAK;IACzF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAM;KACP;IACD,MAAM,GAAG,GAAG,IAAI,UAAU,EAAE,CAAA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AO,EAAE,CAAA;SACZ;QACD,OAAO,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/C,CAAC;CACF","sourcesContent":["import { Connection, JsonRpcProvider, SuiMoveNormalizedModules } from '@mysten/sui.js'\n\nimport { SuiNetwork } from '../network.js'\nimport * as fs from 'fs'\nimport chalk from 'chalk'\nimport { InternalMoveModule, InternalMoveStruct } from '../../move/internal-models.js'\nimport { AbstractCodegen } from '../../move/abstract-codegen.js'\nimport { toInternalModule } from '../move-types.js'\nimport { moduleQname, SPLITTER, structQname, TypeDescriptor } from '../../move/index.js'\nimport { getMeaningfulFunctionParams } from '../utils.js'\n\nexport async function codegen(abisDir: string, outDir = 'src/types/sui', genExample = false) {\n if (!fs.existsSync(abisDir)) {\n return\n }\n const gen = new SuiCodegen()\n const numFiles = await gen.generate(abisDir, outDir)\n console.log(chalk.green(`Generated ${numFiles} for Sui`))\n}\n\nfunction getRpcEndpoint(network: SuiNetwork): string {\n switch (network) {\n case SuiNetwork.TEST_NET:\n return 'https://fullnode.testnet.sui.io/'\n }\n return 'https://fullnode.mainnet.sui.io/'\n}\n\nfunction getRpcClient(network: SuiNetwork): JsonRpcProvider {\n return new JsonRpcProvider(new Connection({ fullnode: getRpcEndpoint(network) }))\n}\n\nclass SuiCodegen extends AbstractCodegen<SuiMoveNormalizedModules, SuiNetwork> {\n ADDRESS_TYPE = 'SuiAddress'\n MAIN_NET = SuiNetwork.MAIN_NET\n TEST_NET = SuiNetwork.TEST_NET\n PREFIX = 'Sui'\n STRUCT_FIELD_NAME = 'fields'\n // GENERATE_ON_ENTRY = true\n PAYLOAD_OPTIONAL = true\n\n async fetchModules(account: string, network: SuiNetwork): Promise<SuiMoveNormalizedModules> {\n const client = getRpcClient(network)\n return await client.getNormalizedMoveModulesByPackage({ package: account })\n }\n\n getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[] {\n return getMeaningfulFunctionParams(params)\n }\n\n toInternalModules(modules: SuiMoveNormalizedModules): InternalMoveModule[] {\n return Object.values(modules).map(toInternalModule)\n }\n\n getEventStructs(module: InternalMoveModule) {\n const qname = moduleQname(module)\n const eventMap = new Map<string, InternalMoveStruct>()\n\n for (const struct of module.structs) {\n const abilities = new Set(struct.abilities)\n if (abilities.has('Drop') && abilities.has('Copy')) {\n eventMap.set(qname + SPLITTER + struct.name, struct)\n }\n }\n return eventMap\n }\n\n readModulesFile(fullPath: string) {\n const res = super.readModulesFile(fullPath)\n if (res.result) {\n return res.result\n }\n return res\n }\n\n generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>): string {\n switch (structQname(module, struct)) {\n case '0x2::object::ID':\n return `export type ${struct.name} = string`\n case '0x2::coin::Coin':\n return `export type ${struct.name}<T> = string`\n case '0x1::option::Option':\n return `export type Option<T> = T | undefined`\n }\n return super.generateStructs(module, struct, events)\n }\n\n generateOnEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {\n switch (structQname(module, struct)) {\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n case '0x1::option::Option':\n return ''\n }\n return super.generateOnEvents(module, struct)\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { SuiEvent, MoveCallSuiTransaction, SuiMoveObject } from '@mysten/sui.js';
1
+ import type { SuiEvent, MoveCallSuiTransaction, SuiMoveObject } from '@mysten/sui.js';
2
2
  export type TypedEventInstance<T> = SuiEvent & {
3
3
  /**
4
4
  * decoded data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/sui/models.ts"],"names":[],"mappings":"","sourcesContent":["import { SuiEvent, MoveCallSuiTransaction, SuiMoveObject } from '@mysten/sui.js'\n\nexport type TypedEventInstance<T> = SuiEvent & {\n /**\n * decoded data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch\n */\n data_decoded: T\n\n type_arguments: string[]\n}\n\nexport type TypedFunctionPayload<T extends Array<any>> = MoveCallSuiTransaction & {\n /**\n * decoded argument data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch\n */\n arguments_decoded: T\n}\n\nexport type TypedSuiMoveObject<T> = SuiMoveObject & {\n data_decoded: T\n type_arguments: string[]\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/sui/models.ts"],"names":[],"mappings":"","sourcesContent":["import type { SuiEvent, MoveCallSuiTransaction, SuiMoveObject } from '@mysten/sui.js'\n\nexport type TypedEventInstance<T> = SuiEvent & {\n /**\n * decoded data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch\n */\n data_decoded: T\n\n type_arguments: string[]\n}\n\nexport type TypedFunctionPayload<T extends Array<any>> = MoveCallSuiTransaction & {\n /**\n * decoded argument data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch\n */\n arguments_decoded: T\n}\n\nexport type TypedSuiMoveObject<T> = SuiMoveObject & {\n data_decoded: T\n type_arguments: string[]\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentio/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.11.2-rc.2",
4
+ "version": "2.11.3-rc.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "compile": "tsc && cp src/utils/*.csv lib/utils && cp src/tsup.config.ts lib",
@@ -23,8 +23,8 @@
23
23
  "@project-serum/anchor": "^0.26.0",
24
24
  "@sentio/bigdecimal": "^9.1.1-patch.3",
25
25
  "@sentio/ethers-v6": "^1.0.28",
26
- "@sentio/protos": "^2.11.2-rc.2",
27
- "@sentio/runtime": "^2.11.2-rc.2",
26
+ "@sentio/protos": "^2.11.3-rc.1",
27
+ "@sentio/runtime": "^2.11.3-rc.1",
28
28
  "@solana/web3.js": "^1.74.0",
29
29
  "@types/prettier": "^2.7.2",
30
30
  "aptos-sdk": "npm:aptos@^1.7.2",
@@ -37,7 +37,6 @@
37
37
  "node-fetch": "^3.3.1",
38
38
  "p-queue": "^7.3.4",
39
39
  "prettier": "^2.8.7",
40
- "superstruct": "^1.0.3",
41
40
  "superstruct_solana": "npm:superstruct@^0.14.2",
42
41
  "typechain": "^8.0.0",
43
42
  "yaml": "^2.2.1"
@@ -47,6 +46,9 @@
47
46
  "@types/google-protobuf": "^3.15.6",
48
47
  "@types/lodash-es": "^4.17.6"
49
48
  },
49
+ "resolutions": {
50
+ "superstruct": "^1.0.3"
51
+ },
50
52
  "exports": {
51
53
  ".": "./lib/index.js",
52
54
  "./core": "./lib/core/index.js",
@@ -85,5 +87,5 @@
85
87
  "engines": {
86
88
  "node": ">=16"
87
89
  },
88
- "gitHead": "ba2c47c6e5c327b9386bbc107805c62251e9eb6c"
90
+ "gitHead": "60d4860a015dbf8cae46b66b86508962ff949ed2"
89
91
  }
@@ -32,6 +32,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
32
32
  STRUCT_FIELD_NAME: string = 'data'
33
33
  GENERATE_CLIENT = false
34
34
  GENERATE_ON_ENTRY = true
35
+ PAYLOAD_OPTIONAL = false
35
36
 
36
37
  abstract fetchModules(account: string, network: NetworkType): Promise<ModuleTypes>
37
38
  abstract toInternalModules(modules: ModuleTypes): InternalMoveModule[]
@@ -282,7 +283,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
282
283
  }
283
284
 
284
285
  const fields = this.getMeaningfulFunctionParams(func.params).map((param) => {
285
- return this.generateTypeForDescriptor(param, module.address)
286
+ return this.generateTypeForDescriptor(param, module.address) + (this.PAYLOAD_OPTIONAL ? ' | undefined' : '')
286
287
  })
287
288
 
288
289
  const camelFuncName = upperFirst(camelCase(func.name))
@@ -277,44 +277,58 @@ export namespace coin {
277
277
  }
278
278
 
279
279
  export interface BurnPayload<T0 = any>
280
- extends TypedFunctionPayload<[SuiAddress]> {
281
- arguments_decoded: [SuiAddress];
280
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
281
+ arguments_decoded: [SuiAddress | undefined];
282
282
  type_arguments: [string];
283
283
  }
284
284
 
285
285
  export interface JoinPayload<T0 = any>
286
- extends TypedFunctionPayload<[SuiAddress]> {
287
- arguments_decoded: [SuiAddress];
286
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
287
+ arguments_decoded: [SuiAddress | undefined];
288
288
  type_arguments: [string];
289
289
  }
290
290
 
291
291
  export interface MintAndTransferPayload<T0 = any>
292
- extends TypedFunctionPayload<[SuiAddress, bigint, SuiAddress]> {
293
- arguments_decoded: [SuiAddress, bigint, SuiAddress];
292
+ extends TypedFunctionPayload<
293
+ [SuiAddress | undefined, bigint | undefined, SuiAddress | undefined]
294
+ > {
295
+ arguments_decoded: [
296
+ SuiAddress | undefined,
297
+ bigint | undefined,
298
+ SuiAddress | undefined
299
+ ];
294
300
  type_arguments: [string];
295
301
  }
296
302
 
297
303
  export interface UpdateDescriptionPayload<T0 = any>
298
- extends TypedFunctionPayload<[SuiAddress, SuiAddress]> {
299
- arguments_decoded: [SuiAddress, SuiAddress];
304
+ extends TypedFunctionPayload<
305
+ [SuiAddress | undefined, SuiAddress | undefined]
306
+ > {
307
+ arguments_decoded: [SuiAddress | undefined, SuiAddress | undefined];
300
308
  type_arguments: [string];
301
309
  }
302
310
 
303
311
  export interface UpdateIconUrlPayload<T0 = any>
304
- extends TypedFunctionPayload<[SuiAddress, SuiAddress]> {
305
- arguments_decoded: [SuiAddress, SuiAddress];
312
+ extends TypedFunctionPayload<
313
+ [SuiAddress | undefined, SuiAddress | undefined]
314
+ > {
315
+ arguments_decoded: [SuiAddress | undefined, SuiAddress | undefined];
306
316
  type_arguments: [string];
307
317
  }
308
318
 
309
319
  export interface UpdateNamePayload<T0 = any>
310
- extends TypedFunctionPayload<[SuiAddress, SuiAddress]> {
311
- arguments_decoded: [SuiAddress, SuiAddress];
320
+ extends TypedFunctionPayload<
321
+ [SuiAddress | undefined, SuiAddress | undefined]
322
+ > {
323
+ arguments_decoded: [SuiAddress | undefined, SuiAddress | undefined];
312
324
  type_arguments: [string];
313
325
  }
314
326
 
315
327
  export interface UpdateSymbolPayload<T0 = any>
316
- extends TypedFunctionPayload<[SuiAddress, SuiAddress]> {
317
- arguments_decoded: [SuiAddress, SuiAddress];
328
+ extends TypedFunctionPayload<
329
+ [SuiAddress | undefined, SuiAddress | undefined]
330
+ > {
331
+ arguments_decoded: [SuiAddress | undefined, SuiAddress | undefined];
318
332
  type_arguments: [string];
319
333
  }
320
334
  }
@@ -490,32 +504,34 @@ export namespace display {
490
504
  }
491
505
 
492
506
  export interface AddPayload<T0 = any>
493
- extends TypedFunctionPayload<[SuiAddress, string]> {
494
- arguments_decoded: [SuiAddress, string];
507
+ extends TypedFunctionPayload<[SuiAddress | undefined, string | undefined]> {
508
+ arguments_decoded: [SuiAddress | undefined, string | undefined];
495
509
  type_arguments: [string];
496
510
  }
497
511
 
498
512
  export interface AddMultiplePayload<T0 = any>
499
- extends TypedFunctionPayload<[SuiAddress, string[]]> {
500
- arguments_decoded: [SuiAddress, string[]];
513
+ extends TypedFunctionPayload<
514
+ [SuiAddress | undefined, string[] | undefined]
515
+ > {
516
+ arguments_decoded: [SuiAddress | undefined, string[] | undefined];
501
517
  type_arguments: [string];
502
518
  }
503
519
 
504
520
  export interface CreateAndKeepPayload<T0 = any>
505
- extends TypedFunctionPayload<[SuiAddress]> {
506
- arguments_decoded: [SuiAddress];
521
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
522
+ arguments_decoded: [SuiAddress | undefined];
507
523
  type_arguments: [string];
508
524
  }
509
525
 
510
526
  export interface EditPayload<T0 = any>
511
- extends TypedFunctionPayload<[SuiAddress, string]> {
512
- arguments_decoded: [SuiAddress, string];
527
+ extends TypedFunctionPayload<[SuiAddress | undefined, string | undefined]> {
528
+ arguments_decoded: [SuiAddress | undefined, string | undefined];
513
529
  type_arguments: [string];
514
530
  }
515
531
 
516
532
  export interface RemovePayload<T0 = any>
517
- extends TypedFunctionPayload<[SuiAddress]> {
518
- arguments_decoded: [SuiAddress];
533
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
534
+ arguments_decoded: [SuiAddress | undefined];
519
535
  type_arguments: [string];
520
536
  }
521
537
 
@@ -1137,44 +1153,52 @@ export class pay extends SuiBaseProcessor {
1137
1153
 
1138
1154
  export namespace pay {
1139
1155
  export interface DivideAndKeepPayload<T0 = any>
1140
- extends TypedFunctionPayload<[SuiAddress, bigint]> {
1141
- arguments_decoded: [SuiAddress, bigint];
1156
+ extends TypedFunctionPayload<[SuiAddress | undefined, bigint | undefined]> {
1157
+ arguments_decoded: [SuiAddress | undefined, bigint | undefined];
1142
1158
  type_arguments: [string];
1143
1159
  }
1144
1160
 
1145
1161
  export interface JoinPayload<T0 = any>
1146
- extends TypedFunctionPayload<[SuiAddress]> {
1147
- arguments_decoded: [SuiAddress];
1162
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
1163
+ arguments_decoded: [SuiAddress | undefined];
1148
1164
  type_arguments: [string];
1149
1165
  }
1150
1166
 
1151
1167
  export interface JoinVecPayload<T0 = any>
1152
- extends TypedFunctionPayload<[SuiAddress]> {
1153
- arguments_decoded: [SuiAddress];
1168
+ extends TypedFunctionPayload<[SuiAddress | undefined]> {
1169
+ arguments_decoded: [SuiAddress | undefined];
1154
1170
  type_arguments: [string];
1155
1171
  }
1156
1172
 
1157
1173
  export interface JoinVecAndTransferPayload<T0 = any>
1158
- extends TypedFunctionPayload<[coin.Coin<T0>[]]> {
1159
- arguments_decoded: [coin.Coin<T0>[]];
1174
+ extends TypedFunctionPayload<[coin.Coin<T0>[] | undefined]> {
1175
+ arguments_decoded: [coin.Coin<T0>[] | undefined];
1160
1176
  type_arguments: [string];
1161
1177
  }
1162
1178
 
1163
1179
  export interface SplitPayload<T0 = any>
1164
- extends TypedFunctionPayload<[SuiAddress, bigint]> {
1165
- arguments_decoded: [SuiAddress, bigint];
1180
+ extends TypedFunctionPayload<[SuiAddress | undefined, bigint | undefined]> {
1181
+ arguments_decoded: [SuiAddress | undefined, bigint | undefined];
1166
1182
  type_arguments: [string];
1167
1183
  }
1168
1184
 
1169
1185
  export interface SplitAndTransferPayload<T0 = any>
1170
- extends TypedFunctionPayload<[SuiAddress, bigint, SuiAddress]> {
1171
- arguments_decoded: [SuiAddress, bigint, SuiAddress];
1186
+ extends TypedFunctionPayload<
1187
+ [SuiAddress | undefined, bigint | undefined, SuiAddress | undefined]
1188
+ > {
1189
+ arguments_decoded: [
1190
+ SuiAddress | undefined,
1191
+ bigint | undefined,
1192
+ SuiAddress | undefined
1193
+ ];
1172
1194
  type_arguments: [string];
1173
1195
  }
1174
1196
 
1175
1197
  export interface SplitVecPayload<T0 = any>
1176
- extends TypedFunctionPayload<[SuiAddress, bigint[]]> {
1177
- arguments_decoded: [SuiAddress, bigint[]];
1198
+ extends TypedFunctionPayload<
1199
+ [SuiAddress | undefined, bigint[] | undefined]
1200
+ > {
1201
+ arguments_decoded: [SuiAddress | undefined, bigint[] | undefined];
1178
1202
  type_arguments: [string];
1179
1203
  }
1180
1204
  }
@@ -1231,8 +1255,8 @@ export namespace sui {
1231
1255
  }
1232
1256
 
1233
1257
  export interface TransferPayload
1234
- extends TypedFunctionPayload<[coin.Coin<sui.SUI>]> {
1235
- arguments_decoded: [coin.Coin<sui.SUI>];
1258
+ extends TypedFunctionPayload<[coin.Coin<sui.SUI> | undefined]> {
1259
+ arguments_decoded: [coin.Coin<sui.SUI> | undefined];
1236
1260
  type_arguments: [];
1237
1261
  }
1238
1262
  }