@aastar/sdk 0.20.8 → 0.21.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 (144) hide show
  1. package/dist/BaseClient-CkBhQ1ou.d.cts +88 -0
  2. package/dist/UserClient-BDGP37PK.js +6 -0
  3. package/dist/{UserClient-AIIHB54I.js.map → UserClient-BDGP37PK.js.map} +1 -1
  4. package/dist/UserClient-FOAOBLGK.cjs +15 -0
  5. package/dist/UserClient-FOAOBLGK.cjs.map +1 -0
  6. package/dist/account.cjs +31 -0
  7. package/dist/account.cjs.map +1 -0
  8. package/dist/account.d.cts +48 -0
  9. package/dist/account.js +3 -3
  10. package/dist/admin.cjs +15 -0
  11. package/dist/admin.cjs.map +1 -0
  12. package/dist/admin.d.cts +62 -0
  13. package/dist/admin.js +3 -3
  14. package/dist/airaccount.cjs +452 -0
  15. package/dist/airaccount.cjs.map +1 -0
  16. package/dist/airaccount.d.cts +4 -0
  17. package/dist/airaccount.js +3 -3
  18. package/dist/channel-CkRRbzT8.d.cts +77 -0
  19. package/dist/channel.cjs +27 -0
  20. package/dist/channel.cjs.map +1 -0
  21. package/dist/channel.d.cts +64 -0
  22. package/dist/channel.js +3 -3
  23. package/dist/chunk-3HZEIFBW.cjs +118 -0
  24. package/dist/chunk-3HZEIFBW.cjs.map +1 -0
  25. package/dist/{chunk-7ARJ3OSU.js → chunk-57XLR2NT.js} +3 -3
  26. package/dist/{chunk-7ARJ3OSU.js.map → chunk-57XLR2NT.js.map} +1 -1
  27. package/dist/chunk-5JFYTJOE.cjs +448 -0
  28. package/dist/chunk-5JFYTJOE.cjs.map +1 -0
  29. package/dist/{chunk-KDH3UPKD.js → chunk-5NKU5NT5.js} +8 -8
  30. package/dist/{chunk-KDH3UPKD.js.map → chunk-5NKU5NT5.js.map} +1 -1
  31. package/dist/chunk-63JM67L7.cjs +435 -0
  32. package/dist/chunk-63JM67L7.cjs.map +1 -0
  33. package/dist/{chunk-IC3G6YM2.js → chunk-6OWZOTE7.js} +113 -9
  34. package/dist/chunk-6OWZOTE7.js.map +1 -0
  35. package/dist/chunk-CIEYY3A6.cjs +43259 -0
  36. package/dist/chunk-CIEYY3A6.cjs.map +1 -0
  37. package/dist/chunk-DEUBKZH5.cjs +421 -0
  38. package/dist/chunk-DEUBKZH5.cjs.map +1 -0
  39. package/dist/{chunk-TENYCMJ3.js → chunk-DF4WVR2H.js} +9 -9
  40. package/dist/{chunk-TENYCMJ3.js.map → chunk-DF4WVR2H.js.map} +1 -1
  41. package/dist/{chunk-BN5WY5GM.js → chunk-DQBKE4ND.js} +4 -4
  42. package/dist/{chunk-BN5WY5GM.js.map → chunk-DQBKE4ND.js.map} +1 -1
  43. package/dist/{chunk-4EZD7LPE.js → chunk-E4CQFW75.js} +3 -3
  44. package/dist/{chunk-4EZD7LPE.js.map → chunk-E4CQFW75.js.map} +1 -1
  45. package/dist/{chunk-LXWIPTPX.js → chunk-ENSMYCU6.js} +3 -3
  46. package/dist/{chunk-LXWIPTPX.js.map → chunk-ENSMYCU6.js.map} +1 -1
  47. package/dist/{chunk-FJ7XECC5.js → chunk-EY2AJTGV.js} +3 -3
  48. package/dist/{chunk-FJ7XECC5.js.map → chunk-EY2AJTGV.js.map} +1 -1
  49. package/dist/chunk-GAMSWXWI.cjs +1168 -0
  50. package/dist/chunk-GAMSWXWI.cjs.map +1 -0
  51. package/dist/chunk-IJN776TA.cjs +585 -0
  52. package/dist/chunk-IJN776TA.cjs.map +1 -0
  53. package/dist/{chunk-PKCHRXFR.js → chunk-KZERVPUR.js} +3 -3
  54. package/dist/{chunk-PKCHRXFR.js.map → chunk-KZERVPUR.js.map} +1 -1
  55. package/dist/{chunk-6QYXGMCR.js → chunk-M5WFKETT.js} +833 -47
  56. package/dist/chunk-M5WFKETT.js.map +1 -0
  57. package/dist/chunk-M7HXR7G5.cjs +128 -0
  58. package/dist/chunk-M7HXR7G5.cjs.map +1 -0
  59. package/dist/{chunk-PAABYXS6.js → chunk-MCALA6WM.js} +6 -6
  60. package/dist/{chunk-PAABYXS6.js.map → chunk-MCALA6WM.js.map} +1 -1
  61. package/dist/chunk-MXJEULSE.cjs +396 -0
  62. package/dist/chunk-MXJEULSE.cjs.map +1 -0
  63. package/dist/chunk-OVNOSAL3.cjs +4797 -0
  64. package/dist/chunk-OVNOSAL3.cjs.map +1 -0
  65. package/dist/chunk-Q7SFCCGT.cjs +11 -0
  66. package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
  67. package/dist/{chunk-MVEWJIPY.js → chunk-RXPSL33E.js} +3 -3
  68. package/dist/{chunk-MVEWJIPY.js.map → chunk-RXPSL33E.js.map} +1 -1
  69. package/dist/{chunk-G3UJC4EL.js → chunk-UCLK6LTB.js} +39 -36
  70. package/dist/chunk-UCLK6LTB.js.map +1 -0
  71. package/dist/chunk-WR4OZUXR.cjs +115 -0
  72. package/dist/chunk-WR4OZUXR.cjs.map +1 -0
  73. package/dist/chunk-XQROKLZI.cjs +4521 -0
  74. package/dist/chunk-XQROKLZI.cjs.map +1 -0
  75. package/dist/chunk-Y4EJX7UA.cjs +228 -0
  76. package/dist/chunk-Y4EJX7UA.cjs.map +1 -0
  77. package/dist/chunk-Z4GZ6DQA.cjs +108 -0
  78. package/dist/chunk-Z4GZ6DQA.cjs.map +1 -0
  79. package/dist/contract-addresses-RABD77VP.cjs +49 -0
  80. package/dist/contract-addresses-RABD77VP.cjs.map +1 -0
  81. package/dist/{contract-addresses-N3TOL2WL.js → contract-addresses-TVXSRQ7I.js} +3 -3
  82. package/dist/{contract-addresses-N3TOL2WL.js.map → contract-addresses-TVXSRQ7I.js.map} +1 -1
  83. package/dist/core.cjs +898 -0
  84. package/dist/core.cjs.map +1 -0
  85. package/dist/core.d.cts +7048 -0
  86. package/dist/core.d.ts +130 -12
  87. package/dist/core.js +2 -2
  88. package/dist/dapp.cjs +289 -0
  89. package/dist/dapp.cjs.map +1 -0
  90. package/dist/dapp.d.cts +127 -0
  91. package/dist/dapp.js +3 -3
  92. package/dist/doc-types-471vSmPO.d.cts +16 -0
  93. package/dist/enduser.cjs +24 -0
  94. package/dist/enduser.cjs.map +1 -0
  95. package/dist/enduser.d.cts +261 -0
  96. package/dist/enduser.js +4 -4
  97. package/dist/identity.cjs +23 -0
  98. package/dist/identity.cjs.map +1 -0
  99. package/dist/identity.d.cts +81 -0
  100. package/dist/identity.js +3 -3
  101. package/dist/index-B6SfEQxo.d.cts +47 -0
  102. package/dist/index.cjs +2818 -0
  103. package/dist/index.cjs.map +1 -0
  104. package/dist/index.d.cts +656 -0
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +17 -17
  107. package/dist/kms.cjs +452 -0
  108. package/dist/kms.cjs.map +1 -0
  109. package/dist/kms.d.cts +3104 -0
  110. package/dist/kms.d.ts +62 -12
  111. package/dist/kms.js +3 -3
  112. package/dist/lib-FE4GR7TO.cjs +1865 -0
  113. package/dist/lib-FE4GR7TO.cjs.map +1 -0
  114. package/dist/operator.cjs +27 -0
  115. package/dist/operator.cjs.map +1 -0
  116. package/dist/operator.d.cts +164 -0
  117. package/dist/operator.js +3 -3
  118. package/dist/paymaster.cjs +63 -0
  119. package/dist/paymaster.cjs.map +1 -0
  120. package/dist/paymaster.d.cts +312 -0
  121. package/dist/paymaster.js +3 -3
  122. package/dist/src-CUHI6G6W.cjs +898 -0
  123. package/dist/src-CUHI6G6W.cjs.map +1 -0
  124. package/dist/src-KHCWIS4Q.cjs +63 -0
  125. package/dist/src-KHCWIS4Q.cjs.map +1 -0
  126. package/dist/{src-X5MIV3EB.js → src-RSN4U2T2.js} +5 -5
  127. package/dist/src-RSN4U2T2.js.map +1 -0
  128. package/dist/{src-L5SI5WNB.js → src-XCV6BTSV.js} +4 -4
  129. package/dist/{src-X5MIV3EB.js.map → src-XCV6BTSV.js.map} +1 -1
  130. package/dist/tier-router-DeeVg69O.d.cts +370 -0
  131. package/dist/tokens.cjs +15 -0
  132. package/dist/tokens.cjs.map +1 -0
  133. package/dist/tokens.d.cts +64 -0
  134. package/dist/tokens.js +3 -3
  135. package/dist/x402.cjs +103 -0
  136. package/dist/x402.cjs.map +1 -0
  137. package/dist/x402.d.cts +373 -0
  138. package/dist/x402.js +3 -3
  139. package/package.json +116 -32
  140. package/dist/UserClient-AIIHB54I.js +0 -6
  141. package/dist/chunk-6QYXGMCR.js.map +0 -1
  142. package/dist/chunk-G3UJC4EL.js.map +0 -1
  143. package/dist/chunk-IC3G6YM2.js.map +0 -1
  144. package/dist/src-L5SI5WNB.js.map +0 -1
