@aastar/sdk 0.20.5 → 0.20.6

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 (89) hide show
  1. package/dist/BaseClient-BjbYP0cf.d.ts +88 -0
  2. package/dist/UserClient-AIIHB54I.js +6 -0
  3. package/dist/{UserClient-UYIHF6UJ.js.map → UserClient-AIIHB54I.js.map} +1 -1
  4. package/dist/account.d.ts +48 -1
  5. package/dist/account.js +3 -3
  6. package/dist/admin.d.ts +62 -1
  7. package/dist/admin.js +3 -3
  8. package/dist/airaccount.d.ts +4 -2
  9. package/dist/airaccount.js +2 -2
  10. package/dist/channel-CkRRbzT8.d.ts +77 -0
  11. package/dist/channel.d.ts +64 -1
  12. package/dist/channel.js +3 -3
  13. package/dist/{chunk-FBDMID2J.js → chunk-4EZD7LPE.js} +30 -24
  14. package/dist/chunk-4EZD7LPE.js.map +1 -0
  15. package/dist/{chunk-TIH7D4FQ.js → chunk-6QYXGMCR.js} +513 -322
  16. package/dist/chunk-6QYXGMCR.js.map +1 -0
  17. package/dist/{chunk-6UHVUGDT.js → chunk-7ARJ3OSU.js} +29 -21
  18. package/dist/chunk-7ARJ3OSU.js.map +1 -0
  19. package/dist/{chunk-VYU6P7HB.js → chunk-BN5WY5GM.js} +16 -14
  20. package/dist/chunk-BN5WY5GM.js.map +1 -0
  21. package/dist/{chunk-ZFIKBDBT.js → chunk-FJ7XECC5.js} +4 -4
  22. package/dist/chunk-FJ7XECC5.js.map +1 -0
  23. package/dist/{chunk-4KRQXOTI.js → chunk-FUU7RIIA.js} +113 -102
  24. package/dist/chunk-FUU7RIIA.js.map +1 -0
  25. package/dist/{chunk-NRH56SAJ.js → chunk-G3UJC4EL.js} +6 -7
  26. package/dist/chunk-G3UJC4EL.js.map +1 -0
  27. package/dist/{chunk-QJT4IOIS.js → chunk-KDH3UPKD.js} +10 -13
  28. package/dist/chunk-KDH3UPKD.js.map +1 -0
  29. package/dist/{chunk-WPSWFZKF.js → chunk-KISL64KW.js} +69 -323
  30. package/dist/chunk-KISL64KW.js.map +1 -0
  31. package/dist/{chunk-ZGOEADCO.js → chunk-LXWIPTPX.js} +5 -5
  32. package/dist/chunk-LXWIPTPX.js.map +1 -0
  33. package/dist/{chunk-I3VRFZA4.js → chunk-MVEWJIPY.js} +124 -110
  34. package/dist/chunk-MVEWJIPY.js.map +1 -0
  35. package/dist/{chunk-FIS3RUGL.js → chunk-PAABYXS6.js} +33 -40
  36. package/dist/chunk-PAABYXS6.js.map +1 -0
  37. package/dist/{chunk-HNTLDUL7.js → chunk-PKCHRXFR.js} +8 -12
  38. package/dist/chunk-PKCHRXFR.js.map +1 -0
  39. package/dist/{chunk-42KVVOOU.js → chunk-TENYCMJ3.js} +31 -31
  40. package/dist/chunk-TENYCMJ3.js.map +1 -0
  41. package/dist/{contract-addresses-ADEWLDHE.js → contract-addresses-N3TOL2WL.js} +3 -3
  42. package/dist/{contract-addresses-ADEWLDHE.js.map → contract-addresses-N3TOL2WL.js.map} +1 -1
  43. package/dist/core.d.ts +6930 -13
  44. package/dist/core.js +2 -2
  45. package/dist/dapp.d.ts +127 -1
  46. package/dist/dapp.js +12 -13
  47. package/dist/dapp.js.map +1 -1
  48. package/dist/doc-types-471vSmPO.d.ts +16 -0
  49. package/dist/enduser.d.ts +261 -1
  50. package/dist/enduser.js +4 -4
  51. package/dist/identity.d.ts +81 -1
  52. package/dist/identity.js +3 -3
  53. package/dist/index-B6SfEQxo.d.ts +47 -0
  54. package/dist/index.d.ts +55 -15
  55. package/dist/index.js +18 -18
  56. package/dist/index.js.map +1 -1
  57. package/dist/kms.d.ts +2986 -2
  58. package/dist/kms.js +2 -2
  59. package/dist/operator.d.ts +164 -1
  60. package/dist/operator.js +3 -3
  61. package/dist/paymaster.d.ts +312 -1
  62. package/dist/paymaster.js +3 -3
  63. package/dist/{index.node-KIKM4EG6.js → src-L5SI5WNB.js} +4 -4
  64. package/dist/src-L5SI5WNB.js.map +1 -0
  65. package/dist/{dist-GVWCRI4F.js → src-X5MIV3EB.js} +5 -5
  66. package/dist/src-X5MIV3EB.js.map +1 -0
  67. package/dist/tier-router-DLiMxs0h.d.ts +321 -0
  68. package/dist/tokens.d.ts +64 -1
  69. package/dist/tokens.js +3 -3
  70. package/dist/x402.d.ts +373 -1
  71. package/dist/x402.js +3 -3
  72. package/package.json +1 -1
  73. package/dist/UserClient-UYIHF6UJ.js +0 -6
  74. package/dist/chunk-42KVVOOU.js.map +0 -1
  75. package/dist/chunk-4KRQXOTI.js.map +0 -1
  76. package/dist/chunk-6UHVUGDT.js.map +0 -1
  77. package/dist/chunk-FBDMID2J.js.map +0 -1
  78. package/dist/chunk-FIS3RUGL.js.map +0 -1
  79. package/dist/chunk-HNTLDUL7.js.map +0 -1
  80. package/dist/chunk-I3VRFZA4.js.map +0 -1
  81. package/dist/chunk-NRH56SAJ.js.map +0 -1
  82. package/dist/chunk-QJT4IOIS.js.map +0 -1
  83. package/dist/chunk-TIH7D4FQ.js.map +0 -1
  84. package/dist/chunk-VYU6P7HB.js.map +0 -1
  85. package/dist/chunk-WPSWFZKF.js.map +0 -1
  86. package/dist/chunk-ZFIKBDBT.js.map +0 -1
  87. package/dist/chunk-ZGOEADCO.js.map +0 -1
  88. package/dist/dist-GVWCRI4F.js.map +0 -1
  89. package/dist/index.node-KIKM4EG6.js.map +0 -1
