@sentio/sdk 1.27.1 → 1.27.3

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 (42) hide show
  1. package/lib/aptos/types.js +4 -3
  2. package/lib/aptos/types.js.map +1 -1
  3. package/lib/aptos/types.test.d.ts +1 -0
  4. package/lib/aptos/types.test.js +19 -0
  5. package/lib/aptos/types.test.js.map +1 -0
  6. package/lib/aptos/utils.d.ts +4 -1
  7. package/lib/aptos/utils.js +16 -1
  8. package/lib/aptos/utils.js.map +1 -1
  9. package/lib/aptos-codegen/codegen.js +15 -21
  10. package/lib/aptos-codegen/codegen.js.map +1 -1
  11. package/lib/builtin/aptos/0x1.d.ts +8 -8
  12. package/lib/builtin/aptos/0x1.js.map +1 -1
  13. package/lib/builtin/aptos/0x3.d.ts +1 -1
  14. package/lib/builtin/aptos/0x3.js.map +1 -1
  15. package/lib/cli/upload.js +17 -2
  16. package/lib/cli/upload.js.map +1 -1
  17. package/lib/gen/chainquery/protos/chainquery.d.ts +223 -0
  18. package/lib/gen/chainquery/protos/chainquery.js +628 -0
  19. package/lib/gen/chainquery/protos/chainquery.js.map +1 -0
  20. package/lib/tests/aptos.test.js +76 -1
  21. package/lib/tests/aptos.test.js.map +1 -1
  22. package/lib/tests/souffl3.js +3 -0
  23. package/lib/tests/souffl3.js.map +1 -1
  24. package/lib/tests/types/aptos/soffl3.d.ts +786 -0
  25. package/lib/tests/types/aptos/soffl3.js +559 -0
  26. package/lib/tests/types/aptos/soffl3.js.map +1 -0
  27. package/lib/tests/types/aptos/souffle.d.ts +16 -16
  28. package/lib/tests/types/aptos/souffle.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/aptos/types.test.ts +18 -0
  31. package/src/aptos/types.ts +5 -4
  32. package/src/aptos/utils.ts +18 -1
  33. package/src/aptos-codegen/codegen.ts +16 -23
  34. package/src/builtin/aptos/0x1.ts +9 -8
  35. package/src/builtin/aptos/0x3.ts +1 -1
  36. package/src/cli/upload.ts +17 -2
  37. package/src/gen/chainquery/protos/chainquery.ts +840 -0
  38. package/src/tests/abis/aptos/soffl3.json +1411 -0
  39. package/src/tests/aptos.test.ts +79 -1
  40. package/src/tests/souffl3.ts +5 -1
  41. package/src/tests/types/aptos/soffl3.ts +1377 -0
  42. package/src/tests/types/aptos/souffle.ts +16 -16