package/dist/core.d.ts CHANGED
@@ -218,17 +218,17 @@ declare const CANONICAL_ADDRESSES: {
218
218
  readonly agentIdentityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e";
219
219
  readonly agentReputationRegistry: "0x8004B663056A597Dffe9eCcC1965A193B7388713";
220
220
  readonly agentValidationRegistry: "0x8004Cb1BF31DAf7788923b405b754f57acEB4272";
221
- readonly aaStarBLSAlgorithm: "0x68c381Ad3A2e3380F22840008027E9Ec2783F43A";
222
- readonly aaStarValidator: "0xC20A986Bcd5bF5Cc2fE5fFde6b155B8419E0389e";
223
- readonly aaStarBLSAggregator: "0x77f7bf95B8602b7851f392F412257539242947e0";
224
- readonly sessionKeyValidator: "0x70de2e36004d6Ddc24DEB80e1Ef76c03EdC0c2AE";
225
- readonly forceExitModule: "0xd882a16Ea37Be463D1885EF4a397Dbbf157dC211";
226
- readonly airAccountDelegate: "0xA8D7f70c9D36bC4a4eb14F0dCEE19053FCB3309f";
227
- readonly calldataParserRegistry: "0xb8Af1C039dF88F6bD9fE36Ca683492a3c09e7D17";
228
- readonly airAccountFactoryV7: "0x52c5190E7308Ea9B149157FF016cC99B6C6bf984";
229
- readonly airAccountV7Impl: "0x7fe62d512f0b8238DE6Ff17175DcE40eA312bBF2";
230
- readonly airAccountExtension: "0xD61C0F3DE6D98070E9986743d35A56d56855A249";
231
- readonly agentRegistry: "0x3895b3E6fEf4e121E6289dC7881A0eEd5283C652";
221
+ readonly aaStarBLSAlgorithm: "0xAF525A161CB17e0A1b6254ef0B8d8473bdA05174";
222
+ readonly aaStarValidator: "0xfcDfd17a373E037c3F9C8ffE2c781915E7Ae6e11";
223
+ readonly aaStarBLSAggregator: "0x35775df9a4f4dB42Ea0C46118a12dDd0cEc70609";
224
+ readonly sessionKeyValidator: "0x6810CfB7c72D16e044a17694fAa8076e517264D0";
225
+ readonly forceExitModule: "0x3fDe77868b74a7979A40a2293a1CD265fbe66EEc";
226
+ readonly airAccountDelegate: "0xd2735E54C5f5f2BF523b8a9ddd0E183624c3f2c0";
227
+ readonly calldataParserRegistry: "0x7dEea4544446826601014bD94d0F6432A67496F5";
228
+ readonly airAccountFactoryV7: "0x99C9300d52EDD9f4B7135DEd1811fBa6FFa1DDC6";
229
+ readonly airAccountV7Impl: "0xd51db7eB20FF99c8588281CBe1785681Bb17D473";
230
+ readonly airAccountExtension: "0x5529f50811814E0a4966cFC21200DCeF9C3FCb5B";
231
+ readonly agentRegistry: "0xbcE1163817EEBA2E07d39424427B10937bF1D121";
232
232
  readonly policyRegistry: "0x8c2488d46d5447418558c38AA6441720df656094";
233
233
  readonly x402Facilitator: "0x326Fc3413c8A0185b0179B971C69813B6dFD971B";
234
234
  readonly timelockController: "0xB734df3c0A1809bc06708512363D368Ac51dF1A2";
@@ -5928,6 +5928,8 @@ type TokenConfig = {
5928
5928
  };
5929
5929
  type InitConfig = {
5930
5930
  guardians: readonly [Address, Address, Address];
5931
+ guardianP256X: readonly [Hex, Hex, Hex];
5932
+ guardianP256Y: readonly [Hex, Hex, Hex];
5931
5933
  dailyLimit: bigint;
5932
5934
  approvedAlgIds: readonly number[];
5933
5935
  minDailyLimit: bigint;
@@ -6078,6 +6080,18 @@ type AirAccountFactoryActions = {
6078
6080
  maxFeePerGas?: bigint;
6079
6081
  maxPriorityFeePerGas?: bigint;
6080
6082
  }) => Promise<Hash>;
6083
+ createAccountWithDefaults: (args: {
6084
+ owner: Address;
6085
+ salt: bigint;
6086
+ guardian1: Address;
6087
+ guardian1Sig: Hex;
6088
+ guardian2: Address;
6089
+ guardian2Sig: Hex;
6090
+ dailyLimit: bigint;
6091
+ account?: Account | Address;
6092
+ maxFeePerGas?: bigint;
6093
+ maxPriorityFeePerGas?: bigint;
6094
+ }) => Promise<Hash>;
6081
6095
  getChainQualifiedAddress: (args: {
6082
6096
  account: Address;
6083
6097
  }) => Promise<Hex>;
@@ -6109,6 +6123,89 @@ type AirAccountFactoryActions = {
6109
6123
  };
6110
6124
  declare const airAccountFactoryActions: (address: Address) => (client: PublicClient$1 | WalletClient) => AirAccountFactoryActions;
6111
6125
 
6126
+ /**
6127
+ * AirAccount v0.20.0 extension surface — the P-256 / WebAuthn guardian functions
6128
+ * relocated into `AirAccountExtension` and reached through the V7 account's
6129
+ * `fallback`→`delegatecall` boundary. These actions are bound to (and called
6130
+ * against) the ACCOUNT address; the account routes them to the extension
6131
+ * internally, so the on-chain `address` here is the smart-account address, never
6132
+ * the extension's own address.
6133
+ *
6134
+ * ## Batch split
6135
+ * The full P-256 / WebAuthn guardian feature (passkey-signed recovery, mixed
6136
+ * ECDSA+P-256 guardian consensus) landed in the contracts at v0.20.0 but is wired
6137
+ * into the SDK in **Batch 2**. This Batch-1 module ships:
6138
+ * - the two trivial VIEW reads (`getRecoveryNonce`, `getGuardianP256Key`) as
6139
+ * real on-chain calls, and
6140
+ * - `NOT_IMPLEMENTED`-throwing stubs for the eight state-changing P-256 writes,
6141
+ * so the doc-coverage gate stays green while the feature is finished.
6142
+ *
6143
+ * The plain ECDSA recovery lifecycle (`proposeRecovery` / `approveRecovery` /
6144
+ * `executeRecovery` / `cancelRecovery`) is unchanged at the byte level (same
6145
+ * 4-byte selectors, same semantics) and is encoded by the AirAccount server's
6146
+ * `RecoveryService` against the account address — it is NOT re-declared here.
6147
+ */
6148
+ type AirAccountExtensionActions = {
6149
+ /** `getRecoveryNonce()` — monotonic nonce that domain-separates P-256 / mixed-sig recovery payloads. */
6150
+ getRecoveryNonce: () => Promise<bigint>;
6151
+ /** `getGuardianP256Key(index)` — the (x, y) secp256r1 pubkey of guardian slot `index` (zero pair ⇒ not a P-256 guardian). */
6152
+ getGuardianP256Key: (args: {
6153
+ index: number;
6154
+ }) => Promise<{
6155
+ x: Hex;
6156
+ y: Hex;
6157
+ }>;
6158
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6159
+ addP256Guardian: (args: {
6160
+ x: Hex;
6161
+ y: Hex;
6162
+ }) => Promise<never>;
6163
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6164
+ addP256GuardianWithMixedSigs: (args: {
6165
+ x: Hex;
6166
+ y: Hex;
6167
+ signerIdxs: readonly number[];
6168
+ sigs: readonly Hex[];
6169
+ }) => Promise<never>;
6170
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6171
+ addGuardianWithMixedSigs: (args: {
6172
+ guardian: Address;
6173
+ signerIdxs: readonly number[];
6174
+ sigs: readonly Hex[];
6175
+ }) => Promise<never>;
6176
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6177
+ proposeRecoveryWithSig: (args: {
6178
+ newOwner: Address;
6179
+ gIdx: number;
6180
+ sig: Hex;
6181
+ }) => Promise<never>;
6182
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6183
+ approveRecoveryWithSig: (args: {
6184
+ gIdx: number;
6185
+ sig: Hex;
6186
+ }) => Promise<never>;
6187
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6188
+ cancelRecoveryWithSig: (args: {
6189
+ gIdx: number;
6190
+ sig: Hex;
6191
+ }) => Promise<never>;
6192
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6193
+ removeGuardianWithMixedSigs: (args: {
6194
+ index: number;
6195
+ signerIdxs: readonly number[];
6196
+ sigs: readonly Hex[];
6197
+ }) => Promise<never>;
6198
+ /** Batch 2 (P-256 guardian feature). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
6199
+ modifyTierLimitsWithMixedGuardians: (args: {
6200
+ tier1: bigint;
6201
+ tier2: bigint;
6202
+ deadline: bigint;
6203
+ signerIdxs: readonly number[];
6204
+ sigs: readonly Hex[];
6205
+ }) => Promise<never>;
6206
+ };
6207
+ declare const airAccountExtensionActions: (address: Address) => (client: PublicClient$1 | WalletClient) => AirAccountExtensionActions;
6208
+
6112
6209
  type AgentRegistryActions = {
6113
6210
  deployer: () => Promise<Address>;
6114
6211
  factory: () => Promise<Address>;
@@ -6172,6 +6269,16 @@ type P256SessionState = {
6172
6269
  callCount: number;
6173
6270
  prevCount: number;
6174
6271
  };
6272
+ type SessionConfig = {
6273
+ expiry: number;
6274
+ contractScope: Address;
6275
+ selectorScope: Hex;
6276
+ revoked: boolean;
6277
+ velocityLimit: number;
6278
+ velocityWindow: number;
6279
+ callTargets: readonly Address[];
6280
+ selectorAllowlist: readonly Hex[];
6281
+ };
6175
6282
  type SessionKeyValidatorActions = {
6176
6283
  checkSessionScope: (args: {
6177
6284
  account: Address;
@@ -6201,6 +6308,17 @@ type SessionKeyValidatorActions = {
6201
6308
  sessionType: number;
6202
6309
  signer?: Account | Address;
6203
6310
  }) => Promise<Hash>;
6311
+ buildGrantHash: (args: {
6312
+ account: Address;
6313
+ sessionKey: Address;
6314
+ cfg: SessionConfig;
6315
+ }) => Promise<Hex>;
6316
+ buildP256GrantHash: (args: {
6317
+ account: Address;
6318
+ p256KeyX: Hex;
6319
+ p256KeyY: Hex;
6320
+ cfg: SessionConfig;
6321
+ }) => Promise<Hex>;
6204
6322
  };
6205
6323
  declare const sessionKeyValidatorActions: (address: Address) => (client: PublicClient$1 | WalletClient) => SessionKeyValidatorActions;
6206
6324
 
@@ -6927,4 +7045,4 @@ declare function resolveEnsVerified(name: string, options?: EnsOptions): Promise
6927
7045
  verified: boolean;
6928
7046
  }>;
6929
7047
 
6930
- export { AASTAR_COMMUNITY, AAStarAirAccountFactoryV7ABI, AAStarAirAccountFactoryV7Artifact, AAStarAirAccountV7ABI, AAStarAirAccountV7Artifact, AAStarBLSAggregatorABI, AAStarBLSAggregatorArtifact, AAStarBLSAlgorithmABI, AAStarBLSAlgorithmArtifact, AAStarValidatorABI, AAStarValidatorArtifact, AGENT_IDENTITY_REGISTRY_ADDRESS, AGENT_REPUTATION_REGISTRY_ADDRESS, ALL_ADDRESSES, ALL_ROLES, APNTS_ADDRESS, type AccountActions, type AccountBalance, type AccountFactoryActions, type AgentActions, AgentRegistryABI, type AgentRegistryActions, AgentRegistryArtifact, type AgentSponsorshipPolicy, type AggregatorActions, type AirAccountActions, AirAccountDelegateABI, AirAccountDelegateArtifact, AirAccountExtensionABI, AirAccountExtensionArtifact, type AirAccountFactoryActions, type AssetPolicy, type AssetPolicyInput, AuthorizationState, BLSAggregatorABI, BLSAggregatorArtifact, type BLSAlgorithmActions, type BLSG1Point, BLSHelpers, BLSSigner, BLSValidatorABI, BLSValidatorArtifact, BLS_AGGREGATOR_ADDRESS, BLS_POP_DST, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, BRANDING, BREAD_COMMUNITY, type BalanceValidationParams, type BatchMintResult, BundlerClient, type BundlerResponse, CANONICAL_ADDRESSES, CHAIN_MAINNET, CHAIN_SEPOLIA, COMMUNITIES, COMMUNITY_OWNERS, CONTRACTS, CONTRACT_METADATA, CONTRACT_SRC_HASH, CORE_ADDRESSES, CalldataParserRegistryABI, CalldataParserRegistryArtifact, type CanonicalAddresses, type CheckResourcesOptions, type CommunityConfig, type CommunityProfile, type ContractCategory, ContractConfigManager, type ContractNetwork, type ContractScope, type ContractScopeInput, type ContractVersion, DEFAULT_ADMIN_ROLE, DEFAULT_APNTS_PRICE_USD, DEFAULT_CALL_GAS_LIMIT, DEFAULT_GAS_TOKEN_MINT_AMOUNT, DEFAULT_PRE_VERIFICATION_GAS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_NAME, DEFAULT_TOKEN_SYMBOL, DEFAULT_USDT_MINT_AMOUNT, DEFAULT_VERIFICATION_GAS_LIMIT, type DVTAccountSignatureParams, type DVTActions, type DVTTier, DVTValidatorABI, DVTValidatorArtifact, DVT_TIER_T2, DVT_TIER_T3, DVT_VALIDATOR_ADDRESS, type DeploymentValidationParams, type DryRunValidationResult, ENTRY_POINT_ADDRESS, type ERC20Actions, type EnsOptions, EntryPointABI, type EntryPointActions, EntryPointArtifact, EntryPointVersion, FAUCET_API_URL, type FaucetConfig, type FaucetPreparationResult, type ForceExitActions, ForceExitModuleABI, ForceExitModuleArtifact, GTOKEN_ADDRESS, GTOKEN_STAKING_ADDRESS, GTokenABI, type GTokenActions, GTokenArtifact, GTokenAuthorizationABI, type GTokenAuthorizationActions, GTokenAuthorizationArtifact, GTokenStakingABI, GTokenStakingArtifact, type HashToFieldU0U1, type HeliosTransportConfig, INITIAL_ROLE_STAKES, type InitConfig, LINKS, MAX_SERVICE_FEE, MICRO_PAYMENT_CHANNEL_ADDRESS, MONITORING_ADDRESSES, MicroPaymentChannelABI, MicroPaymentChannelArtifact, MySBTABI, MySBTArtifact, NETWORKS, NODE_STAKE_AMOUNTS, type NetworkContracts, NodeType, OFFICIAL_ADDRESSES, type OperatorConfig, type OperatorMode, type P256SessionState, PAYMASTER_ADDRESSES, PAYMASTER_FACTORY_ADDRESS, PAYMASTER_V4_ADDRESS, PAYMASTER_V4_IMPL_ADDRESS, type PackedUserOperation, PaymasterABI, type PaymasterActions, PaymasterArtifact, PaymasterFactoryABI, type PaymasterFactoryActions, PaymasterFactoryArtifact, type PendingExit, type PendingModuleInstall, PolicyDecision, PolicyRegistryABI, type PolicyRegistryActions, PolicyRegistryArtifact, PublicClient, REGISTRY_ADDRESS, REPUTATION_SYSTEM_ADDRESS, ROLE_ANODE, ROLE_COMMUNITY, ROLE_DVT, ROLE_ENDUSER, ROLE_KMS, ROLE_NAMES, ROLE_PAYMASTER_AOA, ROLE_PAYMASTER_SUPER, ROLE_PERMISSION_LEVELS, RegistryABI, type RegistryActions, RegistryArtifact, type ReputationActions, type ReputationBreakdown, type ReputationRule, ReputationSystemABI, ReputationSystemArtifact, RequirementChecker, type ResolvedAPNTsToken, type ResourceBoolCheck, type ResourceReport, type ResourceStakeCheck, type RoleConfig, type RoleConfigDetailed, RolePermissionLevel, type RoleRequirement, type RoleValidationParams, type SBTActions, type SBTData, type SBTMembership, SBT_ADDRESS, SEPOLIA_CONTRACTS, SEPOLIA_V2_VERSIONS, SERVICE_FEE_RATE, SUPER_PAYMASTER_ADDRESS, SepoliaFaucetAPI, SessionKeyValidatorABI, type SessionKeyValidatorActions, SessionKeyValidatorArtifact, SimpleAccountABI, SimpleAccountArtifact, SimpleAccountFactoryABI, SimpleAccountFactoryArtifact, type SlashRecord, type SpendCounter, type StakingActions, StateValidator, SuperPaymasterABI, type SuperPaymasterActions, SuperPaymasterArtifact, type SuperPaymasterConfig, type SupportedChainId, type SupportedNetwork, TEST_ACCOUNT_ADDRESSES, TEST_ACCOUNT_POOL_SIZE, TEST_COMMUNITIES, TEST_TOKEN_ADDRESSES, TOKEN_ADDRESSES, type TokenActions, type TokenBalanceValidationParams, type TokenConfig, type UserOperationV07, V2_SUMMARY, type ValidationParams, type ValidationResult, type X402Actions, X402FacilitatorABI, X402FacilitatorArtifact, XPNTS_FACTORY_ADDRESS, type XPNTsFactoryActions, type XPNTsTokenActions, accountActions, accountFactoryActions, agentActions, agentRegistryActions, aggregatorActions, airAccountActions, airAccountFactoryActions, applyConfig, blsAlgorithmActions, createAAStarPublicClient, createHeliosTransport, describeSupportedChains, dvtActions, encodeDVTAccountSignature, encodeDVTVerifierProof, encodeG2Point, entryPointActions, forceExitActions, gTokenActions, gTokenAuthorizationActions, getAddressUrl, getAllCommunityConfigs, getAllV2Contracts, getBlockExplorer, getCanonicalAddresses, getChainId, getCommunities, getCommunity, getCommunityConfig, getContract, getContractNetworks, getContracts, getCoreContracts, getDeploymentDate, getEntryPoint, getNetwork, getPaymasterV4_1, getRoleName, getRpcUrl, getSimpleAccountFactory, getSuperPaymasterV2, getTestAccounts, getTestTokenContracts, getTokenContracts, getTxUrl, getV2ContractByAddress, getV2ContractByName, getV2ContractsByDate, hashToFieldU0U1, isContractNetworkSupported, isRegisteredCommunity, isSupportedChainId, isV2Contract, listSupportedChainIds, lookupAddress, paymasterActions, paymasterFactoryActions, policyRegistryActions, registryActions, reputationActions, resolveEns, resolveEnsVerified, sbtActions, sessionKeyValidatorActions, stakingActions, superPaymasterActions, tokenActions, x402Actions, x402IsNonceUsed, x402NonceKey, xPNTsFactoryABI, xPNTsFactoryActions, xPNTsFactoryArtifact, xPNTsTokenABI, xPNTsTokenActions, xPNTsTokenArtifact };
7048
+ export { AASTAR_COMMUNITY, AAStarAirAccountFactoryV7ABI, AAStarAirAccountFactoryV7Artifact, AAStarAirAccountV7ABI, AAStarAirAccountV7Artifact, AAStarBLSAggregatorABI, AAStarBLSAggregatorArtifact, AAStarBLSAlgorithmABI, AAStarBLSAlgorithmArtifact, AAStarValidatorABI, AAStarValidatorArtifact, AGENT_IDENTITY_REGISTRY_ADDRESS, AGENT_REPUTATION_REGISTRY_ADDRESS, ALL_ADDRESSES, ALL_ROLES, APNTS_ADDRESS, type AccountActions, type AccountBalance, type AccountFactoryActions, type AgentActions, AgentRegistryABI, type AgentRegistryActions, AgentRegistryArtifact, type AgentSponsorshipPolicy, type AggregatorActions, type AirAccountActions, AirAccountDelegateABI, AirAccountDelegateArtifact, AirAccountExtensionABI, type AirAccountExtensionActions, AirAccountExtensionArtifact, type AirAccountFactoryActions, type AssetPolicy, type AssetPolicyInput, AuthorizationState, BLSAggregatorABI, BLSAggregatorArtifact, type BLSAlgorithmActions, type BLSG1Point, BLSHelpers, BLSSigner, BLSValidatorABI, BLSValidatorArtifact, BLS_AGGREGATOR_ADDRESS, BLS_POP_DST, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, BRANDING, BREAD_COMMUNITY, type BalanceValidationParams, type BatchMintResult, BundlerClient, type BundlerResponse, CANONICAL_ADDRESSES, CHAIN_MAINNET, CHAIN_SEPOLIA, COMMUNITIES, COMMUNITY_OWNERS, CONTRACTS, CONTRACT_METADATA, CONTRACT_SRC_HASH, CORE_ADDRESSES, CalldataParserRegistryABI, CalldataParserRegistryArtifact, type CanonicalAddresses, type CheckResourcesOptions, type CommunityConfig, type CommunityProfile, type ContractCategory, ContractConfigManager, type ContractNetwork, type ContractScope, type ContractScopeInput, type ContractVersion, DEFAULT_ADMIN_ROLE, DEFAULT_APNTS_PRICE_USD, DEFAULT_CALL_GAS_LIMIT, DEFAULT_GAS_TOKEN_MINT_AMOUNT, DEFAULT_PRE_VERIFICATION_GAS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_NAME, DEFAULT_TOKEN_SYMBOL, DEFAULT_USDT_MINT_AMOUNT, DEFAULT_VERIFICATION_GAS_LIMIT, type DVTAccountSignatureParams, type DVTActions, type DVTTier, DVTValidatorABI, DVTValidatorArtifact, DVT_TIER_T2, DVT_TIER_T3, DVT_VALIDATOR_ADDRESS, type DeploymentValidationParams, type DryRunValidationResult, ENTRY_POINT_ADDRESS, type ERC20Actions, type EnsOptions, EntryPointABI, type EntryPointActions, EntryPointArtifact, EntryPointVersion, FAUCET_API_URL, type FaucetConfig, type FaucetPreparationResult, type ForceExitActions, ForceExitModuleABI, ForceExitModuleArtifact, GTOKEN_ADDRESS, GTOKEN_STAKING_ADDRESS, GTokenABI, type GTokenActions, GTokenArtifact, GTokenAuthorizationABI, type GTokenAuthorizationActions, GTokenAuthorizationArtifact, GTokenStakingABI, GTokenStakingArtifact, type HashToFieldU0U1, type HeliosTransportConfig, INITIAL_ROLE_STAKES, type InitConfig, LINKS, MAX_SERVICE_FEE, MICRO_PAYMENT_CHANNEL_ADDRESS, MONITORING_ADDRESSES, MicroPaymentChannelABI, MicroPaymentChannelArtifact, MySBTABI, MySBTArtifact, NETWORKS, NODE_STAKE_AMOUNTS, type NetworkContracts, NodeType, OFFICIAL_ADDRESSES, type OperatorConfig, type OperatorMode, type P256SessionState, PAYMASTER_ADDRESSES, PAYMASTER_FACTORY_ADDRESS, PAYMASTER_V4_ADDRESS, PAYMASTER_V4_IMPL_ADDRESS, type PackedUserOperation, PaymasterABI, type PaymasterActions, PaymasterArtifact, PaymasterFactoryABI, type PaymasterFactoryActions, PaymasterFactoryArtifact, type PendingExit, type PendingModuleInstall, PolicyDecision, PolicyRegistryABI, type PolicyRegistryActions, PolicyRegistryArtifact, PublicClient, REGISTRY_ADDRESS, REPUTATION_SYSTEM_ADDRESS, ROLE_ANODE, ROLE_COMMUNITY, ROLE_DVT, ROLE_ENDUSER, ROLE_KMS, ROLE_NAMES, ROLE_PAYMASTER_AOA, ROLE_PAYMASTER_SUPER, ROLE_PERMISSION_LEVELS, RegistryABI, type RegistryActions, RegistryArtifact, type ReputationActions, type ReputationBreakdown, type ReputationRule, ReputationSystemABI, ReputationSystemArtifact, RequirementChecker, type ResolvedAPNTsToken, type ResourceBoolCheck, type ResourceReport, type ResourceStakeCheck, type RoleConfig, type RoleConfigDetailed, RolePermissionLevel, type RoleRequirement, type RoleValidationParams, type SBTActions, type SBTData, type SBTMembership, SBT_ADDRESS, SEPOLIA_CONTRACTS, SEPOLIA_V2_VERSIONS, SERVICE_FEE_RATE, SUPER_PAYMASTER_ADDRESS, SepoliaFaucetAPI, type SessionConfig, SessionKeyValidatorABI, type SessionKeyValidatorActions, SessionKeyValidatorArtifact, SimpleAccountABI, SimpleAccountArtifact, SimpleAccountFactoryABI, SimpleAccountFactoryArtifact, type SlashRecord, type SpendCounter, type StakingActions, StateValidator, SuperPaymasterABI, type SuperPaymasterActions, SuperPaymasterArtifact, type SuperPaymasterConfig, type SupportedChainId, type SupportedNetwork, TEST_ACCOUNT_ADDRESSES, TEST_ACCOUNT_POOL_SIZE, TEST_COMMUNITIES, TEST_TOKEN_ADDRESSES, TOKEN_ADDRESSES, type TokenActions, type TokenBalanceValidationParams, type TokenConfig, type UserOperationV07, V2_SUMMARY, type ValidationParams, type ValidationResult, type X402Actions, X402FacilitatorABI, X402FacilitatorArtifact, XPNTS_FACTORY_ADDRESS, type XPNTsFactoryActions, type XPNTsTokenActions, accountActions, accountFactoryActions, agentActions, agentRegistryActions, aggregatorActions, airAccountActions, airAccountExtensionActions, airAccountFactoryActions, applyConfig, blsAlgorithmActions, createAAStarPublicClient, createHeliosTransport, describeSupportedChains, dvtActions, encodeDVTAccountSignature, encodeDVTVerifierProof, encodeG2Point, entryPointActions, forceExitActions, gTokenActions, gTokenAuthorizationActions, getAddressUrl, getAllCommunityConfigs, getAllV2Contracts, getBlockExplorer, getCanonicalAddresses, getChainId, getCommunities, getCommunity, getCommunityConfig, getContract, getContractNetworks, getContracts, getCoreContracts, getDeploymentDate, getEntryPoint, getNetwork, getPaymasterV4_1, getRoleName, getRpcUrl, getSimpleAccountFactory, getSuperPaymasterV2, getTestAccounts, getTestTokenContracts, getTokenContracts, getTxUrl, getV2ContractByAddress, getV2ContractByName, getV2ContractsByDate, hashToFieldU0U1, isContractNetworkSupported, isRegisteredCommunity, isSupportedChainId, isV2Contract, listSupportedChainIds, lookupAddress, paymasterActions, paymasterFactoryActions, policyRegistryActions, registryActions, reputationActions, resolveEns, resolveEnsVerified, sbtActions, sessionKeyValidatorActions, stakingActions, superPaymasterActions, tokenActions, x402Actions, x402IsNonceUsed, x402NonceKey, xPNTsFactoryABI, xPNTsFactoryActions, xPNTsFactoryArtifact, xPNTsTokenABI, xPNTsTokenActions, xPNTsTokenArtifact };
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
- export { AASTAR_COMMUNITY, AAStarAirAccountFactoryV7ABI, AAStarAirAccountFactoryV7Artifact, AAStarAirAccountV7ABI, AAStarAirAccountV7Artifact, AAStarBLSAggregatorABI, AAStarBLSAggregatorArtifact, AAStarBLSAlgorithmABI, AAStarBLSAlgorithmArtifact, AAStarValidatorABI, AAStarValidatorArtifact, ALL_ROLES, AgentRegistryABI, AgentRegistryArtifact, AirAccountDelegateABI, AirAccountDelegateArtifact, AirAccountExtensionABI, AirAccountExtensionArtifact, AuthorizationState, BLSAggregatorABI, BLSAggregatorArtifact, BLSHelpers, BLSSigner, BLSValidatorABI, BLSValidatorArtifact, BLS_POP_DST, BRANDING, BREAD_COMMUNITY, BaseClient, BundlerClient, COMMUNITIES, CONTRACTS, CONTRACT_METADATA, CalldataParserRegistryABI, CalldataParserRegistryArtifact, ContractConfigManager, DEFAULT_ADMIN_ROLE, DVTValidatorABI, DVTValidatorArtifact, DVT_TIER_T2, DVT_TIER_T3, EntryPointABI, EntryPointArtifact, EntryPointVersion, ForceExitModuleABI, ForceExitModuleArtifact, GTokenABI, GTokenArtifact, GTokenAuthorizationABI, GTokenAuthorizationArtifact, GTokenStakingABI, GTokenStakingArtifact, INITIAL_ROLE_STAKES, LINKS, MicroPaymentChannelABI, MicroPaymentChannelArtifact, MySBTABI, MySBTArtifact, NETWORKS, NodeType, PaymasterABI, PaymasterArtifact, PaymasterFactoryABI, PaymasterFactoryArtifact, PolicyDecision, PolicyRegistryABI, PolicyRegistryArtifact, ROLE_ANODE, ROLE_COMMUNITY, ROLE_DVT, ROLE_ENDUSER, ROLE_KMS, ROLE_NAMES, ROLE_PAYMASTER_AOA, ROLE_PAYMASTER_SUPER, ROLE_PERMISSION_LEVELS, RegistryABI, RegistryArtifact, ReputationSystemABI, ReputationSystemArtifact, RequirementChecker, RolePermissionLevel, SEPOLIA_CONTRACTS, SEPOLIA_V2_VERSIONS, SepoliaFaucetAPI, SessionKeyValidatorABI, SessionKeyValidatorArtifact, SimpleAccountABI, SimpleAccountArtifact, SimpleAccountFactoryABI, SimpleAccountFactoryArtifact, StateValidator, SuperPaymasterABI, SuperPaymasterArtifact, V2_SUMMARY, X402FacilitatorABI, X402FacilitatorArtifact, accountActions, accountFactoryActions, agentActions, agentRegistryActions, aggregatorActions, airAccountActions, airAccountFactoryActions, blsAlgorithmActions, channelActions, createAAStarPublicClient, createHeliosTransport, dvtActions, encodeDVTAccountSignature, encodeDVTVerifierProof, encodeG2Point, entryPointActions, forceExitActions, gTokenActions, gTokenAuthorizationActions, getAddressUrl, getAllCommunityConfigs, getAllV2Contracts, getBlockExplorer, getChainId, getCommunities, getCommunity, getCommunityConfig, getContract, getContractNetworks, getContracts, getCoreContracts, getDeploymentDate, getEntryPoint, getNetwork, getPaymasterV4_1, getRoleName, getRpcUrl, getSimpleAccountFactory, getSuperPaymasterV2, getTestAccounts, getTestTokenContracts, getTokenContracts, getTxUrl, getV2ContractByAddress, getV2ContractByName, getV2ContractsByDate, hashToFieldU0U1, isContractNetworkSupported, isRegisteredCommunity, isV2Contract, lookupAddress, paymasterActions, paymasterFactoryActions, policyRegistryActions, registryActions, reputationActions, resolveEns, resolveEnsVerified, sbtActions, sessionKeyValidatorActions, stakingActions, superPaymasterActions, tokenActions, x402Actions, x402IsNonceUsed, x402NonceKey, xPNTsFactoryABI, xPNTsFactoryActions, xPNTsFactoryArtifact, xPNTsTokenABI, xPNTsTokenActions, xPNTsTokenArtifact } from './chunk-6QYXGMCR.js';
2
- export { AGENT_IDENTITY_REGISTRY_ADDRESS, AGENT_REPUTATION_REGISTRY_ADDRESS, ALL_ADDRESSES, APNTS_ADDRESS, BLS_AGGREGATOR_ADDRESS, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, CANONICAL_ADDRESSES, CHAIN_MAINNET, CHAIN_SEPOLIA, COMMUNITY_OWNERS, CONTRACT_SRC_HASH, CORE_ADDRESSES, DEFAULT_APNTS_PRICE_USD, DEFAULT_CALL_GAS_LIMIT, DEFAULT_GAS_TOKEN_MINT_AMOUNT, DEFAULT_PRE_VERIFICATION_GAS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_NAME, DEFAULT_TOKEN_SYMBOL, DEFAULT_USDT_MINT_AMOUNT, DEFAULT_VERIFICATION_GAS_LIMIT, DVT_VALIDATOR_ADDRESS, ENTRY_POINT_ADDRESS, FAUCET_API_URL, GTOKEN_ADDRESS, GTOKEN_STAKING_ADDRESS, MAX_SERVICE_FEE, MICRO_PAYMENT_CHANNEL_ADDRESS, MONITORING_ADDRESSES, NODE_STAKE_AMOUNTS, OFFICIAL_ADDRESSES, PAYMASTER_ADDRESSES, PAYMASTER_FACTORY_ADDRESS, PAYMASTER_V4_ADDRESS, PAYMASTER_V4_IMPL_ADDRESS, REGISTRY_ADDRESS, REPUTATION_SYSTEM_ADDRESS, SBT_ADDRESS, SERVICE_FEE_RATE, SUPER_PAYMASTER_ADDRESS, TEST_ACCOUNT_ADDRESSES, TEST_ACCOUNT_POOL_SIZE, TEST_COMMUNITIES, TEST_TOKEN_ADDRESSES, TOKEN_ADDRESSES, XPNTS_FACTORY_ADDRESS, applyConfig, describeSupportedChains, getCanonicalAddresses, isSupportedChainId, listSupportedChainIds } from './chunk-G3UJC4EL.js';
1
+ export { AASTAR_COMMUNITY, AAStarAirAccountFactoryV7ABI, AAStarAirAccountFactoryV7Artifact, AAStarAirAccountV7ABI, AAStarAirAccountV7Artifact, AAStarBLSAggregatorABI, AAStarBLSAggregatorArtifact, AAStarBLSAlgorithmABI, AAStarBLSAlgorithmArtifact, AAStarValidatorABI, AAStarValidatorArtifact, ALL_ROLES, AgentRegistryABI, AgentRegistryArtifact, AirAccountDelegateABI, AirAccountDelegateArtifact, AirAccountExtensionABI, AirAccountExtensionArtifact, AuthorizationState, BLSAggregatorABI, BLSAggregatorArtifact, BLSHelpers, BLSSigner, BLSValidatorABI, BLSValidatorArtifact, BLS_POP_DST, BRANDING, BREAD_COMMUNITY, BaseClient, BundlerClient, COMMUNITIES, CONTRACTS, CONTRACT_METADATA, CalldataParserRegistryABI, CalldataParserRegistryArtifact, ContractConfigManager, DEFAULT_ADMIN_ROLE, DVTValidatorABI, DVTValidatorArtifact, DVT_TIER_T2, DVT_TIER_T3, EntryPointABI, EntryPointArtifact, EntryPointVersion, ForceExitModuleABI, ForceExitModuleArtifact, GTokenABI, GTokenArtifact, GTokenAuthorizationABI, GTokenAuthorizationArtifact, GTokenStakingABI, GTokenStakingArtifact, INITIAL_ROLE_STAKES, LINKS, MicroPaymentChannelABI, MicroPaymentChannelArtifact, MySBTABI, MySBTArtifact, NETWORKS, NodeType, PaymasterABI, PaymasterArtifact, PaymasterFactoryABI, PaymasterFactoryArtifact, PolicyDecision, PolicyRegistryABI, PolicyRegistryArtifact, ROLE_ANODE, ROLE_COMMUNITY, ROLE_DVT, ROLE_ENDUSER, ROLE_KMS, ROLE_NAMES, ROLE_PAYMASTER_AOA, ROLE_PAYMASTER_SUPER, ROLE_PERMISSION_LEVELS, RegistryABI, RegistryArtifact, ReputationSystemABI, ReputationSystemArtifact, RequirementChecker, RolePermissionLevel, SEPOLIA_CONTRACTS, SEPOLIA_V2_VERSIONS, SepoliaFaucetAPI, SessionKeyValidatorABI, SessionKeyValidatorArtifact, SimpleAccountABI, SimpleAccountArtifact, SimpleAccountFactoryABI, SimpleAccountFactoryArtifact, StateValidator, SuperPaymasterABI, SuperPaymasterArtifact, V2_SUMMARY, X402FacilitatorABI, X402FacilitatorArtifact, accountActions, accountFactoryActions, agentActions, agentRegistryActions, aggregatorActions, airAccountActions, airAccountExtensionActions, airAccountFactoryActions, blsAlgorithmActions, channelActions, createAAStarPublicClient, createHeliosTransport, dvtActions, encodeDVTAccountSignature, encodeDVTVerifierProof, encodeG2Point, entryPointActions, forceExitActions, gTokenActions, gTokenAuthorizationActions, getAddressUrl, getAllCommunityConfigs, getAllV2Contracts, getBlockExplorer, getChainId, getCommunities, getCommunity, getCommunityConfig, getContract, getContractNetworks, getContracts, getCoreContracts, getDeploymentDate, getEntryPoint, getNetwork, getPaymasterV4_1, getRoleName, getRpcUrl, getSimpleAccountFactory, getSuperPaymasterV2, getTestAccounts, getTestTokenContracts, getTokenContracts, getTxUrl, getV2ContractByAddress, getV2ContractByName, getV2ContractsByDate, hashToFieldU0U1, isContractNetworkSupported, isRegisteredCommunity, isV2Contract, lookupAddress, paymasterActions, paymasterFactoryActions, policyRegistryActions, registryActions, reputationActions, resolveEns, resolveEnsVerified, sbtActions, sessionKeyValidatorActions, stakingActions, superPaymasterActions, tokenActions, x402Actions, x402IsNonceUsed, x402NonceKey, xPNTsFactoryABI, xPNTsFactoryActions, xPNTsFactoryArtifact, xPNTsTokenABI, xPNTsTokenActions, xPNTsTokenArtifact } from './chunk-M5WFKETT.js';
2
+ export { AGENT_IDENTITY_REGISTRY_ADDRESS, AGENT_REPUTATION_REGISTRY_ADDRESS, ALL_ADDRESSES, APNTS_ADDRESS, BLS_AGGREGATOR_ADDRESS, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, CANONICAL_ADDRESSES, CHAIN_MAINNET, CHAIN_SEPOLIA, COMMUNITY_OWNERS, CONTRACT_SRC_HASH, CORE_ADDRESSES, DEFAULT_APNTS_PRICE_USD, DEFAULT_CALL_GAS_LIMIT, DEFAULT_GAS_TOKEN_MINT_AMOUNT, DEFAULT_PRE_VERIFICATION_GAS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_NAME, DEFAULT_TOKEN_SYMBOL, DEFAULT_USDT_MINT_AMOUNT, DEFAULT_VERIFICATION_GAS_LIMIT, DVT_VALIDATOR_ADDRESS, ENTRY_POINT_ADDRESS, FAUCET_API_URL, GTOKEN_ADDRESS, GTOKEN_STAKING_ADDRESS, MAX_SERVICE_FEE, MICRO_PAYMENT_CHANNEL_ADDRESS, MONITORING_ADDRESSES, NODE_STAKE_AMOUNTS, OFFICIAL_ADDRESSES, PAYMASTER_ADDRESSES, PAYMASTER_FACTORY_ADDRESS, PAYMASTER_V4_ADDRESS, PAYMASTER_V4_IMPL_ADDRESS, REGISTRY_ADDRESS, REPUTATION_SYSTEM_ADDRESS, SBT_ADDRESS, SERVICE_FEE_RATE, SUPER_PAYMASTER_ADDRESS, TEST_ACCOUNT_ADDRESSES, TEST_ACCOUNT_POOL_SIZE, TEST_COMMUNITIES, TEST_TOKEN_ADDRESSES, TOKEN_ADDRESSES, XPNTS_FACTORY_ADDRESS, applyConfig, describeSupportedChains, getCanonicalAddresses, isSupportedChainId, listSupportedChainIds } from './chunk-UCLK6LTB.js';
3
3
  import './chunk-PZ5AY32C.js';
4
4
  //# sourceMappingURL=core.js.map
5
5
  //# sourceMappingURL=core.js.map
package/dist/dapp.cjs ADDED
@@ -0,0 +1,289 @@
1
+ 'use strict';
2
+
3
+ var chunkGAMSWXWI_cjs = require('./chunk-GAMSWXWI.cjs');
4
+ var chunkCIEYY3A6_cjs = require('./chunk-CIEYY3A6.cjs');
5
+ require('./chunk-MXJEULSE.cjs');
6
+ require('./chunk-Q7SFCCGT.cjs');
7
+ var viem = require('viem');
8
+ var react = require('react');
9
+
10
+ var DVT_ABI = viem.parseAbi([
11
+ "function registerValidator(bytes)",
12
+ "function createProposal(address, uint8, string)",
13
+ "function signProposal(uint256, bytes)"
14
+ ]);
15
+ var DVTClient = class {
16
+ static async registerValidator(wallet, dvtAddr, blsPublicKey) {
17
+ return wallet.writeContract({
18
+ address: dvtAddr,
19
+ abi: DVT_ABI,
20
+ functionName: "registerValidator",
21
+ args: [blsPublicKey],
22
+ chain: wallet.chain
23
+ });
24
+ }
25
+ // Additional methods for proposal creation/signing would go here
26
+ };
27
+ function useCreditScore({ chain, rpcUrl, registryAddress, userAddress }) {
28
+ const [creditLimit, setCreditLimit] = react.useState(null);
29
+ const [loading, setLoading] = react.useState(false);
30
+ react.useEffect(() => {
31
+ if (!registryAddress || !userAddress || !rpcUrl) return;
32
+ const fetchCredit = async () => {
33
+ setLoading(true);
34
+ try {
35
+ const client = chunkCIEYY3A6_cjs.createAAStarPublicClient(rpcUrl, chain);
36
+ const limit = await client.readContract({
37
+ address: registryAddress,
38
+ abi: chunkCIEYY3A6_cjs.RegistryABI,
39
+ functionName: "getCreditLimit",
40
+ args: [userAddress]
41
+ });
42
+ setCreditLimit(limit);
43
+ } catch (e) {
44
+ console.error("Failed to fetch credit limit:", e);
45
+ setCreditLimit(0n);
46
+ } finally {
47
+ setLoading(false);
48
+ }
49
+ };
50
+ fetchCredit();
51
+ }, [chain, rpcUrl, registryAddress, userAddress]);
52
+ return { creditLimit, loading };
53
+ }
54
+ function useSuperPaymaster(config) {
55
+ const [isLoading, setIsLoading] = react.useState(false);
56
+ const [error, setError] = react.useState(null);
57
+ const generatePaymasterAndData = react.useCallback(async (userOp) => {
58
+ setIsLoading(true);
59
+ setError(null);
60
+ try {
61
+ const middleware = chunkGAMSWXWI_cjs.getSuperPaymasterMiddleware(config);
62
+ const result = await middleware.sponsorUserOperation({ userOperation: userOp });
63
+ return result.paymasterAndData;
64
+ } catch (err) {
65
+ setError(err);
66
+ throw err;
67
+ } finally {
68
+ setIsLoading(false);
69
+ }
70
+ }, [config.paymasterAddress, config.operator, config.verificationGasLimit, config.postOpGasLimit]);
71
+ return { generatePaymasterAndData, isLoading, error };
72
+ }
73
+ var EXECUTE_ABI = [
74
+ {
75
+ name: "execute",
76
+ type: "function",
77
+ stateMutability: "nonpayable",
78
+ inputs: [
79
+ { name: "dest", type: "address" },
80
+ { name: "value", type: "uint256" },
81
+ { name: "func", type: "bytes" }
82
+ ],
83
+ outputs: []
84
+ }
85
+ ];
86
+ var ENTRYPOINT_ABI = [
87
+ {
88
+ name: "getNonce",
89
+ type: "function",
90
+ stateMutability: "view",
91
+ inputs: [
92
+ { name: "sender", type: "address" },
93
+ { name: "key", type: "uint192" }
94
+ ],
95
+ outputs: [{ name: "nonce", type: "uint256" }]
96
+ },
97
+ {
98
+ name: "getUserOpHash",
99
+ type: "function",
100
+ stateMutability: "view",
101
+ inputs: [
102
+ {
103
+ name: "packedUserOp",
104
+ type: "tuple",
105
+ components: [
106
+ { name: "sender", type: "address" },
107
+ { name: "nonce", type: "uint256" },
108
+ { name: "initCode", type: "bytes" },
109
+ { name: "callData", type: "bytes" },
110
+ { name: "accountGasLimits", type: "bytes32" },
111
+ { name: "preVerificationGas", type: "uint256" },
112
+ { name: "gasFees", type: "bytes32" },
113
+ { name: "paymasterAndData", type: "bytes" },
114
+ { name: "signature", type: "bytes" }
115
+ ]
116
+ }
117
+ ],
118
+ outputs: [{ type: "bytes32" }]
119
+ }
120
+ ];
121
+ var DEFAULT_ENTRYPOINT = "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
122
+ var AirAccountEIP1193Provider = class {
123
+ config;
124
+ client;
125
+ listeners = /* @__PURE__ */ new Map();
126
+ constructor(config) {
127
+ this.config = config;
128
+ this.client = viem.createPublicClient({ transport: viem.http(config.rpcUrl) });
129
+ }
130
+ async request({ method, params }) {
131
+ switch (method) {
132
+ case "eth_chainId":
133
+ return `0x${this.config.chainId.toString(16)}`;
134
+ case "eth_accounts":
135
+ case "eth_requestAccounts":
136
+ return [this.config.accountAddress];
137
+ case "eth_sendTransaction": {
138
+ const tx = params[0];
139
+ return this._sendTransaction(tx);
140
+ }
141
+ case "personal_sign": {
142
+ const [data] = params;
143
+ const hash = viem.hashMessage({ raw: viem.hexToBytes(data) });
144
+ return this.config.signer(hash);
145
+ }
146
+ case "eth_signTypedData_v4": {
147
+ const [, typedDataJson] = params;
148
+ const typedData = JSON.parse(typedDataJson);
149
+ const hash = viem.hashTypedData({
150
+ domain: typedData.domain,
151
+ types: typedData.types,
152
+ primaryType: typedData.primaryType,
153
+ message: typedData.message
154
+ });
155
+ return this.config.signer(hash);
156
+ }
157
+ default:
158
+ return this._forwardToRpc(method, params);
159
+ }
160
+ }
161
+ on(event, listener) {
162
+ if (!this.listeners.has(event)) this.listeners.set(event, /* @__PURE__ */ new Set());
163
+ this.listeners.get(event).add(listener);
164
+ return this;
165
+ }
166
+ removeListener(event, listener) {
167
+ this.listeners.get(event)?.delete(listener);
168
+ return this;
169
+ }
170
+ // ── Private ──────────────────────────────────────────────────────
171
+ async _sendTransaction(tx) {
172
+ const entryPoint = this.config.entryPoint ?? DEFAULT_ENTRYPOINT;
173
+ const callData = viem.encodeFunctionData({
174
+ abi: EXECUTE_ABI,
175
+ functionName: "execute",
176
+ args: [tx.to, BigInt(tx.value ?? "0x0"), tx.data ?? "0x"]
177
+ });
178
+ const [nonce, feeData] = await Promise.all([
179
+ this.client.readContract({
180
+ address: entryPoint,
181
+ abi: ENTRYPOINT_ABI,
182
+ functionName: "getNonce",
183
+ args: [this.config.accountAddress, 0n]
184
+ }),
185
+ this.client.estimateFeesPerGas()
186
+ ]);
187
+ const maxFeePerGas = feeData.maxFeePerGas ?? 1000000000n;
188
+ const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 100000000n;
189
+ const verificationGasLimit = 200000n;
190
+ const callGasLimit = BigInt(tx.gas ?? "0x30000");
191
+ const accountGasLimits = `0x${(verificationGasLimit << 128n | callGasLimit).toString(16).padStart(64, "0")}`;
192
+ const gasFees = `0x${(maxPriorityFeePerGas << 128n | maxFeePerGas).toString(16).padStart(64, "0")}`;
193
+ const userOp = {
194
+ sender: this.config.accountAddress,
195
+ nonce,
196
+ initCode: "0x",
197
+ callData,
198
+ accountGasLimits,
199
+ preVerificationGas: 50000n,
200
+ gasFees,
201
+ paymasterAndData: "0x",
202
+ signature: "0x"
203
+ };
204
+ const userOpHash = await this.client.readContract({
205
+ address: entryPoint,
206
+ abi: ENTRYPOINT_ABI,
207
+ functionName: "getUserOpHash",
208
+ args: [userOp]
209
+ });
210
+ userOp.signature = await this.config.signer(userOpHash);
211
+ const resp = await fetch(this.config.bundlerUrl, {
212
+ method: "POST",
213
+ headers: { "Content-Type": "application/json" },
214
+ body: JSON.stringify({
215
+ jsonrpc: "2.0",
216
+ id: 1,
217
+ method: "eth_sendUserOperation",
218
+ params: [
219
+ {
220
+ sender: userOp.sender,
221
+ nonce: `0x${userOp.nonce.toString(16)}`,
222
+ initCode: userOp.initCode,
223
+ callData: userOp.callData,
224
+ accountGasLimits: userOp.accountGasLimits,
225
+ preVerificationGas: `0x${userOp.preVerificationGas.toString(16)}`,
226
+ gasFees: userOp.gasFees,
227
+ paymasterAndData: userOp.paymasterAndData,
228
+ signature: userOp.signature
229
+ },
230
+ entryPoint
231
+ ]
232
+ })
233
+ });
234
+ const result = await resp.json();
235
+ if (result.error) throw new Error(result.error.message);
236
+ return result.result;
237
+ }
238
+ async _forwardToRpc(method, params) {
239
+ const resp = await fetch(this.config.rpcUrl, {
240
+ method: "POST",
241
+ headers: { "Content-Type": "application/json" },
242
+ body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params: params ?? [] })
243
+ });
244
+ const result = await resp.json();
245
+ if (result.error) throw new Error(result.error.message);
246
+ return result.result;
247
+ }
248
+ };
249
+
250
+ // ../dapp/src/eip6963.ts
251
+ var DEFAULT_ICON = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PGNpcmNsZSBjeD0iMjQiIGN5PSIyNCIgcj0iMjQiIGZpbGw9IiMxQTFBMkUiLz48dGV4dCB4PSIxMiIgeT0iMzIiIGZvbnQtc2l6ZT0iMjQiIGZpbGw9IiNGRkYiPkFBPC90ZXh0Pjwvc3ZnPg==";
252
+ var AIRACCOUNT_UUID = "d4e5f6a7-b8c9-4d0e-8f2a-3b4c5d6e7f80";
253
+ function announceAirAccount(provider, info = {}) {
254
+ const providerDetail = Object.freeze({
255
+ info: Object.freeze({
256
+ uuid: AIRACCOUNT_UUID,
257
+ name: "AirAccount",
258
+ icon: DEFAULT_ICON,
259
+ rdns: "community.aastar.airaccount",
260
+ ...info
261
+ }),
262
+ provider
263
+ });
264
+ const announce = () => {
265
+ window.dispatchEvent(
266
+ new CustomEvent("eip6963:announceProvider", { detail: providerDetail })
267
+ );
268
+ };
269
+ announce();
270
+ window.addEventListener("eip6963:requestProvider", announce);
271
+ return () => window.removeEventListener("eip6963:requestProvider", announce);
272
+ }
273
+ function watchProviders(onProvider) {
274
+ const handler = (event) => {
275
+ onProvider(event.detail);
276
+ };
277
+ window.addEventListener("eip6963:announceProvider", handler);
278
+ window.dispatchEvent(new Event("eip6963:requestProvider"));
279
+ return () => window.removeEventListener("eip6963:announceProvider", handler);
280
+ }
281
+
282
+ exports.AirAccountEIP1193Provider = AirAccountEIP1193Provider;
283
+ exports.DVTClient = DVTClient;
284
+ exports.announceAirAccount = announceAirAccount;
285
+ exports.useCreditScore = useCreditScore;
286
+ exports.useSuperPaymaster = useSuperPaymaster;
287
+ exports.watchProviders = watchProviders;
288
+ //# sourceMappingURL=dapp.cjs.map
289
+ //# sourceMappingURL=dapp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../dapp/src/ui/index.ts","../../dapp/src/ui/hooks/useCreditScore.ts","../../dapp/src/ui/hooks/useSuperPaymaster.ts","../../dapp/src/eip1193.ts","../../dapp/src/eip6963.ts"],"names":["parseAbi","useState","useEffect","createAAStarPublicClient","RegistryABI","useCallback","getSuperPaymasterMiddleware","createPublicClient","http","hashMessage","hexToBytes","hashTypedData","encodeFunctionData"],"mappings":";;;;;;;;;AAGA,IAAM,UAAUA,aAAA,CAAS;AAAA,EACrB,mCAAA;AAAA,EACA,iDAAA;AAAA,EACA;AACJ,CAAC,CAAA;AAEM,IAAM,YAAN,MAAgB;AAAA,EACnB,aAAa,iBAAA,CAAkB,MAAA,EAAsB,OAAA,EAAkB,YAAA,EAAmB;AACtF,IAAA,OAAO,OAAO,aAAA,CAAc;AAAA,MACxB,OAAA,EAAS,OAAA;AAAA,MACT,GAAA,EAAK,OAAA;AAAA,MACL,YAAA,EAAc,mBAAA;AAAA,MACd,IAAA,EAAM,CAAC,YAAY,CAAA;AAAA,MACnB,OAAO,MAAA,CAAO;AAAA,KACV,CAAA;AAAA,EACZ;AAAA;AAGJ;ACRO,SAAS,eAAe,EAAE,KAAA,EAAO,MAAA,EAAQ,eAAA,EAAiB,aAAY,EAAyB;AAClG,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAIC,eAAwB,IAAI,CAAA;AAClE,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAIA,eAAS,KAAK,CAAA;AAE5C,EAAAC,eAAA,CAAU,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AAA;AAE3D,EAAA,MAAA,CAAO,aAAA,CAAc,IAAI,KAAA,CAAM,yBAAyB,CAAC,CAAA;AAEzD,EAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,0BAAA,EAA4B,OAAO,CAAA;AAC7E","file":"dapp.cjs","sourcesContent":["\nimport { type Address, parseAbi, type WalletClient, type Hex } from 'viem';\n\nconst DVT_ABI = parseAbi([\n 'function registerValidator(bytes)',\n 'function createProposal(address, uint8, string)',\n 'function signProposal(uint256, bytes)'\n]);\n\nexport class DVTClient {\n static async registerValidator(wallet: WalletClient, dvtAddr: Address, blsPublicKey: Hex) {\n return wallet.writeContract({\n address: dvtAddr,\n abi: DVT_ABI,\n functionName: 'registerValidator',\n args: [blsPublicKey],\n chain: wallet.chain\n } as any);\n }\n \n // Additional methods for proposal creation/signing would go here\n}\n","\nimport { useState, useEffect } from 'react';\nimport { createAAStarPublicClient, RegistryABI } from '@aastar/core';\nimport { type Address, type Chain, type Transport } from 'viem';\n\ntype UseCreditScoreConfig = {\n chain: any;\n rpcUrl?: string; // Optional if transport is provided\n registryAddress: Address;\n userAddress: Address;\n transport?: any;\n};\n\nexport function useCreditScore({ chain, rpcUrl, registryAddress, userAddress }: UseCreditScoreConfig) {\n const [creditLimit, setCreditLimit] = useState<bigint | null>(null);\n const [loading, setLoading] = useState(false);\n\n useEffect(() => {\n if (!registryAddress || !userAddress || !rpcUrl) return;\n\n const fetchCredit = async () => {\n setLoading(true);\n try {\n const client = createAAStarPublicClient(rpcUrl, chain as any);\n const limit = await client.readContract({\n address: registryAddress,\n abi: RegistryABI as any,\n functionName: 'getCreditLimit',\n args: [userAddress]\n });\n setCreditLimit(limit as bigint);\n } catch (e) {\n console.error(\"Failed to fetch credit limit:\", e);\n setCreditLimit(0n);\n } finally {\n setLoading(false);\n }\n };\n\n fetchCredit();\n }, [chain, rpcUrl, registryAddress, userAddress]);\n\n return { creditLimit, loading };\n}\n","\nimport { useState, useCallback } from 'react';\nimport { getSuperPaymasterMiddleware, type PaymasterConfig } from '@aastar/paymaster';\n\ntype UseSuperPaymasterResult = {\n generatePaymasterAndData: (userOp: any) => Promise<string>;\n isLoading: boolean;\n error: Error | null;\n};\n\nexport function useSuperPaymaster(config: PaymasterConfig): UseSuperPaymasterResult {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const generatePaymasterAndData = useCallback(async (userOp: any) => {\n setIsLoading(true);\n setError(null);\n try {\n const middleware = getSuperPaymasterMiddleware(config);\n const result = await middleware.sponsorUserOperation({ userOperation: userOp });\n return result.paymasterAndData as string;\n } catch (err: any) {\n setError(err);\n throw err;\n } finally {\n setIsLoading(false);\n }\n }, [config.paymasterAddress, config.operator, config.verificationGasLimit, config.postOpGasLimit]);\n\n return { generatePaymasterAndData, isLoading, error };\n}\n","/**\n * eip1193.ts — EIP-1193 compatible provider wrapping AirAccount M7.\n *\n * Intercepts eth_sendTransaction and converts it to an ERC-4337 v0.7\n * PackedUserOperation submitted to the bundler via eth_sendUserOperation.\n * All other JSON-RPC methods are forwarded to the public RPC.\n */\n\nimport {\n createPublicClient,\n encodeFunctionData,\n hashMessage,\n hashTypedData,\n hexToBytes,\n http,\n type Address,\n type Hex,\n} from \"viem\";\n\n// AirAccount execute() — ERC-4337 smart account entry point for single calls\nconst EXECUTE_ABI = [\n {\n name: \"execute\",\n type: \"function\",\n stateMutability: \"nonpayable\",\n inputs: [\n { name: \"dest\", type: \"address\" },\n { name: \"value\", type: \"uint256\" },\n { name: \"func\", type: \"bytes\" },\n ],\n outputs: [],\n },\n] as const;\n\n// EntryPoint v0.7 getNonce + getUserOpHash\nconst ENTRYPOINT_ABI = [\n {\n name: \"getNonce\",\n type: \"function\",\n stateMutability: \"view\",\n inputs: [\n { name: \"sender\", type: \"address\" },\n { name: \"key\", type: \"uint192\" },\n ],\n outputs: [{ name: \"nonce\", type: \"uint256\" }],\n },\n {\n name: \"getUserOpHash\",\n type: \"function\",\n stateMutability: \"view\",\n inputs: [\n {\n name: \"packedUserOp\",\n type: \"tuple\",\n components: [\n { name: \"sender\", type: \"address\" },\n { name: \"nonce\", type: \"uint256\" },\n { name: \"initCode\", type: \"bytes\" },\n { name: \"callData\", type: \"bytes\" },\n { name: \"accountGasLimits\", type: \"bytes32\" },\n { name: \"preVerificationGas\", type: \"uint256\" },\n { name: \"gasFees\", type: \"bytes32\" },\n { name: \"paymasterAndData\", type: \"bytes\" },\n { name: \"signature\", type: \"bytes\" },\n ],\n },\n ],\n outputs: [{ type: \"bytes32\" }],\n },\n] as const;\n\nconst DEFAULT_ENTRYPOINT = \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\" as Address;\n\nexport interface AirAccountProviderConfig {\n /** EVM chain ID */\n chainId: number;\n /** Public JSON-RPC URL */\n rpcUrl: string;\n /** ERC-4337 bundler URL */\n bundlerUrl: string;\n /** EntryPoint v0.7 address (defaults to canonical) */\n entryPoint?: Address;\n /** The user's AirAccount smart contract address */\n accountAddress: Address;\n /**\n * Signs the UserOp hash and returns a 65-byte hex signature.\n * For passkey/ECDSA, format as M7 composite validator signature.\n */\n signer: (userOpHash: Hex) => Promise<Hex>;\n}\n\ntype EthSendTransactionParams = {\n from?: Address;\n to: Address;\n data?: Hex;\n value?: Hex;\n gas?: Hex;\n};\n\n/**\n * AirAccountEIP1193Provider — drop-in EIP-1193 wallet backed by an AirAccount M7 smart account.\n *\n * Usage:\n * ```ts\n * const provider = new AirAccountEIP1193Provider({\n * chainId: 11155111,\n * rpcUrl: 'https://rpc.sepolia.org',\n * bundlerUrl: 'https://api.pimlico.io/v2/11155111/rpc?apikey=...',\n * accountAddress: '0x...',\n * signer: async (hash) => passkeySign(hash),\n * });\n * // Pass to wagmi, ethers.js BrowserProvider, or window.ethereum\n * ```\n */\nexport class AirAccountEIP1193Provider {\n private readonly config: AirAccountProviderConfig;\n private readonly client: ReturnType<typeof createPublicClient>;\n private readonly listeners = new Map<string, Set<(...args: unknown[]) => void>>();\n\n constructor(config: AirAccountProviderConfig) {\n this.config = config;\n this.client = createPublicClient({ transport: http(config.rpcUrl) });\n }\n\n async request({ method, params }: { method: string; params?: unknown[] }): Promise<unknown> {\n switch (method) {\n case \"eth_chainId\":\n return `0x${this.config.chainId.toString(16)}`;\n\n case \"eth_accounts\":\n case \"eth_requestAccounts\":\n return [this.config.accountAddress];\n\n case \"eth_sendTransaction\": {\n const tx = (params as [EthSendTransactionParams])[0];\n return this._sendTransaction(tx);\n }\n\n case \"personal_sign\": {\n // params: [hexData, address] — sign raw bytes with EIP-191 prefix\n const [data] = params as [Hex, Address];\n const hash = hashMessage({ raw: hexToBytes(data) });\n return this.config.signer(hash);\n }\n\n case \"eth_signTypedData_v4\": {\n // params: [address, typedDataJson] — sign EIP-712 typed data\n const [, typedDataJson] = params as [Address, string];\n const typedData = JSON.parse(typedDataJson) as {\n domain: Parameters<typeof hashTypedData>[0][\"domain\"];\n types: Parameters<typeof hashTypedData>[0][\"types\"];\n primaryType: string;\n message: Record<string, unknown>;\n };\n const hash = hashTypedData({\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n });\n return this.config.signer(hash);\n }\n\n default:\n return this._forwardToRpc(method, params);\n }\n }\n\n on(event: string, listener: (...args: unknown[]) => void): this {\n if (!this.listeners.has(event)) this.listeners.set(event, new Set());\n this.listeners.get(event)!.add(listener);\n return this;\n }\n\n removeListener(event: string, listener: (...args: unknown[]) => void): this {\n this.listeners.get(event)?.delete(listener);\n return this;\n }\n\n // ── Private ──────────────────────────────────────────────────────\n\n private async _sendTransaction(tx: EthSendTransactionParams): Promise<Hex> {\n const entryPoint = this.config.entryPoint ?? DEFAULT_ENTRYPOINT;\n\n // Encode execute(to, value, data) for the AirAccount\n const callData = encodeFunctionData({\n abi: EXECUTE_ABI,\n functionName: \"execute\",\n args: [tx.to, BigInt(tx.value ?? \"0x0\"), tx.data ?? \"0x\"],\n });\n\n // Fetch nonce and gas fees in parallel\n const [nonce, feeData] = await Promise.all([\n this.client.readContract({\n address: entryPoint,\n abi: ENTRYPOINT_ABI,\n functionName: \"getNonce\",\n args: [this.config.accountAddress, 0n],\n }) as Promise<bigint>,\n this.client.estimateFeesPerGas(),\n ]);\n\n const maxFeePerGas = feeData.maxFeePerGas ?? 1_000_000_000n;\n const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 100_000_000n;\n\n // Pack gas limits into bytes32 fields (ERC-4337 v0.7 packed format)\n const verificationGasLimit = 200_000n;\n const callGasLimit = BigInt(tx.gas ?? \"0x30000\");\n const accountGasLimits = `0x${((verificationGasLimit << 128n) | callGasLimit).toString(16).padStart(64, \"0\")}` as Hex;\n const gasFees = `0x${((maxPriorityFeePerGas << 128n) | maxFeePerGas).toString(16).padStart(64, \"0\")}` as Hex;\n\n const userOp = {\n sender: this.config.accountAddress,\n nonce,\n initCode: \"0x\" as Hex,\n callData,\n accountGasLimits,\n preVerificationGas: 50_000n,\n gasFees,\n paymasterAndData: \"0x\" as Hex,\n signature: \"0x\" as Hex,\n };\n\n // Get UserOp hash from EntryPoint\n const userOpHash = await this.client.readContract({\n address: entryPoint,\n abi: ENTRYPOINT_ABI,\n functionName: \"getUserOpHash\",\n args: [userOp],\n }) as Hex;\n\n // Sign and attach\n userOp.signature = await this.config.signer(userOpHash);\n\n // Submit to bundler\n const resp = await fetch(this.config.bundlerUrl, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 1,\n method: \"eth_sendUserOperation\",\n params: [\n {\n sender: userOp.sender,\n nonce: `0x${userOp.nonce.toString(16)}`,\n initCode: userOp.initCode,\n callData: userOp.callData,\n accountGasLimits: userOp.accountGasLimits,\n preVerificationGas: `0x${userOp.preVerificationGas.toString(16)}`,\n gasFees: userOp.gasFees,\n paymasterAndData: userOp.paymasterAndData,\n signature: userOp.signature,\n },\n entryPoint,\n ],\n }),\n });\n\n const result = (await resp.json()) as { result?: Hex; error?: { message: string } };\n if (result.error) throw new Error(result.error.message);\n return result.result!;\n }\n\n private async _forwardToRpc(method: string, params?: unknown[]): Promise<unknown> {\n const resp = await fetch(this.config.rpcUrl, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", id: 1, method, params: params ?? [] }),\n });\n const result = (await resp.json()) as { result?: unknown; error?: { message: string } };\n if (result.error) throw new Error(result.error.message);\n return result.result;\n }\n}\n","/**\n * eip6963.ts — EIP-6963 Multi Injected Provider Discovery for AirAccount.\n *\n * Announces AirAccount as an EIP-1193 wallet via the eip6963:announceProvider\n * DOM event, enabling DApps to auto-discover it without relying on window.ethereum.\n *\n * Reference: https://eips.ethereum.org/EIPS/eip-6963\n */\n\nimport type { AirAccountEIP1193Provider } from \"./eip1193.js\";\n\nexport interface EIP6963ProviderInfo {\n /** Globally unique wallet identifier (UUID v4). Must not change across sessions. */\n uuid: string;\n /** Human-readable wallet name displayed in DApp UI */\n name: string;\n /** Wallet icon as a data URI (SVG or PNG, base64) */\n icon: string;\n /** Reverse-DNS identifier, e.g. \"community.aastar.airaccount\" */\n rdns: string;\n}\n\nexport interface EIP6963ProviderDetail {\n info: EIP6963ProviderInfo;\n provider: AirAccountEIP1193Provider;\n}\n\n// AirAccount default icon (minimal SVG placeholder)\nconst DEFAULT_ICON =\n \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PGNpcmNsZSBjeD0iMjQiIGN5PSIyNCIgcj0iMjQiIGZpbGw9IiMxQTFBMkUiLz48dGV4dCB4PSIxMiIgeT0iMzIiIGZvbnQtc2l6ZT0iMjQiIGZpbGw9IiNGRkYiPkFBPC90ZXh0Pjwvc3ZnPg==\";\n\n// Stable UUID for AirAccount — must not change between sessions per EIP-6963 spec\nconst AIRACCOUNT_UUID = \"d4e5f6a7-b8c9-4d0e-8f2a-3b4c5d6e7f80\";\n\n/**\n * Announce AirAccount as an EIP-6963 wallet so DApps can auto-discover it.\n *\n * Call this once at app startup. Returns a cleanup function that removes the\n * event listener when the wallet is no longer available.\n *\n * @example\n * ```ts\n * const provider = new AirAccountEIP1193Provider({ ... });\n * const cleanup = announceAirAccount(provider);\n * // later: cleanup() to stop announcing\n * ```\n */\nexport function announceAirAccount(\n provider: AirAccountEIP1193Provider,\n info: Partial<EIP6963ProviderInfo> = {},\n): () => void {\n const providerDetail: EIP6963ProviderDetail = Object.freeze({\n info: Object.freeze({\n uuid: AIRACCOUNT_UUID,\n name: \"AirAccount\",\n icon: DEFAULT_ICON,\n rdns: \"community.aastar.airaccount\",\n ...info,\n }),\n provider,\n });\n\n const announce = () => {\n window.dispatchEvent(\n new CustomEvent(\"eip6963:announceProvider\", { detail: providerDetail }),\n );\n };\n\n // Announce immediately so DApps already listening receive it\n announce();\n\n // Re-announce whenever a DApp requests wallet discovery\n window.addEventListener(\"eip6963:requestProvider\", announce);\n\n return () => window.removeEventListener(\"eip6963:requestProvider\", announce);\n}\n\n/**\n * Listen for EIP-6963 wallet announcements from other providers in the page.\n * Useful for composing AirAccount with MetaMask fallback, etc.\n *\n * Returns a cleanup function to stop listening.\n */\nexport function watchProviders(\n onProvider: (detail: EIP6963ProviderDetail) => void,\n): () => void {\n const handler = (event: Event) => {\n onProvider((event as CustomEvent<EIP6963ProviderDetail>).detail);\n };\n\n window.addEventListener(\"eip6963:announceProvider\", handler);\n // Trigger all existing wallets to re-announce\n window.dispatchEvent(new Event(\"eip6963:requestProvider\"));\n\n return () => window.removeEventListener(\"eip6963:announceProvider\", handler);\n}\n"]}