@@ -4,23 +4,88 @@ import { startRegistration, startAuthentication } from '@simplewebauthn/browser'
4
4
  import { ethers } from 'ethers';
5
5
  import * as crypto from 'crypto';
6
6
 
7
- // ../airaccount/dist/index.js
8
- var dist_exports = {};
9
- __export(dist_exports, {
10
- ALG_BLS: () => ALG_BLS,
11
- ALG_CUMULATIVE_T2: () => ALG_CUMULATIVE_T2,
12
- ALG_CUMULATIVE_T3: () => ALG_CUMULATIVE_T3,
13
- ALG_ECDSA: () => ALG_ECDSA,
14
- ALG_P256: () => ALG_P256,
15
- BLSManager: () => BLSManager,
16
- CryptoUtil: () => CryptoUtil,
17
- ERC4337Utils: () => ERC4337Utils,
18
- PasskeyManager: () => PasskeyManager,
19
- UserOpBuilder: () => UserOpBuilder,
20
- YAAAClient: () => YAAAClient,
21
- algIdForTier: () => algIdForTier,
22
- resolveTier: () => resolveTier
23
- });
7
+ var PasskeyManager = class {
8
+ api;
9
+ constructor(baseURL, tokenProvider) {
10
+ this.api = axios2.create({
11
+ baseURL,
12
+ headers: {
13
+ "Content-Type": "application/json"
14
+ }
15
+ });
16
+ if (tokenProvider) {
17
+ this.api.interceptors.request.use((config) => {
18
+ const token = tokenProvider();
19
+ if (token) {
20
+ config.headers.Authorization = `Bearer ${token}`;
21
+ }
22
+ return config;
23
+ });
24
+ }
25
+ }
26
+ /**
27
+ * Complete Passkey Registration Flow
28
+ */
29
+ async register(params) {
30
+ const beginResponse = await this.api.post(
31
+ "/auth/passkey/register/begin",
32
+ params
33
+ );
34
+ const credential = await startRegistration(beginResponse.data);
35
+ const completeResponse = await this.api.post("/auth/passkey/register/complete", {
36
+ email: params.email,
37
+ username: params.username,
38
+ password: params.password,
39
+ credential
40
+ });
41
+ return completeResponse.data;
42
+ }
43
+ /**
44
+ * Complete Passkey Login/Authentication Flow
45
+ */
46
+ async authenticate(params) {
47
+ const beginResponse = await this.api.post(
48
+ "/auth/passkey/login/begin",
49
+ params
50
+ );
51
+ const credential = await startAuthentication(beginResponse.data);
52
+ const completeResponse = await this.api.post("/auth/passkey/login/complete", { credential });
53
+ return completeResponse.data;
54
+ }
55
+ /**
56
+ * Verify a transaction (Sign UserOpHash) with Passkey
57
+ * Returns the verification credential needed for the transaction
58
+ */
59
+ async verifyTransaction(params) {
60
+ const beginResponse = await this.api.post(
61
+ "/auth/transaction/verify/begin",
62
+ { transaction: params }
63
+ );
64
+ const { userOpHash, ...authOptions } = beginResponse.data;
65
+ const credential = await startAuthentication(authOptions);
66
+ return {
67
+ credential,
68
+ userOpHash
69
+ // Return pre-calculated hash to ensure consistency
70
+ };
71
+ }
72
+ /**
73
+ * Add a new device (Passkey) to existing account
74
+ */
75
+ async addDevice(params) {
76
+ const beginResponse = await this.api.post(
77
+ "/auth/device/passkey/begin",
78
+ params
79
+ );
80
+ const credential = await startRegistration(beginResponse.data);
81
+ const completeResponse = await this.api.post("/auth/device/passkey/complete", {
82
+ email: params.email,
83
+ password: params.password,
84
+ credential
85
+ });
86
+ return completeResponse.data.passkey;
87
+ }
88
+ };
24
89
 
