@aastar/sdk 0.20.8 → 0.20.9

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 (88) hide show
  1. package/dist/BaseClient-CkBhQ1ou.d.cts +88 -0
  2. package/dist/UserClient-2J6XMTNV.cjs +15 -0
  3. package/dist/UserClient-2J6XMTNV.cjs.map +1 -0
  4. package/dist/account.cjs +31 -0
  5. package/dist/account.cjs.map +1 -0
  6. package/dist/account.d.cts +48 -0
  7. package/dist/admin.cjs +15 -0
  8. package/dist/admin.cjs.map +1 -0
  9. package/dist/admin.d.cts +62 -0
  10. package/dist/airaccount.cjs +452 -0
  11. package/dist/airaccount.cjs.map +1 -0
  12. package/dist/airaccount.d.cts +4 -0
  13. package/dist/channel-CkRRbzT8.d.cts +77 -0
  14. package/dist/channel.cjs +27 -0
  15. package/dist/channel.cjs.map +1 -0
  16. package/dist/channel.d.cts +64 -0
  17. package/dist/chunk-2RCJBWPO.cjs +1168 -0
  18. package/dist/chunk-2RCJBWPO.cjs.map +1 -0
  19. package/dist/chunk-FTJD2DWE.cjs +42472 -0
  20. package/dist/chunk-FTJD2DWE.cjs.map +1 -0
  21. package/dist/chunk-GRDC6ZRA.cjs +118 -0
  22. package/dist/chunk-GRDC6ZRA.cjs.map +1 -0
  23. package/dist/chunk-GX7NROST.cjs +421 -0
  24. package/dist/chunk-GX7NROST.cjs.map +1 -0
  25. package/dist/chunk-HSVQIFIK.cjs +128 -0
  26. package/dist/chunk-HSVQIFIK.cjs.map +1 -0
  27. package/dist/chunk-JTWY2XEG.cjs +115 -0
  28. package/dist/chunk-JTWY2XEG.cjs.map +1 -0
  29. package/dist/chunk-MRREGCWN.cjs +585 -0
  30. package/dist/chunk-MRREGCWN.cjs.map +1 -0
  31. package/dist/chunk-NT26BDGN.cjs +228 -0
  32. package/dist/chunk-NT26BDGN.cjs.map +1 -0
  33. package/dist/chunk-Q7SFCCGT.cjs +11 -0
  34. package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
  35. package/dist/chunk-QLF7N6H7.cjs +448 -0
  36. package/dist/chunk-QLF7N6H7.cjs.map +1 -0
  37. package/dist/chunk-RNHSA3LO.cjs +108 -0
  38. package/dist/chunk-RNHSA3LO.cjs.map +1 -0
  39. package/dist/chunk-S5IKOOUR.cjs +393 -0
  40. package/dist/chunk-S5IKOOUR.cjs.map +1 -0
  41. package/dist/chunk-TFLZETWB.cjs +4693 -0
  42. package/dist/chunk-TFLZETWB.cjs.map +1 -0
  43. package/dist/chunk-WQREDGUF.cjs +435 -0
  44. package/dist/chunk-WQREDGUF.cjs.map +1 -0
  45. package/dist/chunk-XQROKLZI.cjs +4521 -0
  46. package/dist/chunk-XQROKLZI.cjs.map +1 -0
  47. package/dist/contract-addresses-TANQ5DLX.cjs +49 -0
  48. package/dist/contract-addresses-TANQ5DLX.cjs.map +1 -0
  49. package/dist/core.cjs +894 -0
  50. package/dist/core.cjs.map +1 -0
  51. package/dist/core.d.cts +6930 -0
  52. package/dist/dapp.cjs +289 -0
  53. package/dist/dapp.cjs.map +1 -0
  54. package/dist/dapp.d.cts +127 -0
  55. package/dist/doc-types-471vSmPO.d.cts +16 -0
  56. package/dist/enduser.cjs +24 -0
  57. package/dist/enduser.cjs.map +1 -0
  58. package/dist/enduser.d.cts +261 -0
  59. package/dist/identity.cjs +23 -0
  60. package/dist/identity.cjs.map +1 -0
  61. package/dist/identity.d.cts +81 -0
  62. package/dist/index-B6SfEQxo.d.cts +47 -0
  63. package/dist/index.cjs +2814 -0
  64. package/dist/index.cjs.map +1 -0
  65. package/dist/index.d.cts +656 -0
  66. package/dist/kms.cjs +452 -0
  67. package/dist/kms.cjs.map +1 -0
  68. package/dist/kms.d.cts +3054 -0
  69. package/dist/lib-FE4GR7TO.cjs +1865 -0
  70. package/dist/lib-FE4GR7TO.cjs.map +1 -0
  71. package/dist/operator.cjs +27 -0
  72. package/dist/operator.cjs.map +1 -0
  73. package/dist/operator.d.cts +164 -0
  74. package/dist/paymaster.cjs +63 -0
  75. package/dist/paymaster.cjs.map +1 -0
  76. package/dist/paymaster.d.cts +312 -0
  77. package/dist/src-ENPA7D2S.cjs +63 -0
  78. package/dist/src-ENPA7D2S.cjs.map +1 -0
  79. package/dist/src-TQKEO2I4.cjs +894 -0
  80. package/dist/src-TQKEO2I4.cjs.map +1 -0
  81. package/dist/tier-router-DeeVg69O.d.cts +370 -0
  82. package/dist/tokens.cjs +15 -0
  83. package/dist/tokens.cjs.map +1 -0
  84. package/dist/tokens.d.cts +64 -0
  85. package/dist/x402.cjs +103 -0
  86. package/dist/x402.cjs.map +1 -0
  87. package/dist/x402.d.cts +373 -0
  88. package/package.json +32 -32
