@sentio/sdk 1.22.2 → 1.23.0

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.
Files changed (51) hide show
  1. package/lib/aptos/aptos-processor.js +10 -13
  2. package/lib/aptos/aptos-processor.js.map +1 -1
  3. package/lib/aptos/context.d.ts +3 -2
  4. package/lib/aptos/context.js +5 -3
  5. package/lib/aptos/context.js.map +1 -1
  6. package/lib/aptos/index.d.ts +2 -2
  7. package/lib/aptos/index.js +3 -3
  8. package/lib/aptos/index.js.map +1 -1
  9. package/lib/aptos/{bind-options.d.ts → network.d.ts} +3 -0
  10. package/lib/aptos/network.js +41 -0
  11. package/lib/aptos/network.js.map +1 -0
  12. package/lib/aptos/runtime.d.ts +1 -1
  13. package/lib/aptos/runtime.js.map +1 -1
  14. package/lib/aptos/types.d.ts +1 -1
  15. package/lib/aptos/types.js.map +1 -1
  16. package/lib/aptos/utils.d.ts +1 -1
  17. package/lib/aptos/utils.js.map +1 -1
  18. package/lib/aptos-codegen/codegen.d.ts +12 -5
  19. package/lib/aptos-codegen/codegen.js +81 -36
  20. package/lib/aptos-codegen/codegen.js.map +1 -1
  21. package/lib/aptos-codegen/typegen.d.ts +1 -1
  22. package/lib/aptos-codegen/typegen.js.map +1 -1
  23. package/lib/builtin/aptos/0x1.d.ts +1 -1
  24. package/lib/builtin/aptos/0x1.js +16 -16
  25. package/lib/builtin/aptos/0x1.js.map +1 -1
  26. package/lib/builtin/aptos/0x3.d.ts +1 -1
  27. package/lib/builtin/aptos/0x3.js +3 -3
  28. package/lib/builtin/aptos/0x3.js.map +1 -1
  29. package/lib/cli/webpack.config.js +2 -1
  30. package/lib/service.js.map +1 -1
  31. package/lib/tests/types/aptos/souffle.d.ts +1 -1
  32. package/lib/tests/types/aptos/souffle.js +2 -2
  33. package/lib/tests/types/aptos/souffle.js.map +1 -1
  34. package/package.json +2 -2
  35. package/src/aptos/aptos-processor.ts +28 -13
  36. package/src/aptos/context.ts +12 -4
  37. package/src/aptos/index.ts +2 -2
  38. package/src/aptos/network.ts +39 -0
  39. package/src/aptos/runtime.ts +1 -1
  40. package/src/aptos/types.ts +1 -1
  41. package/src/aptos/utils.ts +1 -1
  42. package/src/aptos-codegen/codegen.ts +97 -39
  43. package/src/aptos-codegen/typegen.ts +1 -1
  44. package/src/builtin/aptos/0x1.ts +17 -17
  45. package/src/builtin/aptos/0x3.ts +4 -4
  46. package/src/cli/webpack.config.js +2 -1
  47. package/src/service.ts +0 -1
  48. package/src/tests/types/aptos/souffle.ts +3 -3
  49. package/lib/aptos/bind-options.js +0 -16
  50. package/lib/aptos/bind-options.js.map +0 -1
  51. package/src/aptos/bind-options.ts +0 -14
@@ -4,7 +4,7 @@ import {
4
4
  MoveModule,
5
5
  MoveStruct,
6
6
  TransactionPayload_EntryFunctionPayload,
7
- } from 'aptos/src/generated'
7
+ } from 'aptos-sdk/src/generated'
8
8
  import { moduleQname, SPLITTER, VECTOR_STR } from './utils'
9
9
  import { parseMoveType } from '../aptos-codegen/typegen'
10
10
 
@@ -1,4 +1,4 @@
1
- import { MoveModule } from 'aptos/src/generated'
1
+ import { MoveModule } from 'aptos-sdk/src/generated'
2
2
 