25
90
  // ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/utils.js
26
91
  function isBytes(a) {
@@ -3954,88 +4019,8 @@ function mapToG2(scalars) {
3954
4019
  const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars));
3955
4020
  return isogenyMapG2(x, y);
3956
4021
  }
3957
- var PasskeyManager = class {
3958
- api;
3959
- constructor(baseURL, tokenProvider) {
3960
- this.api = axios2.create({
3961
- baseURL,
3962
- headers: {
3963
- "Content-Type": "application/json"
3964
- }
3965
- });
3966
- if (tokenProvider) {
3967
- this.api.interceptors.request.use((config) => {
3968
- const token = tokenProvider();
3969
- if (token) {
3970
- config.headers.Authorization = `Bearer ${token}`;
3971
- }
3972
- return config;
3973
- });
3974
- }
3975
- }
3976
- /**
3977
- * Complete Passkey Registration Flow
3978
- */
3979
- async register(params) {
3980
- const beginResponse = await this.api.post(
3981
- "/auth/passkey/register/begin",
3982
- params
3983
- );
3984
- const credential = await startRegistration(beginResponse.data);
3985
- const completeResponse = await this.api.post("/auth/passkey/register/complete", {
3986
- email: params.email,
3987
- username: params.username,
3988
- password: params.password,
3989
- credential
3990
- });
3991
- return completeResponse.data;
3992
- }
3993
- /**
3994
- * Complete Passkey Login/Authentication Flow
3995
- */
3996
- async authenticate(params) {
3997
- const beginResponse = await this.api.post(
3998
- "/auth/passkey/login/begin",
3999
- params
4000
- );
4001
- const credential = await startAuthentication(beginResponse.data);
4002
- const completeResponse = await this.api.post("/auth/passkey/login/complete", { credential });
4003
- return completeResponse.data;
4004
- }
4005
- /**
4006
- * Verify a transaction (Sign UserOpHash) with Passkey
4007
- * Returns the verification credential needed for the transaction
4008
- */
4009
- async verifyTransaction(params) {
4010
- const beginResponse = await this.api.post(
4011
- "/auth/transaction/verify/begin",
4012
- { transaction: params }
4013
- );
4014
- const { userOpHash, ...authOptions } = beginResponse.data;
4015
- const credential = await startAuthentication(authOptions);
4016
- return {
4017
- credential,
4018
- userOpHash
4019
- // Return pre-calculated hash to ensure consistency
4020
- };
4021
- }
4022
- /**
4023
- * Add a new device (Passkey) to existing account
4024
- */
4025
- async addDevice(params) {
4026
- const beginResponse = await this.api.post(
4027
- "/auth/device/passkey/begin",
4028
- params
4029
- );
4030
- const credential = await startRegistration(beginResponse.data);
4031
- const completeResponse = await this.api.post("/auth/device/passkey/complete", {
4032
- email: params.email,
4033
- password: params.password,
4034
- credential
4035
- });
4036
- return completeResponse.data.passkey;
4037
- }
4038
- };
4022
+
4023
+ // ../airaccount/src/core/bls/bls.manager.ts
4039
4024
  var BLSManager = class {
4040
4025
  config;
4041
4026
  constructor(config) {
@@ -4211,6 +4196,8 @@ var BLSManager = class {
4211
4196
  return sig.startsWith("0x") ? sig : `0x${sig}`;
4212
4197
  }
4213
4198
  };
4199
+
4200
+ // ../airaccount/src/client.ts
4214
4201
  var YAAAClient = class {
4215
4202
  constructor(config) {
4216
4203
  this.config = config;
@@ -4261,6 +4248,8 @@ var CryptoUtil = class _CryptoUtil {
4261
4248
  return crypto.randomBytes(32).toString("hex");
4262
4249
  }
4263
4250
  };
4251
+
4252
+ // ../airaccount/src/core/erc4337/utils.ts
4264
4253
  var ERC4337Utils = class _ERC4337Utils {
4265
4254
  static packAccountGasLimits(verificationGasLimit, callGasLimit) {
4266
4255
  const vgl = BigInt(verificationGasLimit);
@@ -4380,11 +4369,15 @@ var UserOpBuilder = class _UserOpBuilder {
4380
4369
  }
4381
4370
  // Legacy v0.6 hashing support could be added here if needed
4382
4371
  };
4372
+
4373
+ // ../airaccount/src/core/tier/types.ts
4383
4374
  var ALG_BLS = 1;
4384
4375
  var ALG_ECDSA = 2;
4385
4376
  var ALG_P256 = 3;
4386
4377
  var ALG_CUMULATIVE_T2 = 4;
4387
4378
  var ALG_CUMULATIVE_T3 = 5;
4379
+
4380
+ // ../airaccount/src/core/tier/tier-router.ts
4388
4381
  function resolveTier(value, config) {
4389
4382
  if (config.tier1Limit === 0n && config.tier2Limit === 0n) return 1;
4390
4383
  if (config.tier1Limit > 0n && value <= config.tier1Limit) return 1;
@@ -4401,6 +4394,24 @@ function algIdForTier(tier) {
4401
4394
  return ALG_CUMULATIVE_T3;
4402
4395
  }
4403
4396
  }
4397
+
4398
+ // ../airaccount/src/index.ts
4399
+ var src_exports = {};
4400
+ __export(src_exports, {
4401
+ ALG_BLS: () => ALG_BLS,
4402
+ ALG_CUMULATIVE_T2: () => ALG_CUMULATIVE_T2,
4403
+ ALG_CUMULATIVE_T3: () => ALG_CUMULATIVE_T3,
4404
+ ALG_ECDSA: () => ALG_ECDSA,
4405
+ ALG_P256: () => ALG_P256,
4406
+ BLSManager: () => BLSManager,
4407
+ CryptoUtil: () => CryptoUtil,
4408
+ ERC4337Utils: () => ERC4337Utils,
4409
+ PasskeyManager: () => PasskeyManager,
4410
+ UserOpBuilder: () => UserOpBuilder,
4411
+ YAAAClient: () => YAAAClient,
4412
+ algIdForTier: () => algIdForTier,
4413
+ resolveTier: () => resolveTier
4414
+ });
4404
4415
  /*! Bundled license information:
4405
4416
 
4406
4417
  @noble/hashes/utils.js:
@@ -4416,6 +4427,6 @@ function algIdForTier(tier) {
4416
4427
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
4417
4428
  */
4418
4429
 
4419
- export { BLSManager, CryptoUtil, ERC4337Utils, PasskeyManager, UserOpBuilder, YAAAClient, bls12_381, dist_exports, ecdsa, sha256, weierstrass };
4420
- //# sourceMappingURL=chunk-4KRQXOTI.js.map
4421
- //# sourceMappingURL=chunk-4KRQXOTI.js.map
4430
+ export { ALG_BLS, ALG_CUMULATIVE_T2, ALG_CUMULATIVE_T3, ALG_ECDSA, ALG_P256, BLSManager, CryptoUtil, ERC4337Utils, PasskeyManager, UserOpBuilder, YAAAClient, algIdForTier, ecdsa, resolveTier, sha256, src_exports, weierstrass };
4431
+ //# sourceMappingURL=chunk-FUU7RIIA.js.map
4432
+ //# sourceMappingURL=chunk-FUU7RIIA.js.map