@@ -0,0 +1,656 @@
1
+ import { RegistryActions, SBTActions, SuperPaymasterActions, PaymasterActions, StakingActions, DVTActions, XPNTsFactoryActions, AggregatorActions } from './core.cjs';
2
+ 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, AccountActions, AccountBalance, AccountFactoryActions, AgentActions, AgentRegistryABI, AgentRegistryActions, AgentRegistryArtifact, AgentSponsorshipPolicy, AirAccountActions, AirAccountDelegateABI, AirAccountDelegateArtifact, AirAccountExtensionABI, AirAccountExtensionArtifact, AirAccountFactoryActions, AssetPolicy, AssetPolicyInput, AuthorizationState, BLSAggregatorABI, BLSAggregatorArtifact, BLSAlgorithmActions, BLSG1Point, BLSHelpers, BLSSigner, BLSValidatorABI, BLSValidatorArtifact, BLS_AGGREGATOR_ADDRESS, BLS_POP_DST, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, BRANDING, BREAD_COMMUNITY, BalanceValidationParams, BatchMintResult, BundlerClient, BundlerResponse, CANONICAL_ADDRESSES, CHAIN_MAINNET, CHAIN_SEPOLIA, COMMUNITIES, COMMUNITY_OWNERS, CONTRACTS, CONTRACT_METADATA, CONTRACT_SRC_HASH, CORE_ADDRESSES, CalldataParserRegistryABI, CalldataParserRegistryArtifact, CanonicalAddresses, CheckResourcesOptions, CommunityConfig, CommunityProfile, ContractCategory, ContractConfigManager, ContractNetwork, ContractScope, ContractScopeInput, 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, DVTAccountSignatureParams, DVTTier, DVTValidatorABI, DVTValidatorArtifact, DVT_TIER_T2, DVT_TIER_T3, DVT_VALIDATOR_ADDRESS, DeploymentValidationParams, DryRunValidationResult, ENTRY_POINT_ADDRESS, ERC20Actions, EnsOptions, EntryPointABI, EntryPointActions, EntryPointArtifact, EntryPointVersion, FAUCET_API_URL, FaucetConfig, FaucetPreparationResult, ForceExitActions, ForceExitModuleABI, ForceExitModuleArtifact, GTOKEN_ADDRESS, GTOKEN_STAKING_ADDRESS, GTokenABI, GTokenActions, GTokenArtifact, GTokenAuthorizationABI, GTokenAuthorizationActions, GTokenAuthorizationArtifact, GTokenStakingABI, GTokenStakingArtifact, HashToFieldU0U1, HeliosTransportConfig, INITIAL_ROLE_STAKES, InitConfig, LINKS, MAX_SERVICE_FEE, MICRO_PAYMENT_CHANNEL_ADDRESS, MONITORING_ADDRESSES, MicroPaymentChannelABI, MicroPaymentChannelArtifact, MySBTABI, MySBTArtifact, NETWORKS, NODE_STAKE_AMOUNTS, NetworkContracts, NodeType, OFFICIAL_ADDRESSES, OperatorConfig, OperatorMode, P256SessionState, PAYMASTER_ADDRESSES, PAYMASTER_FACTORY_ADDRESS, PAYMASTER_V4_ADDRESS, PAYMASTER_V4_IMPL_ADDRESS, PaymasterABI, PaymasterArtifact, PaymasterFactoryABI, PaymasterFactoryActions, PaymasterFactoryArtifact, PendingExit, PendingModuleInstall, PolicyDecision, PolicyRegistryABI, PolicyRegistryActions, PolicyRegistryArtifact, 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, RegistryArtifact, ReputationActions, ReputationBreakdown, ReputationRule, ReputationSystemABI, ReputationSystemArtifact, RequirementChecker, ResolvedAPNTsToken, ResourceBoolCheck, ResourceReport, ResourceStakeCheck, RoleConfig, RoleConfigDetailed, RolePermissionLevel, RoleRequirement, RoleValidationParams, SBTData, SBTMembership, SBT_ADDRESS, SEPOLIA_CONTRACTS, SEPOLIA_V2_VERSIONS, SERVICE_FEE_RATE, SUPER_PAYMASTER_ADDRESS, SepoliaFaucetAPI, SessionKeyValidatorABI, SessionKeyValidatorActions, SessionKeyValidatorArtifact, SimpleAccountABI, SimpleAccountArtifact, SimpleAccountFactoryABI, SimpleAccountFactoryArtifact, SlashRecord, SpendCounter, StateValidator, SuperPaymasterABI, SuperPaymasterArtifact, SuperPaymasterConfig, SupportedChainId, SupportedNetwork, TEST_ACCOUNT_ADDRESSES, TEST_ACCOUNT_POOL_SIZE, TEST_COMMUNITIES, TEST_TOKEN_ADDRESSES, TOKEN_ADDRESSES, TokenActions, TokenBalanceValidationParams, TokenConfig, UserOperationV07, V2_SUMMARY, ValidationParams, ValidationResult, X402Actions, X402FacilitatorABI, X402FacilitatorArtifact, XPNTS_FACTORY_ADDRESS, 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 } from './core.cjs';
3
+ export { P as PublicClient, W as WalletClient } from './doc-types-471vSmPO.cjs';
4
+ export { a as BaseClient, B as BusinessResult, C as ClientConfig, T as TransactionOptions } from './BaseClient-CkBhQ1ou.cjs';
5
+ export { a as ChannelActions, C as ChannelState, c as channelActions } from './channel-CkRRbzT8.cjs';
6
+ export { EOAWalletClient, SimpleSmartAccount, UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount } from './account.cjs';
7
+ export { P as PaymasterConfig, S as SuperPaymasterAdminClient, c as checkEligibility, g as getSuperPaymasterMiddleware } from './index-B6SfEQxo.cjs';
8
+ export { BuildPaymasterDataParams, GaslessReadinessReport, GaslessTransactionConfig, PaymasterClient, PaymasterManager, PaymasterOperator, PaymasterType, PaymasterV4MiddlewareConfig, SuperPaymasterClient, buildPaymasterData, buildSuperPaymasterData, formatUserOpV07, getPaymasterV4Middleware, getUserOpHashV07, tuneGasLimit } from './paymaster.cjs';
9
+ export { ReputationClient, checkMySBT, getMySBTId } from './identity.cjs';
10
+ export { FinanceClient } from './tokens.cjs';
11
+ export { DirectPaymentPayload, EIP3009Authorization, EIP3009_TYPES, FacilitatorClient, FacilitatorConfig, FacilitatorSupported, GTOKEN_EIP712_DOMAIN, HEADER_PAYMENT_REQUIRED, HEADER_PAYMENT_RESPONSE, HEADER_PAYMENT_SIGNATURE, HEADER_V1_PAYMENT, HEADER_V1_PAYMENT_RESPONSE, NetworkId, PaymentPayload, PaymentRequired, PaymentRequirements, ResourceInfo, SettleResponse, VerifyResponse, X402Client, X402ClientConfig, X402PaymentParams, decodePaymentPayload, decodePaymentRequired, decodeSettleResponse, encodePaymentPayload, encodePaymentRequired, encodeSettleResponse, extractPaymentRequired, extractSettleResponse, generateNonce, getEIP3009Domain, signCancelAuthorization, signGTokenTransferWithAuthorization, signReceiveWithAuthorization, signTransferWithAuthorization } from './x402.cjs';
12
+ export { ChannelClient, ChannelClientConfig, ChannelConfig, SignedVoucher, VOUCHER_TYPES, VoucherParams, getVoucherDomain, signVoucher } from './channel.cjs';
13
+ import { Client, Transport, Chain, Account, PublicActions, WalletActions, Address, Hex, Hash, PublicClient } from 'viem';
14
+ export { CommunityClient, CommunityClientConfig, CommunityInfo, CreateCommunityParams, GaslessConfig, OnboardResult, ReputationData, UserClient, UserClientConfig, UserLifecycle, UserLifecycleConfig } from './enduser.cjs';
15
+ export { OperatorClientConfig, OperatorLifecycle, OperatorStatus, PaymasterOperatorClient, ProposalState, ProtocolClient, ProtocolClientConfig, SponsorshipPolicy } from './operator.cjs';
16
+ export { ProtocolGovernance, ProtocolParams } from './admin.cjs';
17
+ import { A as ALG_BLS, a as ALG_CUMULATIVE_T2, b as ALG_CUMULATIVE_T3, c as ALG_ECDSA, d as ALG_P256, e as AirAccountClient, f as AirAccountConfig, g as AlgId, B as BLSConfig, h as BLSManager, i as BLSNode, j as BLSSignatureData, k as BeginAuthenticationResponse, l as BeginRegistrationResponse, m as BeginTransactionVerificationResponse, C as CryptoUtil, n as CumulativeT2SignatureData, o as CumulativeT3SignatureData, D as DEFAULT_PASSKEY_ROUTES, E as ERC4337Utils, G as GasEstimate, p as GuardStatus, P as PackedUserOperation$1, q as PasskeyAuthenticationParams, r as PasskeyInfo, s as PasskeyManager, t as PasskeyRegistrationParams, u as PasskeyRoutes, v as PreCheckResult, T as TierConfig, w as TierLevel, x as TransactionVerificationParams, U as UserOpBuilder, y as UserOperation, Y as YAAAClient, z as YAAAConfig, F as algIdForTier, H as resolveTier } from './tier-router-DeeVg69O.cjs';
18
+ import 'node_modules/viem/_types';
19
+
20
+ type EndUserClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SBTActions & SuperPaymasterActions & PaymasterActions & {
21
+ /**
22
+ * High-level API: Onboard user to community with automatic funding
23
+ */
24
+ onboard: (args: {
25
+ community: Address;
26
+ roleId: Hex;
27
+ roleData: Hex;
28
+ }) => Promise<{
29
+ tx: Hash;
30
+ sbtId: bigint;
31
+ }>;
32
+ /**
33
+ * Orchestrates the user joining a community and activating gas credit flow:
34
+ * 1. Mint SBT for the community (Register ENDUSER role)
35
+ * 2. Verify Credit is active (Reputation check)
36
+ */
37
+ joinAndActivate: (args: {
38
+ community: Address;
39
+ roleId: Hex;
40
+ roleData?: Hex;
41
+ }) => Promise<{
42
+ tx: Hash;
43
+ sbtId: bigint;
44
+ initialCredit: bigint;
45
+ }>;
46
+ /**
47
+ * Executes a gasless transaction via SuperPaymaster.
48
+ */
49
+ executeGasless: (args: {
50
+ target: Address;
51
+ data: Hex;
52
+ value?: bigint;
53
+ operator: Address;
54
+ }) => Promise<Hash>;
55
+ /**
56
+ * Check if the user meets the requirements to join a community (stake, sbt, etc.)
57
+ */
58
+ checkJoinRequirements: (address?: Address) => Promise<{
59
+ hasEnoughGToken: boolean;
60
+ hasSBT: boolean;
61
+ missingRequirements: string[];
62
+ }>;
63
+ /**
64
+ * Predict or deploy a SimpleAccount (ERC-4337)
65
+ */
66
+ deploySmartAccount: (params: {
67
+ owner: Address;
68
+ salt?: bigint;
69
+ fundWithETH?: bigint;
70
+ }) => Promise<{
71
+ accountAddress: Address;
72
+ deployTxHash: Hash;
73
+ isDeployed: boolean;
74
+ }>;
75
+ /**
76
+ * Predict the address of a SimpleAccount without deploying
77
+ */
78
+ createSmartAccount: (params: {
79
+ owner: Address;
80
+ salt?: bigint;
81
+ }) => Promise<{
82
+ accountAddress: Address;
83
+ initCode: Hex;
84
+ isDeployed: boolean;
85
+ }>;
86
+ };
87
+ declare function createEndUserClient({ chain, transport, account, addresses }: {
88
+ chain: Chain;
89
+ transport: Transport;
90
+ account?: Account;
91
+ addresses?: {
92
+ [key: string]: Address;
93
+ };
94
+ }): EndUserClient;
95
+
96
+ type OperatorClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SuperPaymasterActions & PaymasterActions & StakingActions & {
97
+ /**
98
+ * High-level API: Setup operator with automatic funding and onboarding
99
+ */
100
+ setup: (args: {
101
+ stakeAmount: bigint;
102
+ depositAmount: bigint;
103
+ roleId: Hex;
104
+ roleData?: Hex;
105
+ }) => Promise<{
106
+ txs: Hash[];
107
+ }>;
108
+ deployPaymasterV4: (args?: {
109
+ version?: string;
110
+ initData?: Hex;
111
+ }) => Promise<Hash>;
112
+ /**
113
+ * Orchestrates the full onboarding flow:
114
+ * 1. Approve GToken (Stake)
115
+ * 2. Register Role (Stake Lock)
116
+ * 3. Approve aPNTs (Deposit)
117
+ * 4. Deposit aPNTs (SuperPaymaster)
118
+ */
119
+ onboardOperator: (args: {
120
+ stakeAmount: bigint;
121
+ depositAmount: bigint;
122
+ roleId: Hex;
123
+ roleData?: Hex;
124
+ }) => Promise<Hash[]>;
125
+ /** @deprecated Use onboardOperator */
126
+ onboardToSuperPaymaster: (args: {
127
+ stakeAmount: bigint;
128
+ depositAmount: bigint;
129
+ roleId: Hex;
130
+ }) => Promise<Hash[]>;
131
+ configureOperator: (args: {
132
+ xPNTsToken: Address;
133
+ treasury: Address;
134
+ account?: Account | Address;
135
+ }) => Promise<Hash>;
136
+ getOperatorStatus: (accountAddress: Address) => Promise<{
137
+ type: 'super' | 'v4' | null;
138
+ superPaymaster: {
139
+ hasRole: boolean;
140
+ isConfigured: boolean;
141
+ balance: bigint;
142
+ /** Exchange rate read from xPNTsToken.exchangeRate() — not from operators() */
143
+ exchangeRate: bigint;
144
+ treasury: Address;
145
+ } | null;
146
+ paymasterV4: {
147
+ address: Address;
148
+ balance: bigint;
149
+ } | null;
150
+ }>;
151
+ };
152
+ declare function createOperatorClient({ chain, transport, account, addresses }: {
153
+ chain: Chain;
154
+ transport: Transport;
155
+ account?: Account;
156
+ addresses?: {
157
+ [key: string]: Address;
158
+ };
159
+ }): OperatorClient;
160
+
161
+ type CommunityClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SBTActions & {
162
+ /**
163
+ * Query community registration status and token information
164
+ * Returns null if not registered, otherwise returns community details
165
+ */
166
+ getCommunityInfo: (accountAddress: Address) => Promise<{
167
+ hasRole: boolean;
168
+ tokenAddress: Address | null;
169
+ communityData: {
170
+ name: string;
171
+ ensName: string;
172
+ website: string;
173
+ description: string;
174
+ } | null;
175
+ }>;
176
+ /**
177
+ * High-level API to launch a community with automatic roleData generation
178
+ */
179
+ launch: (args: {
180
+ name: string;
181
+ tokenName: string;
182
+ tokenSymbol: string;
183
+ description?: string;
184
+ logoURI?: string;
185
+ website?: string;
186
+ }) => Promise<{
187
+ tokenAddress: Address;
188
+ txs: Hex[];
189
+ }>;
190
+ };
191
+ declare function createCommunityClient({ chain, transport, account, addresses }: {
192
+ chain: Chain;
193
+ transport: Transport;
194
+ account?: Account;
195
+ addresses?: {
196
+ [key: string]: Address;
197
+ };
198
+ }): CommunityClient;
199
+
200
+ type AdminClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SuperPaymasterActions & PaymasterActions & StakingActions & SBTActions & DVTActions & XPNTsFactoryActions & AggregatorActions;
201
+ declare function createAdminClient({ chain, transport, account, addresses }: {
202
+ chain: Chain;
203
+ transport: Transport;
204
+ account?: Account;
205
+ addresses?: {
206
+ [key: string]: Address;
207
+ };
208
+ }): AdminClient;
209
+
210
+ interface ExperimentRecord {
211
+ id: string;
212
+ scenario: string;
213
+ group: 'EOA' | 'AA' | 'SuperPaymaster';
214
+ txHash: string;
215
+ gasUsed: bigint;
216
+ gasPrice: bigint;
217
+ costETH: string;
218
+ status: 'Success' | 'Failed';
219
+ timestamp: number;
220
+ meta?: any;
221
+ }
222
+ /**
223
+ * ExperimentClient: Business-layer tool for measuring and recording execution metrics
224
+ */
225
+ declare class ExperimentClient {
226
+ private records;
227
+ private scenarioId;
228
+ private group;
229
+ constructor(scenarioId: string, group: 'EOA' | 'AA' | 'SuperPaymaster');
230
+ /**
231
+ * Record a transaction result
232
+ */
233
+ recordTx(txHash: Hash, receipt: {
234
+ gasUsed: any;
235
+ effectiveGasPrice: any;
236
+ }, status: 'Success' | 'Failed', meta?: any): ExperimentRecord;
237
+ /**
238
+ * Measure an async task (transaction) automatically
239
+ */
240
+ measureTx(taskName: string, txPromise: Promise<Hash>, publicClient: any): Promise<Hash>;
241
+ getRecords(): ExperimentRecord[];
242
+ }
243
+
244
+ declare const index_ALG_BLS: typeof ALG_BLS;
245
+ declare const index_ALG_CUMULATIVE_T2: typeof ALG_CUMULATIVE_T2;
246
+ declare const index_ALG_CUMULATIVE_T3: typeof ALG_CUMULATIVE_T3;
247
+ declare const index_ALG_ECDSA: typeof ALG_ECDSA;
248
+ declare const index_ALG_P256: typeof ALG_P256;
249
+ declare const index_AirAccountClient: typeof AirAccountClient;
250
+ declare const index_AirAccountConfig: typeof AirAccountConfig;
251
+ declare const index_AlgId: typeof AlgId;
252
+ declare const index_BLSConfig: typeof BLSConfig;
253
+ declare const index_BLSManager: typeof BLSManager;
254
+ declare const index_BLSNode: typeof BLSNode;
255
+ declare const index_BLSSignatureData: typeof BLSSignatureData;
256
+ declare const index_BeginAuthenticationResponse: typeof BeginAuthenticationResponse;
257
+ declare const index_BeginRegistrationResponse: typeof BeginRegistrationResponse;
258
+ declare const index_BeginTransactionVerificationResponse: typeof BeginTransactionVerificationResponse;
259
+ declare const index_CryptoUtil: typeof CryptoUtil;
260
+ declare const index_CumulativeT2SignatureData: typeof CumulativeT2SignatureData;
261
+ declare const index_CumulativeT3SignatureData: typeof CumulativeT3SignatureData;
262
+ declare const index_DEFAULT_PASSKEY_ROUTES: typeof DEFAULT_PASSKEY_ROUTES;
263
+ declare const index_ERC4337Utils: typeof ERC4337Utils;
264
+ declare const index_GasEstimate: typeof GasEstimate;
265
+ declare const index_GuardStatus: typeof GuardStatus;
266
+ declare const index_PasskeyAuthenticationParams: typeof PasskeyAuthenticationParams;
267
+ declare const index_PasskeyInfo: typeof PasskeyInfo;
268
+ declare const index_PasskeyManager: typeof PasskeyManager;
269
+ declare const index_PasskeyRegistrationParams: typeof PasskeyRegistrationParams;
270
+ declare const index_PasskeyRoutes: typeof PasskeyRoutes;
271
+ declare const index_PreCheckResult: typeof PreCheckResult;
272
+ declare const index_TierConfig: typeof TierConfig;
273
+ declare const index_TierLevel: typeof TierLevel;
274
+ declare const index_TransactionVerificationParams: typeof TransactionVerificationParams;
275
+ declare const index_UserOpBuilder: typeof UserOpBuilder;
276
+ declare const index_UserOperation: typeof UserOperation;
277
+ declare const index_YAAAClient: typeof YAAAClient;
278
+ declare const index_YAAAConfig: typeof YAAAConfig;
279
+ declare const index_algIdForTier: typeof algIdForTier;
280
+ declare const index_resolveTier: typeof resolveTier;
281
+ declare namespace index {
282
+ export { index_ALG_BLS as ALG_BLS, index_ALG_CUMULATIVE_T2 as ALG_CUMULATIVE_T2, index_ALG_CUMULATIVE_T3 as ALG_CUMULATIVE_T3, index_ALG_ECDSA as ALG_ECDSA, index_ALG_P256 as ALG_P256, index_AirAccountClient as AirAccountClient, index_AirAccountConfig as AirAccountConfig, index_AlgId as AlgId, index_BLSConfig as BLSConfig, index_BLSManager as BLSManager, index_BLSNode as BLSNode, index_BLSSignatureData as BLSSignatureData, index_BeginAuthenticationResponse as BeginAuthenticationResponse, index_BeginRegistrationResponse as BeginRegistrationResponse, index_BeginTransactionVerificationResponse as BeginTransactionVerificationResponse, index_CryptoUtil as CryptoUtil, index_CumulativeT2SignatureData as CumulativeT2SignatureData, index_CumulativeT3SignatureData as CumulativeT3SignatureData, index_DEFAULT_PASSKEY_ROUTES as DEFAULT_PASSKEY_ROUTES, index_ERC4337Utils as ERC4337Utils, index_GasEstimate as GasEstimate, index_GuardStatus as GuardStatus, PackedUserOperation$1 as PackedUserOperation, index_PasskeyAuthenticationParams as PasskeyAuthenticationParams, index_PasskeyInfo as PasskeyInfo, index_PasskeyManager as PasskeyManager, index_PasskeyRegistrationParams as PasskeyRegistrationParams, index_PasskeyRoutes as PasskeyRoutes, index_PreCheckResult as PreCheckResult, index_TierConfig as TierConfig, index_TierLevel as TierLevel, index_TransactionVerificationParams as TransactionVerificationParams, index_UserOpBuilder as UserOpBuilder, index_UserOperation as UserOperation, index_YAAAClient as YAAAClient, index_YAAAConfig as YAAAConfig, index_algIdForTier as algIdForTier, index_resolveTier as resolveTier };
283
+ }
284
+
285
+ declare const RoleIds: {
286
+ readonly PAYMASTER_SUPER: `0x${string}`;
287
+ readonly DVT: `0x${string}`;
288
+ readonly PAYMASTER_AOA: `0x${string}`;
289
+ readonly KMS: `0x${string}`;
290
+ readonly COMMUNITY: `0x${string}`;
291
+ readonly ENDUSER: `0x${string}`;
292
+ readonly ANODE: `0x${string}`;
293
+ };
294
+ type RoleId = typeof RoleIds[keyof typeof RoleIds];
295
+ declare const RoleDataFactory: {
296
+ /**
297
+ * Data for SuperPaymaster Operator (Empty)
298
+ */
299
+ paymasterSuper: () => Hex;
300
+ /**
301
+ * Data for Generic DVT Role (Empty)
302
+ */
303
+ dvt: () => Hex;
304
+ /**
305
+ * Data for Community Registration (matches Registry.sol CommunityRoleData)
306
+ * NOTE: Solidity's abi.encode(struct) adds a 32-byte offset prefix (0x20)
307
+ * which is required for abi.decode(struct) to work correctly.
308
+ *
309
+ * @param params.name Community Name (defaults to 'TestCommunity')
310
+ * @param params.ensName ENS name (optional)
311
+ * @param params.website Website URL (optional)
312
+ * @param params.description Community description (optional)
313
+ * @param params.logoURI Logo URI string (optional)
314
+ * @param params.stakeAmount Stake amount (defaults to 0)
315
+ */
316
+ community: (params?: {
317
+ name?: string;
318
+ ensName?: string;
319
+ website?: string;
320
+ description?: string;
321
+ logoURI?: string;
322
+ stakeAmount?: bigint;
323
+ }) => Hex;
324
+ /**
325
+ * Data for EndUser (matches Registry.sol EndUserRoleData)
326
+ */
327
+ endUser: (params?: {
328
+ account?: Address;
329
+ community?: Address;
330
+ avatarURI?: string;
331
+ ensName?: string;
332
+ stakeAmount?: bigint;
333
+ }) => Hex;
334
+ decodeCommunity: (data: Hex) => {
335
+ name: any;
336
+ ensName: any;
337
+ website: any;
338
+ description: any;
339
+ logoURI: any;
340
+ stakeAmount: any;
341
+ };
342
+ decodeEndUser: (data: Hex) => {
343
+ account: any;
344
+ community: any;
345
+ avatarURI: any;
346
+ ensName: any;
347
+ stakeAmount: any;
348
+ };
349
+ };
350
+
351
+ /**
352
+ * 密钥对接口
353
+ */
354
+ interface KeyPair {
355
+ name: string;
356
+ privateKey: Hex;
357
+ address: Address;
358
+ }
359
+ /**
360
+ * 密钥管理器
361
+ * 提供密钥生成、存储、加载等工具函数
362
+ */
363
+ declare class KeyManager {
364
+ /**
365
+ * 生成单个密钥对
366
+ * @param name - 密钥名称(如 'Jason', 'Anni')
367
+ */
368
+ static generateKeyPair(name: string): KeyPair;
369
+ /**
370
+ * 批量生成密钥对
371
+ * @param names - 密钥名称数组
372
+ */
373
+ static generateKeyPairs(names: string[]): KeyPair[];
374
+ /**
375
+ * 生成指定数量的密钥对(自动命名为 Operator_1, Operator_2, ...)
376
+ * @param count - 数量
377
+ * @param prefix - 名称前缀(默认 'Operator')
378
+ */
379
+ static generateMultiple(count: number, prefix?: string): KeyPair[];
380
+ /**
381
+ * 保存密钥到 .env 文件
382
+ * @param filePath - 文件路径(绝对路径)
383
+ * @param keys - 密钥对数组
384
+ * @param overwrite - 是否覆盖已存在的文件(默认 false)
385
+ */
386
+ static saveToEnvFile(filePath: string, keys: KeyPair[], overwrite?: boolean): void;
387
+ /**
388
+ * 从 .env 文件加载密钥
389
+ * @param filePath - 文件路径(绝对路径)
390
+ * @returns 密钥对数组
391
+ */
392
+ static loadFromEnvFile(filePath: string): KeyPair[];
393
+ /**
394
+ * 保存密钥到 JSON 文件(包含地址信息)
395
+ * @param filePath - 文件路径(绝对路径)
396
+ * @param keys - 密钥对数组
397
+ * @param overwrite - 是否覆盖已存在的文件(默认 false)
398
+ */
399
+ static saveToJsonFile(filePath: string, keys: KeyPair[], overwrite?: boolean): void;
400
+ /**
401
+ * 从 JSON 文件加载密钥
402
+ * @param filePath - 文件路径(绝对路径)
403
+ */
404
+ static loadFromJsonFile(filePath: string): KeyPair[];
405
+ /**
406
+ * 打印密钥信息(隐藏私钥)
407
+ * @param keys - 密钥对数组
408
+ */
409
+ static printKeys(keys: KeyPair[], showPrivateKey?: boolean): void;
410
+ }
411
+
412
+ /**
413
+ * 资金管理参数
414
+ */
415
+ interface FundingParams {
416
+ /** RPC URL */
417
+ rpcUrl: string;
418
+ /** 链配置 */
419
+ chain: Chain;
420
+ /** 资金提供者私钥 */
421
+ supplierKey: Hex;
422
+ /** 目标地址 */
423
+ targetAddress: Address;
424
+ }
425
+ /**
426
+ * ETH 充值参数
427
+ */
428
+ interface FundETHParams extends FundingParams {
429
+ /** 充值金额(ETH,如 '0.1') */
430
+ amount: string;
431
+ }
432
+ /**
433
+ * ERC20 充值参数
434
+ */
435
+ interface FundTokenParams extends FundingParams {
436
+ /** Token 合约地址 */
437
+ tokenAddress: Address;
438
+ /** 充值金额(Token,如 '100') */
439
+ amount: string;
440
+ }
441
+ /**
442
+ * 智能充值参数
443
+ */
444
+ interface EnsureFundingParams extends FundingParams {
445
+ /** 最小 ETH 余额阈值 */
446
+ minETH?: string;
447
+ /** 目标 ETH 充值金额 */
448
+ targetETH?: string;
449
+ /** Token 配置(可选) */
450
+ token?: {
451
+ address: Address;
452
+ minBalance?: string;
453
+ targetAmount?: string;
454
+ };
455
+ }
456
+ /**
457
+ * 充值结果
458
+ */
459
+ interface FundingResult {
460
+ success: boolean;
461
+ txHash?: Hex;
462
+ error?: string;
463
+ }
464
+ /**
465
+ * 资金管理器
466
+ * 提供 ETH 和 ERC20 Token 的充值、验证等工具函数
467
+ */
468
+ declare class FundingManager {
469
+ /**
470
+ * 创建 PublicClient 和 WalletClient
471
+ */
472
+ private static createClients;
473
+ /**
474
+ * 充值 ETH 到目标地址
475
+ * @param params - 充值参数
476
+ * @returns 充值结果
477
+ */
478
+ static fundWithETH(params: FundETHParams): Promise<FundingResult>;
479
+ /**
480
+ * 充值 ERC20 Token 到目标地址
481
+ * @param params - 充值参数
482
+ * @returns 充值结果
483
+ */
484
+ static fundWithToken(params: FundTokenParams): Promise<FundingResult>;
485
+ /**
486
+ * 检查 ETH 余额
487
+ * @param params - 基础参数
488
+ * @returns ETH 余额(wei)
489
+ */
490
+ static getETHBalance(params: FundingParams): Promise<bigint>;
491
+ /**
492
+ * 检查 ERC20 Token 余额
493
+ * @param params - 基础参数
494
+ * @param tokenAddress - Token 合约地址
495
+ * @returns Token 余额
496
+ */
497
+ static getTokenBalance(params: FundingParams, tokenAddress: Address): Promise<bigint>;
498
+ /**
499
+ * 智能充值:检查余额,不足时自动充值
500
+ * @param params - 充值参数
501
+ * @returns 充值结果数组
502
+ */
503
+ static ensureFunding(params: EnsureFundingParams): Promise<FundingResult[]>;
504
+ /**
505
+ * 批量充值 ETH
506
+ * @param params - 基础参数
507
+ * @param targets - 目标地址和金额数组
508
+ * @returns 充值结果数组
509
+ */
510
+ static batchFundETH(params: Omit<FundingParams, 'targetAddress'>, targets: Array<{
511
+ address: Address;
512
+ amount: string;
513
+ }>): Promise<FundingResult[]>;
514
+ /**
515
+ * 批量充值 Token
516
+ * @param params - 基础参数
517
+ * @param tokenAddress - Token 合约地址
518
+ * @param targets - 目标地址和金额数组
519
+ * @returns 充值结果数组
520
+ */
521
+ static batchFundToken(params: Omit<FundingParams, 'targetAddress'>, tokenAddress: Address, targets: Array<{
522
+ address: Address;
523
+ amount: string;
524
+ }>): Promise<FundingResult[]>;
525
+ }
526
+
527
+ /**
528
+ * ERC-4337 v0.7 Packed UserOperation structure.
529
+ */
530
+ interface PackedUserOperation {
531
+ sender: Address;
532
+ nonce: Hex;
533
+ initCode: Hex;
534
+ callData: Hex;
535
+ accountGasLimits: Hex;
536
+ preVerificationGas: Hex;
537
+ gasFees: Hex;
538
+ paymasterAndData: Hex;
539
+ signature: Hex;
540
+ }
541
+ interface UserOpGasParams {
542
+ verificationGasLimit: bigint;
543
+ callGasLimit: bigint;
544
+ preVerificationGas: bigint;
545
+ maxPriorityFeePerGas: bigint;
546
+ maxFeePerGas: bigint;
547
+ }
548
+ interface PaymasterGasParams {
549
+ paymasterGasLimit: bigint;
550
+ paymasterPostOpGasLimit: bigint;
551
+ }
552
+ declare class UserOperationBuilder {
553
+ /**
554
+ * Packs verificationGasLimit and callGasLimit into a bytes32 Hex string.
555
+ */
556
+ static packAccountGasLimits(verificationGasLimit: bigint, callGasLimit: bigint): Hex;
557
+ /**
558
+ * Packs maxPriorityFeePerGas and maxFeePerGas into a bytes32 Hex string.
559
+ */
560
+ static packGasFees(maxPriorityFeePerGas: bigint, maxFeePerGas: bigint): Hex;
561
+ static estimatePreVerificationGasV07(userOp: {
562
+ sender: Address;
563
+ nonce: bigint | Hex | number | string;
564
+ initCode: Hex;
565
+ callData: Hex;
566
+ accountGasLimits: Hex;
567
+ preVerificationGas: bigint | Hex | number | string;
568
+ gasFees: Hex;
569
+ paymasterAndData: Hex;
570
+ signature: Hex;
571
+ }): bigint;
572
+ /**
573
+ * Packs Paymaster parameters into the v0.7 paymasterAndData format.
574
+ */
575
+ static packPaymasterAndData(paymaster: Address, paymasterGasLimit: bigint, paymasterPostOpGasLimit: bigint, paymasterData?: Hex): Hex;
576
+ /**
577
+ * Pack PaymasterV4 Deposit-Only paymasterAndData
578
+ *
579
+ * v0.7 EntryPoint packs: [paymaster(20)][verificationGas(16)][postOpGas(16)][paymasterData]
580
+ * Contract extracts token at offset 52 = paymasterData[0:20]
581
+ *
582
+ * So paymasterData format must be: [token(20)][validUntil(6)][validAfter(6)]
583
+ *
584
+ * @param paymaster - Paymaster address (20 bytes)
585
+ * @param paymentToken - ERC20 token address (20 bytes, FIRST in paymasterData!)
586
+ * @param validUntil - Validity end timestamp (6 bytes)
587
+ * @param validAfter - Validity start timestamp (6 bytes)
588
+ */
589
+ static packPaymasterV4DepositData(paymaster: Address, paymasterVerificationGasLimit: bigint, paymasterPostOpGasLimit: bigint, paymentToken: Address, validUntil: bigint, validAfter: bigint): Hex;
590
+ /**
591
+ * Computes the UserOperation hash for signing.
592
+ */
593
+ static getUserOpHash({ userOp, entryPoint, chainId, publicClient }: {
594
+ userOp: PackedUserOperation;
595
+ entryPoint: Address;
596
+ chainId: number;
597
+ publicClient: PublicClient;
598
+ }): Promise<Hex>;
599
+ /**
600
+ * Formats a PackedUserOperation into a JSON-RPC compatible object with hex-encoded strings.
601
+ */
602
+ static jsonifyUserOp(userOp: any): any;
603
+ /**
604
+ * Converts a PackedUserOperation to the Alchemy-specific v0.7 JSON format.
605
+ * @param userOp - The packed UserOperation
606
+ * @param options - Optional configuration
607
+ * @param options.paymasterVerificationGasLimit - Gas limit for paymaster verification (default: 200000)
608
+ * @param options.paymasterPostOpGasLimit - Gas limit for paymaster postOp (default: 200000)
609
+ */
610
+ static toAlchemyUserOperation(userOp: any, options?: {
611
+ paymasterVerificationGasLimit?: bigint;
612
+ paymasterPostOpGasLimit?: bigint;
613
+ }): any;
614
+ }
615
+
616
+ declare enum UserOpScenarioType {
617
+ NATIVE = "NATIVE",// Plain ERC-4337, user pays ETH
618
+ GASLESS_V4 = "GASLESS_V4",// Standard PaymasterV4
619
+ SUPER_BPNT = "SUPER_BPNT",// SuperPaymaster with bPNT internal payment
620
+ SUPER_CPNT = "SUPER_CPNT",// SuperPaymaster with cPNT internal payment
621
+ SUPER_CUSTOM = "SUPER_CUSTOM"
622
+ }
623
+ interface ScenarioParams {
624
+ sender: Address;
625
+ ownerAccount: any;
626
+ recipient: Address;
627
+ tokenAddress: Address;
628
+ amount: bigint;
629
+ entryPoint: Address;
630
+ chainId: number;
631
+ publicClient: PublicClient;
632
+ paymaster?: Address;
633
+ operator?: Address;
634
+ paymasterGasLimit?: bigint;
635
+ paymasterPostOpGasLimit?: bigint;
636
+ nonceKey?: bigint;
637
+ gasToken?: Address;
638
+ }
639
+ declare class UserOpScenarioBuilder {
640
+ /**
641
+ * Builds a signed PackedUserOperation for a token transfer based on the specified scenario.
642
+ */
643
+ static buildTransferScenario(type: UserOpScenarioType, params: ScenarioParams): Promise<{
644
+ userOp: any;
645
+ opHash: Hash;
646
+ }>;
647
+ }
648
+
649
+ declare const CustomErrors: {
650
+ readonly RoleNotConfigured: "RoleNotConfigured(bytes32,bool)";
651
+ readonly RoleAlreadyGranted: "RoleAlreadyGranted(bytes32,address)";
652
+ readonly InsufficientStake: "InsufficientStake(uint256,uint256)";
653
+ };
654
+ declare function decodeContractError(error: any): string | null;
655
+
656
+ export { type AdminClient, AggregatorActions, index as AirAccount, CustomErrors, DVTActions, type EndUserClient, type EnsureFundingParams, ExperimentClient, type ExperimentRecord, type FundETHParams, type FundTokenParams, FundingManager, type FundingParams, type FundingResult, index as KMS, KeyManager, type KeyPair, type CommunityClient as LegacyCommunityClient, type OperatorClient, type PackedUserOperation, PaymasterActions, type PaymasterGasParams, RegistryActions, RoleDataFactory, type RoleId, RoleIds, SBTActions, type ScenarioParams, StakingActions, SuperPaymasterActions, type UserOpGasParams, UserOpScenarioBuilder, UserOpScenarioType, UserOperationBuilder, XPNTsFactoryActions, createAdminClient, createCommunityClient, createEndUserClient, createOperatorClient, decodeContractError };