@@ -15,7 +15,7 @@ describe('Test Aptos Example', () => {
15
15
 
16
16
  test('check configuration ', async () => {
17
17
  const config = await service.getConfig({})
18
- expect(config.contractConfigs).length(4)
18
+ expect(config.contractConfigs).length(5)
19
19
  })
20
20
 
21
21
  test('Check souffl3 transaction dispatch', async () => {
@@ -143,6 +143,22 @@ describe('Test Aptos Example', () => {
143
143
  const res = await service.processBindings(request)
144
144
  expect(firstCounterValue(res.result, 'onTimer')).equal(1n)
145
145
  })
146
+
147
+ test('Check aptos account transaction dispatch', async () => {
148
+ const request: ProcessBindingsRequest = {
149
+ bindings: [
150
+ {
151
+ data: {
152
+ raw: new TextEncoder().encode(JSON.stringify(dataCreate)),
153
+ },
154
+ handlerId: 3,
155
+ handlerType: HandlerType.APT_CALL,
156
+ },
157
+ ],
158
+ }
159
+ const res = await service.processBindings(request)
160
+ expect(res.result?.counters).length(1)
161
+ })
146
162
  })
147
163
 
148
164
  const testData = {
@@ -322,3 +338,65 @@ const createProposalData = {
322
338
  proposal_id: '3',
323
339
  },
324
340
  }
341
+
342
+ const dataCreate = {
343
+ id: '',
344
+ round: '',
345
+ previous_block_votes: null,
346
+ proposer: '',
347
+ sender: '0x88252db4dc2484cd9cedb23cd67b7b91f88940142f3eea35df7a9168d9c30896',
348
+ sequence_number: '1510',
349
+ payload: {
350
+ type: 'entry_function_payload',
351
+ type_arguments: [],
352
+ arguments: ['0xd582e092190feda35a2f737123f86e33a1b592596804f40b1d539ab603a82a24'],
353
+ code: { bytecode: '' },
354
+ function: '0x1::aptos_account::create_account',
355
+ },
356
+ max_gas_amount: '2000',
357
+ gas_unit_price: '100',
358
+ expiration_timestamp_secs: '1666174748',
359
+ secondary_signers: null,
360
+ signature: {
361
+ type: 'ed25519_signature',
362
+ public_key: '0xfe1e11c6cb912ae998c9512d21e5781abb64fd4b8d6cfa15aeba3ee481406b64',
363
+ signature:
364
+ '0x98a49f348a3015702e3be33c1d2a92ea7b2726d31b27c857980493fe68cadc83fbef0839e312d6a82a9e6ca69481245fa49b6f25c0ec51660615d03e05738c03',
365
+ public_keys: null,
366
+ signatures: null,
367
+ threshold: 0,
368
+ bitmap: '',
369
+ sender: { type: '', public_key: '', signature: '', public_keys: null, signatures: null, threshold: 0, bitmap: '' },
370
+ secondary_signer_addresses: null,
371
+ secondary_signers: null,
372
+ },
373
+ type: 'user_transaction',
374
+ timestamp: '1666174688494614',
375
+ events: [
376
+ {
377
+ version: '3121410',
378
+ guid: {
379
+ creation_number: '0',
380
+ account_address: '0xd582e092190feda35a2f737123f86e33a1b592596804f40b1d539ab603a82a24',
381
+ },
382
+ sequence_number: '0',
383
+ type: '0x1::account::CoinRegisterEvent',
384
+ data: {
385
+ type_info: {
386
+ account_address: '0x1',
387
+ module_name: '0x6170746f735f636f696e',
388
+ struct_name: '0x4170746f73436f696e',
389
+ },
390
+ },
391
+ },
392
+ ],
393
+ version: '3121410',
394
+ hash: '0xcae7d97c9f43d90e247a366688905bc8e83ee0ad4baddbf3cc2fdda56e4d6926',
395
+ state_root_hash: '',
396
+ event_root_hash: '0xfa557e3bb8dff8fd3321f9a4eaa779311c9c795728355686b487b5b0adf7ce3c',
397
+ gas_used: '1538',
398
+ success: true,
399
+ vm_status: 'Executed successfully',
400
+ accumulator_root_hash: '0x7563d6ed58b011e512d53cce2bc1a70716fc6362e12fb6af8fe6d459ae71dffc',
401
+ changes: null,
402
+ }
@@ -1,6 +1,6 @@
1
1
  import { SouffleChefCampaign, CandyMachine } from './types/aptos/souffle'
2
2
  import { token } from '../builtin/aptos/0x3'
3
- import { voting } from '../builtin/aptos/0x1'
3
+ import { aptos_account, voting } from '../builtin/aptos/0x1'
4
4
  import { TYPE_REGISTRY } from '../aptos/types'
5
5
  import { AccountEventTracker } from '@sentio/sdk'
6
6
  import { AptosAccountProcessor } from '../aptos/aptos-processor'
@@ -50,3 +50,7 @@ voting.bind().onEventCreateProposalEvent((evt, ctx) => {
50
50
  AptosAccountProcessor.bind({ address: '0x1' }).onTimeInterval((resources, ctx) => {
51
51
  ctx.meter.Counter('onTimer').add(1)
52
52
  }, 10000)
53
+
54
+ aptos_account.bind().onEntryCreateAccount((call, ctx) => {
55
+ ctx.meter.Counter('xx').add(1)
56
+ })