3
3
  export const SPLITTER = '::'
4
4
 
@@ -1,61 +1,107 @@
1
1
  import fs from 'fs'
2
2
  import path from 'path'
3
3
  import prettier from 'prettier'
4
- import { MoveFunction, MoveModule, MoveStruct, MoveModuleBytecode } from 'aptos/src/generated'
5
- import { generateType, AccountRegister } from './typegen'
4
+ import { MoveFunction, MoveModule, MoveModuleBytecode, MoveStruct } from 'aptos-sdk/src/generated'
5
+ import { AccountModulesImportInfo, AccountRegister, generateType } from './typegen'
6
6
  import { isFrameworkAccount } from '../aptos/utils'
7
+ import chalk from 'chalk'
8
+ import { AptosNetwork, getChainName, getChainRpcEndpoint } from '../aptos/network'
9
+ import { AptosClient } from 'aptos-sdk'
7
10
 
8
- export function generate(srcDir: string, outputDir: string) {
11
+ export async function generate(srcDir: string, outputDir: string) {
12
+ await generateForNetwork(srcDir, outputDir, AptosNetwork.MAIN_NET)
13
+ await generateForNetwork(path.join(srcDir, 'testnet'), path.join(outputDir, 'testnet'), AptosNetwork.TEST_NET)
14
+ }
15
+
16
+ export async function generateForNetwork(srcDir: string, outputDir: string, network: AptosNetwork) {
17
+ if (!fs.existsSync(srcDir)) {
18
+ return
19
+ }
20
+ if (network === AptosNetwork.TEST_NET) {
21
+ console.log('Found testnet directory, generate code for testnet modules')
22
+ }
9
23
  const files = fs.readdirSync(srcDir)
10
24
  outputDir = path.resolve(outputDir)
25
+ const outputs: OutputFile[] = []
11
26
 
12
27
  fs.mkdirSync(outputDir, { recursive: true })
13
28
 
14
29
  const loader = new AccountRegister()
15
30
 
16
- // The first path, identify import relation and module name (filename) of those imports
31
+ // when generating user code, don't need to generate framework account
32
+ loader.accountImports.set('0x1', new AccountModulesImportInfo('0x1', '0x1'))
33
+ loader.accountImports.set('0x2', new AccountModulesImportInfo('0x2', '0x2'))
34
+ loader.accountImports.set('0x3', new AccountModulesImportInfo('0x3', '0x3'))
35
+ const client = new AptosClient(getChainRpcEndpoint(network))
36
+
17
37
  for (const file of files) {
18
38
  if (!file.endsWith('.json')) {
19
39
  continue
20
40
  }
21
- // Reading file is duplicated, but since they are small files probably file
22
- // TODO add file manager class
23
- const json = fs.readFileSync(path.join(srcDir, file), 'utf-8')
24
- const modules = JSON.parse(json)
41
+ const fullPath = path.resolve(srcDir, file)
42
+ const modules = JSON.parse(fs.readFileSync(fullPath, 'utf-8'))
25
43
 
26
44
  for (const module of modules) {
27
45
  if (module.abi) {
28
46
  loader.register(module.abi, path.basename(file, '.json'))
29
47
  }
30
48
  }
31
- }
32
-
33
- for (const file of files) {
34
- if (!file.endsWith('.json')) {
35
- continue
36
- }
37
- const codeGen = new AccountCodegen(loader, {
38
- srcFile: path.join(srcDir, file),
49
+ const codeGen = new AccountCodegen(loader, modules, {
50
+ fileName: path.basename(file, '.json'),
39
51
  outputDir: outputDir,
52
+ network,
40
53
  })
41
54
 
42
- codeGen.generate()
55
+ outputs.push(...codeGen.generate())
43
56
  }
44
57
 
45
- // when generating user code, don't need to generate framework account
46
- loader.pendingAccounts.delete('0x1')
47
- loader.pendingAccounts.delete('0x2')
48
- loader.pendingAccounts.delete('0x3')
58
+ while (loader.pendingAccounts.size > 0) {
59
+ for (const account of loader.pendingAccounts) {
60
+ console.log(`download depended module for account ${account} at ${getChainName(network)}`)
49
61
 
50
- if (loader.pendingAccounts.size > 0) {
51
- // TODO automatic download dependencies
52
- console.error('Missing ABIs from the following accounts', loader.pendingAccounts)
62
+ try {
63
+ const modules = await client.getAccountModules(account)
64
+ fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(modules, null, '\t'))
65
+
66
+ for (const module of modules) {
67
+ if (module.abi) {
68
+ loader.register(module.abi, account)
69
+ }
70
+ }
71
+ const codeGen = new AccountCodegen(loader, modules, {
72
+ fileName: account,
73
+ outputDir: outputDir,
74
+ network,
75
+ })
76
+
77
+ outputs.push(...codeGen.generate())
78
+ } catch (e) {
79
+ console.error(
80
+ chalk.red(
81
+ 'Error downloading account module, check if you choose the right network,or download account modules manually into your director'
82
+ )
83
+ )
84
+ console.error(e)
85
+ process.exit(1)
86
+ }
87
+ }
53
88
  }
89
+
90
+ for (const output of outputs) {
91
+ const content = prettier.format(output.fileContent, { parser: 'typescript' })
92
+ fs.writeFileSync(path.join(outputDir, output.fileName), content)
93
+ }
94
+ }
95
+
96
+ interface OutputFile {
97
+ fileName: string
98
+ fileContent: string
54
99
  }
55
100
 
56
101
  interface Config {
57
- srcFile: string
102
+ fileName: string
58
103
  outputDir: string
104
+ network: AptosNetwork
59
105
  }
60
106
 
61
107
  export class AccountCodegen {
@@ -63,18 +109,18 @@ export class AccountCodegen {
63
109
  config: Config
64
110
  loader: AccountRegister
65
111
 
66
- constructor(loader: AccountRegister, config: Config) {
67
- const json = fs.readFileSync(config.srcFile, 'utf-8')
68
- this.modules = JSON.parse(json)
112
+ constructor(loader: AccountRegister, modules: MoveModuleBytecode[], config: Config) {
113
+ // const json = fs.readFileSync(config.srcFile, 'utf-8')
114
+ this.modules = modules
69
115
  this.config = config
70
116
  this.loader = loader
71
117
  }
72
118
 
73
- generate() {
119
+ generate(): OutputFile[] {
74
120
  if (!this.modules) {
75
- return
121
+ return []
76
122
  }
77
- const baseName = path.basename(this.config.srcFile, '.json')
123
+ // const baseName = path.basename(this.config.fileName, '.json')
78
124
 
79
125
  let address: string | undefined
80
126
  for (const module of this.modules) {
@@ -83,12 +129,12 @@ export class AccountCodegen {
83
129
  }
84
130
  }
85
131
  if (!address) {
86
- return
132
+ return []
87
133
  }
88
134
 
89
135
  const imports = `
90
136
  import { aptos } from "@sentio/sdk"
91
- import { Address, MoveModule } from "aptos/src/generated"
137
+ import { Address, MoveModule } from "aptos-sdk/src/generated"
92
138
  `
93
139
 
94
140
  const dependedAccounts: string[] = []
@@ -118,7 +164,7 @@ export class AccountCodegen {
118
164
  }
119
165
  }
120
166
 
121
- let source = `
167
+ const source = `
122
168
  /* Autogenerated file. Do not edit manually. */
123
169
  /* tslint:disable */
124
170
  /* eslint-disable */
@@ -129,7 +175,7 @@ export class AccountCodegen {
129
175
 
130
176
  ${moduleImports.join('\n')}
131
177
 
132
- ${this.modules.map((m) => generateModule(m, dependedAccounts)).join('\n')}
178
+ ${this.modules.map((m) => generateModule(m, this.config.network)).join('\n')}
133
179
 
134
180
  function loadAllTypes(registry: aptos.TypeRegistry) {
135
181
  ${dependedAccounts.map((m) => `${m}.loadTypes(registry)`).join('\n')}
@@ -142,12 +188,24 @@ export class AccountCodegen {
142
188
  }
143
189
  ` // source
144
190
 
145
- source = prettier.format(source, { parser: 'typescript' })
146
- fs.writeFileSync(path.join(this.config.outputDir, baseName + '.ts'), source)
191
+ return [
192
+ {
193
+ fileName: this.config.fileName + '.ts',
194
+ fileContent: source,
195
+ },
196
+ ]
197
+ }
198
+ }
199
+
200
+ function generateNetworkOption(network: AptosNetwork) {
201
+ switch (network) {
202
+ case AptosNetwork.TEST_NET:
203
+ return 'TEST_NET'
147
204
  }
205
+ return 'MAIN_NET'
148
206
  }
149
207
 
150
- function generateModule(moduleByteCode: MoveModuleBytecode, dependedModules: string[]) {
208
+ function generateModule(moduleByteCode: MoveModuleBytecode, network: AptosNetwork) {
151
209
  if (!moduleByteCode.abi) {
152
210
  return ''
153
211
  }
@@ -167,7 +225,7 @@ function generateModule(moduleByteCode: MoveModuleBytecode, dependedModules: str
167
225
  }
168
226
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
169
227
  address: "${module.address}",
170
- network: aptos.AptosNetwork.TEST_NET
228
+ network: aptos.AptosNetwork.${generateNetworkOption(network)}
171
229
  }
172
230
 
173
231
  static bind(options: Partial<aptos.AptosBindOptions> = {}): ${module.name} {
@@ -1,4 +1,4 @@
1
- import { MoveModule } from 'aptos/src/generated'
1
+ import { MoveModule } from 'aptos-sdk/src/generated'
2
2
  import { TypeDescriptor } from '../aptos/types'
3
3
  import { moduleQname, moduleQnameForType, SPLITTER, VECTOR_STR } from '../aptos/utils'
4
4
 
@@ -5,7 +5,7 @@
5
5
  /* Generated modules for account 0x1 */
6
6
 
7
7
  import { aptos } from "@sentio/sdk";
8
- import { Address, MoveModule } from "aptos/src/generated";
8
+ import { Address, MoveModule } from "aptos-sdk/src/generated";
9
9
 
10
10
  export namespace acl {
11
11
  export class ACL {
@@ -49,7 +49,7 @@ export class code extends aptos.AptosBaseProcessor {
49
49
  }
50
50
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
51
51
  address: "0x1",
52
- network: aptos.AptosNetwork.TEST_NET,
52
+ network: aptos.AptosNetwork.MAIN_NET,
53
53
  };
54
54
 
55
55
  static bind(options: Partial<aptos.AptosBindOptions> = {}): code {
@@ -132,7 +132,7 @@ export class coin extends aptos.AptosBaseProcessor {
132
132
  }
133
133
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
134
134
  address: "0x1",
135
- network: aptos.AptosNetwork.TEST_NET,
135
+ network: aptos.AptosNetwork.MAIN_NET,
136
136
  };
137
137
 
138
138
  static bind(options: Partial<aptos.AptosBindOptions> = {}): coin {
@@ -338,7 +338,7 @@ export class block extends aptos.AptosBaseProcessor {
338
338
  }
339
339
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
340
340
  address: "0x1",
341
- network: aptos.AptosNetwork.TEST_NET,
341
+ network: aptos.AptosNetwork.MAIN_NET,
342
342
  };
343
343
 
344
344
  static bind(options: Partial<aptos.AptosBindOptions> = {}): block {
@@ -453,7 +453,7 @@ export class stake extends aptos.AptosBaseProcessor {
453
453
  }
454
454
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
455
455
  address: "0x1",
456
- network: aptos.AptosNetwork.TEST_NET,
456
+ network: aptos.AptosNetwork.MAIN_NET,
457
457
  };
458
458
 
459
459
  static bind(options: Partial<aptos.AptosBindOptions> = {}): stake {
@@ -1133,7 +1133,7 @@ export class voting extends aptos.AptosBaseProcessor {
1133
1133
  }
1134
1134
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
1135
1135
  address: "0x1",
1136
- network: aptos.AptosNetwork.TEST_NET,
1136
+ network: aptos.AptosNetwork.MAIN_NET,
1137
1137
  };
1138
1138
 
1139
1139
  static bind(options: Partial<aptos.AptosBindOptions> = {}): voting {
@@ -1265,7 +1265,7 @@ export class account extends aptos.AptosBaseProcessor {
1265
1265
  }
1266
1266
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
1267
1267
  address: "0x1",
1268
- network: aptos.AptosNetwork.TEST_NET,
1268
+ network: aptos.AptosNetwork.MAIN_NET,
1269
1269
  };
1270
1270
 
1271
1271
  static bind(options: Partial<aptos.AptosBindOptions> = {}): account {
@@ -1522,7 +1522,7 @@ export class version extends aptos.AptosBaseProcessor {
1522
1522
  }
1523
1523
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
1524
1524
  address: "0x1",
1525
- network: aptos.AptosNetwork.TEST_NET,
1525
+ network: aptos.AptosNetwork.MAIN_NET,
1526
1526
  };
1527
1527
 
1528
1528
  static bind(options: Partial<aptos.AptosBindOptions> = {}): version {
@@ -1574,7 +1574,7 @@ export class vesting extends aptos.AptosBaseProcessor {
1574
1574
  }
1575
1575
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
1576
1576
  address: "0x1",
1577
- network: aptos.AptosNetwork.TEST_NET,
1577
+ network: aptos.AptosNetwork.MAIN_NET,
1578
1578
  };
1579
1579
 
1580
1580
  static bind(options: Partial<aptos.AptosBindOptions> = {}): vesting {
@@ -2284,7 +2284,7 @@ export class aptos_coin extends aptos.AptosBaseProcessor {
2284
2284
  }
2285
2285
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
2286
2286
  address: "0x1",
2287
- network: aptos.AptosNetwork.TEST_NET,
2287
+ network: aptos.AptosNetwork.MAIN_NET,
2288
2288
  };
2289
2289
 
2290
2290
  static bind(options: Partial<aptos.AptosBindOptions> = {}): aptos_coin {
@@ -2554,7 +2554,7 @@ export class managed_coin extends aptos.AptosBaseProcessor {
2554
2554
  }
2555
2555
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
2556
2556
  address: "0x1",
2557
- network: aptos.AptosNetwork.TEST_NET,
2557
+ network: aptos.AptosNetwork.MAIN_NET,
2558
2558
  };
2559
2559
 
2560
2560
  static bind(options: Partial<aptos.AptosBindOptions> = {}): managed_coin {
@@ -2678,7 +2678,7 @@ export class aptos_account extends aptos.AptosBaseProcessor {
2678
2678
  }
2679
2679
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
2680
2680
  address: "0x1",
2681
- network: aptos.AptosNetwork.TEST_NET,
2681
+ network: aptos.AptosNetwork.MAIN_NET,
2682
2682
  };
2683
2683
 
2684
2684
  static bind(options: Partial<aptos.AptosBindOptions> = {}): aptos_account {
@@ -2779,7 +2779,7 @@ export class staking_proxy extends aptos.AptosBaseProcessor {
2779
2779
  }
2780
2780
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
2781
2781
  address: "0x1",
2782
- network: aptos.AptosNetwork.TEST_NET,
2782
+ network: aptos.AptosNetwork.MAIN_NET,
2783
2783
  };
2784
2784
 
2785
2785
  static bind(options: Partial<aptos.AptosBindOptions> = {}): staking_proxy {
@@ -3008,7 +3008,7 @@ export class reconfiguration extends aptos.AptosBaseProcessor {
3008
3008
  }
3009
3009
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
3010
3010
  address: "0x1",
3011
- network: aptos.AptosNetwork.TEST_NET,
3011
+ network: aptos.AptosNetwork.MAIN_NET,
3012
3012
  };
3013
3013
 
3014
3014
  static bind(options: Partial<aptos.AptosBindOptions> = {}): reconfiguration {
@@ -3083,7 +3083,7 @@ export class aptos_governance extends aptos.AptosBaseProcessor {
3083
3083
  }
3084
3084
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
3085
3085
  address: "0x1",
3086
- network: aptos.AptosNetwork.TEST_NET,
3086
+ network: aptos.AptosNetwork.MAIN_NET,
3087
3087
  };
3088
3088
 
3089
3089
  static bind(options: Partial<aptos.AptosBindOptions> = {}): aptos_governance {
@@ -3288,7 +3288,7 @@ export class resource_account extends aptos.AptosBaseProcessor {
3288
3288
  }
3289
3289
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
3290
3290
  address: "0x1",
3291
- network: aptos.AptosNetwork.TEST_NET,
3291
+ network: aptos.AptosNetwork.MAIN_NET,
3292
3292
  };
3293
3293
 
3294
3294
  static bind(options: Partial<aptos.AptosBindOptions> = {}): resource_account {
@@ -3382,7 +3382,7 @@ export class staking_contract extends aptos.AptosBaseProcessor {
3382
3382
  }
3383
3383
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
3384
3384
  address: "0x1",
3385
- network: aptos.AptosNetwork.TEST_NET,
3385
+ network: aptos.AptosNetwork.MAIN_NET,
3386
3386
  };
3387
3387
 
3388
3388
  static bind(options: Partial<aptos.AptosBindOptions> = {}): staking_contract {
@@ -5,7 +5,7 @@
5
5
  /* Generated modules for account 0x3 */
6
6
 
7
7
  import { aptos } from "@sentio/sdk";
8
- import { Address, MoveModule } from "aptos/src/generated";
8
+ import { Address, MoveModule } from "aptos-sdk/src/generated";
9
9
 
10
10
  import { table, event, simple_map, type_info } from "./0x1";
11
11
 
@@ -15,7 +15,7 @@ export class token extends aptos.AptosBaseProcessor {
15
15
  }
16
16
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
17
17
  address: "0x3",
18
- network: aptos.AptosNetwork.TEST_NET,
18
+ network: aptos.AptosNetwork.MAIN_NET,
19
19
  };
20
20
 
21
21
  static bind(options: Partial<aptos.AptosBindOptions> = {}): token {
@@ -538,7 +538,7 @@ export class token_coin_swap extends aptos.AptosBaseProcessor {
538
538
  }
539
539
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
540
540
  address: "0x3",
541
- network: aptos.AptosNetwork.TEST_NET,
541
+ network: aptos.AptosNetwork.MAIN_NET,
542
542
  };
543
543
 
544
544
  static bind(options: Partial<aptos.AptosBindOptions> = {}): token_coin_swap {
@@ -662,7 +662,7 @@ export class token_transfers extends aptos.AptosBaseProcessor {
662
662
  }
663
663
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
664
664
  address: "0x3",
665
- network: aptos.AptosNetwork.TEST_NET,
665
+ network: aptos.AptosNetwork.MAIN_NET,
666
666
  };
667
667
 
668
668
  static bind(options: Partial<aptos.AptosBindOptions> = {}): token_transfers {
@@ -26,7 +26,8 @@ module.exports = {
26
26
  mode: 'production',
27
27
  externals: [
28
28
  {
29
- aptos: 'commonjs2 aptos',
29
+ aptos: 'commonjs2 @aptos',
30
+ "@aptos": 'commonjs2 @aptos',
30
31
  ethers: 'commonjs2 ethers',
31
32
  bs58: 'commonjs2 bs58',
32
33
  "bignumber.js": 'commonjs2 bignumber.js',
package/src/service.ts CHANGED
@@ -29,7 +29,6 @@ import Long from 'long'
29
29
  import { TextDecoder } from 'util'
30
30
  import { Trace } from './core'
31
31
  import { Instruction } from '@project-serum/anchor'
32
- import { account } from './builtin/aptos/0x1'
33
32
 
34
33
  const DEFAULT_MAX_BLOCK = Long.ZERO
35
34
 
@@ -5,7 +5,7 @@
5
5
  /* Generated modules for account 0x4188c8694687e844677c2aa87171019e23d61cac60de5082a278a8aa47e9d807 */
6
6
 
7
7
  import { aptos } from "@sentio/sdk";
8
- import { Address, MoveModule } from "aptos/src/generated";
8
+ import { Address, MoveModule } from "aptos-sdk/src/generated";
9
9
 
10
10
  import { acl, account, table, event } from "@sentio/sdk/src/builtin/aptos/0x1";
11
11
  import { token } from "@sentio/sdk/src/builtin/aptos/0x3";
@@ -17,7 +17,7 @@ export class CandyMachine extends aptos.AptosBaseProcessor {
17
17
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
18
18
  address:
19
19
  "0x4188c8694687e844677c2aa87171019e23d61cac60de5082a278a8aa47e9d807",
20
- network: aptos.AptosNetwork.TEST_NET,
20
+ network: aptos.AptosNetwork.MAIN_NET,
21
21
  };
22
22
 
23
23
  static bind(options: Partial<aptos.AptosBindOptions> = {}): CandyMachine {
@@ -237,7 +237,7 @@ export class SouffleChefCampaign extends aptos.AptosBaseProcessor {
237
237
  static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
238
238
  address:
239
239
  "0x4188c8694687e844677c2aa87171019e23d61cac60de5082a278a8aa47e9d807",
240
- network: aptos.AptosNetwork.TEST_NET,
240
+ network: aptos.AptosNetwork.MAIN_NET,
241
241
  };
242
242
 
243
243
  static bind(
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AptosBindOptions = exports.AptosNetwork = void 0;
4
- var AptosNetwork;
5
- (function (AptosNetwork) {
6
- AptosNetwork[AptosNetwork["MAIN_NET"] = 1] = "MAIN_NET";
7
- AptosNetwork[AptosNetwork["TEST_NET"] = 2] = "TEST_NET";
8
- // DEV_NET,
9
- })(AptosNetwork = exports.AptosNetwork || (exports.AptosNetwork = {}));
10
- class AptosBindOptions {
11
- address;
12
- network = AptosNetwork.TEST_NET;
13
- startVersion;
14
- }
15
- exports.AptosBindOptions = AptosBindOptions;
16
- //# sourceMappingURL=bind-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bind-options.js","sourceRoot":"","sources":["../../src/aptos/bind-options.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,uDAAY,CAAA;IACZ,uDAAY,CAAA;IACZ,WAAW;AACb,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,MAAa,gBAAgB;IAC3B,OAAO,CAAQ;IACf,OAAO,GAAkB,YAAY,CAAC,QAAQ,CAAA;IAC9C,YAAY,CAAgB;CAE7B;AALD,4CAKC","sourcesContent":["import Long from 'long'\n\nexport enum AptosNetwork {\n MAIN_NET = 1,\n TEST_NET = 2,\n // DEV_NET,\n}\n\nexport class AptosBindOptions {\n address: string\n network?: AptosNetwork = AptosNetwork.TEST_NET\n startVersion?: Long | number\n // endBlock?: Long | number\n}\n"]}
@@ -1,14 +0,0 @@
1
- import Long from 'long'
2
-
3
- export enum AptosNetwork {
4
- MAIN_NET = 1,
5
- TEST_NET = 2,
6
- // DEV_NET,
7
- }
8
-
9
- export class AptosBindOptions {
10
- address: string
11
- network?: AptosNetwork = AptosNetwork.TEST_NET
12
- startVersion?: Long | number
13
- // endBlock?: Long | number
14
- }