@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.
- package/dist/BaseClient-CkBhQ1ou.d.cts +88 -0
- package/dist/UserClient-2J6XMTNV.cjs +15 -0
- package/dist/UserClient-2J6XMTNV.cjs.map +1 -0
- package/dist/account.cjs +31 -0
- package/dist/account.cjs.map +1 -0
- package/dist/account.d.cts +48 -0
- package/dist/admin.cjs +15 -0
- package/dist/admin.cjs.map +1 -0
- package/dist/admin.d.cts +62 -0
- package/dist/airaccount.cjs +452 -0
- package/dist/airaccount.cjs.map +1 -0
- package/dist/airaccount.d.cts +4 -0
- package/dist/channel-CkRRbzT8.d.cts +77 -0
- package/dist/channel.cjs +27 -0
- package/dist/channel.cjs.map +1 -0
- package/dist/channel.d.cts +64 -0
- package/dist/chunk-2RCJBWPO.cjs +1168 -0
- package/dist/chunk-2RCJBWPO.cjs.map +1 -0
- package/dist/chunk-FTJD2DWE.cjs +42472 -0
- package/dist/chunk-FTJD2DWE.cjs.map +1 -0
- package/dist/chunk-GRDC6ZRA.cjs +118 -0
- package/dist/chunk-GRDC6ZRA.cjs.map +1 -0
- package/dist/chunk-GX7NROST.cjs +421 -0
- package/dist/chunk-GX7NROST.cjs.map +1 -0
- package/dist/chunk-HSVQIFIK.cjs +128 -0
- package/dist/chunk-HSVQIFIK.cjs.map +1 -0
- package/dist/chunk-JTWY2XEG.cjs +115 -0
- package/dist/chunk-JTWY2XEG.cjs.map +1 -0
- package/dist/chunk-MRREGCWN.cjs +585 -0
- package/dist/chunk-MRREGCWN.cjs.map +1 -0
- package/dist/chunk-NT26BDGN.cjs +228 -0
- package/dist/chunk-NT26BDGN.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/chunk-QLF7N6H7.cjs +448 -0
- package/dist/chunk-QLF7N6H7.cjs.map +1 -0
- package/dist/chunk-RNHSA3LO.cjs +108 -0
- package/dist/chunk-RNHSA3LO.cjs.map +1 -0
- package/dist/chunk-S5IKOOUR.cjs +393 -0
- package/dist/chunk-S5IKOOUR.cjs.map +1 -0
- package/dist/chunk-TFLZETWB.cjs +4693 -0
- package/dist/chunk-TFLZETWB.cjs.map +1 -0
- package/dist/chunk-WQREDGUF.cjs +435 -0
- package/dist/chunk-WQREDGUF.cjs.map +1 -0
- package/dist/chunk-XQROKLZI.cjs +4521 -0
- package/dist/chunk-XQROKLZI.cjs.map +1 -0
- package/dist/contract-addresses-TANQ5DLX.cjs +49 -0
- package/dist/contract-addresses-TANQ5DLX.cjs.map +1 -0
- package/dist/core.cjs +894 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +6930 -0
- package/dist/dapp.cjs +289 -0
- package/dist/dapp.cjs.map +1 -0
- package/dist/dapp.d.cts +127 -0
- package/dist/doc-types-471vSmPO.d.cts +16 -0
- package/dist/enduser.cjs +24 -0
- package/dist/enduser.cjs.map +1 -0
- package/dist/enduser.d.cts +261 -0
- package/dist/identity.cjs +23 -0
- package/dist/identity.cjs.map +1 -0
- package/dist/identity.d.cts +81 -0
- package/dist/index-B6SfEQxo.d.cts +47 -0
- package/dist/index.cjs +2814 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +656 -0
- package/dist/kms.cjs +452 -0
- package/dist/kms.cjs.map +1 -0
- package/dist/kms.d.cts +3054 -0
- package/dist/lib-FE4GR7TO.cjs +1865 -0
- package/dist/lib-FE4GR7TO.cjs.map +1 -0
- package/dist/operator.cjs +27 -0
- package/dist/operator.cjs.map +1 -0
- package/dist/operator.d.cts +164 -0
- package/dist/paymaster.cjs +63 -0
- package/dist/paymaster.cjs.map +1 -0
- package/dist/paymaster.d.cts +312 -0
- package/dist/src-ENPA7D2S.cjs +63 -0
- package/dist/src-ENPA7D2S.cjs.map +1 -0
- package/dist/src-TQKEO2I4.cjs +894 -0
- package/dist/src-TQKEO2I4.cjs.map +1 -0
- package/dist/tier-router-DeeVg69O.d.cts +370 -0
- package/dist/tokens.cjs +15 -0
- package/dist/tokens.cjs.map +1 -0
- package/dist/tokens.d.cts +64 -0
- package/dist/x402.cjs +103 -0
- package/dist/x402.cjs.map +1 -0
- package/dist/x402.d.cts +373 -0
- package/package.json +32 -32
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Address, Account } from 'viem';
|
|
2
|
+
import { W as WalletClient, P as PublicClient } from './doc-types-471vSmPO.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base configuration for all L2 Business Clients
|
|
6
|
+
*/
|
|
7
|
+
interface ClientConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Viem WalletClient for write operations.
|
|
10
|
+
* Must have an account attached.
|
|
11
|
+
*/
|
|
12
|
+
client: WalletClient;
|
|
13
|
+
/**
|
|
14
|
+
* Optional PublicClient for read operations.
|
|
15
|
+
* If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better).
|
|
16
|
+
* Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider.
|
|
17
|
+
* However, explicitly accepting PublicClient encourages separation.
|
|
18
|
+
*/
|
|
19
|
+
publicClient?: PublicClient;
|
|
20
|
+
/**
|
|
21
|
+
* Registry contract address.
|
|
22
|
+
* Essential for looking up other contracts if not provided explicitly.
|
|
23
|
+
*/
|
|
24
|
+
registryAddress?: Address;
|
|
25
|
+
/**
|
|
26
|
+
* GToken contract address.
|
|
27
|
+
* Required for operations involving token approvals and transfers.
|
|
28
|
+
*/
|
|
29
|
+
gTokenAddress?: Address;
|
|
30
|
+
/**
|
|
31
|
+
* GTokenStaking contract address.
|
|
32
|
+
* Required for role registration that involves staking.
|
|
33
|
+
*/
|
|
34
|
+
gTokenStakingAddress?: Address;
|
|
35
|
+
/**
|
|
36
|
+
* PaymasterFactory contract address.
|
|
37
|
+
* Required for deploying new PaymasterV4 instances.
|
|
38
|
+
*/
|
|
39
|
+
paymasterFactoryAddress?: Address;
|
|
40
|
+
xpntsFactoryAddress?: Address;
|
|
41
|
+
ethUsdPriceFeedAddress?: Address;
|
|
42
|
+
entryPointAddress?: Address;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Common options for transaction methods
|
|
46
|
+
*/
|
|
47
|
+
interface TransactionOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Override the account to use for the transaction.
|
|
50
|
+
* If not provided, uses the account from the WalletClient.
|
|
51
|
+
*/
|
|
52
|
+
account?: Account | Address;
|
|
53
|
+
/**
|
|
54
|
+
* Optional value to send with the transaction (in wei)
|
|
55
|
+
*/
|
|
56
|
+
value?: bigint;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Generic result wrapper for business operations
|
|
60
|
+
* Currently just returns the type directly, but can be expanded for metadata.
|
|
61
|
+
*/
|
|
62
|
+
type BusinessResult<T> = Promise<T>;
|
|
63
|
+
|
|
64
|
+
declare abstract class BaseClient {
|
|
65
|
+
client: WalletClient;
|
|
66
|
+
publicClient?: PublicClient;
|
|
67
|
+
protected registryAddress?: Address;
|
|
68
|
+
protected gTokenAddress?: Address;
|
|
69
|
+
protected gTokenStakingAddress?: Address;
|
|
70
|
+
protected paymasterFactoryAddress?: Address;
|
|
71
|
+
protected entryPointAddress?: Address;
|
|
72
|
+
constructor(config: ClientConfig);
|
|
73
|
+
/**
|
|
74
|
+
* Get the account address of the connected wallet
|
|
75
|
+
*/
|
|
76
|
+
getAddress(): Address;
|
|
77
|
+
/**
|
|
78
|
+
* Helper to ensure public client exists or fallback to wallet client (if it supports read)
|
|
79
|
+
*/
|
|
80
|
+
getStartPublicClient(): PublicClient | WalletClient;
|
|
81
|
+
protected requireRegistry(): Address;
|
|
82
|
+
protected requireGToken(): Address;
|
|
83
|
+
protected requireGTokenStaking(): Address;
|
|
84
|
+
protected requirePaymasterFactory(): Address;
|
|
85
|
+
protected requireEntryPoint(): Address;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { type BusinessResult as B, type ClientConfig as C, type TransactionOptions as T, BaseClient as a };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkGX7NROST_cjs = require('./chunk-GX7NROST.cjs');
|
|
4
|
+
require('./chunk-FTJD2DWE.cjs');
|
|
5
|
+
require('./chunk-S5IKOOUR.cjs');
|
|
6
|
+
require('./chunk-Q7SFCCGT.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "UserClient", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkGX7NROST_cjs.UserClient; }
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=UserClient-2J6XMTNV.cjs.map
|
|
15
|
+
//# sourceMappingURL=UserClient-2J6XMTNV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"UserClient-2J6XMTNV.cjs"}
|
package/dist/account.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHSVQIFIK_cjs = require('./chunk-HSVQIFIK.cjs');
|
|
4
|
+
require('./chunk-FTJD2DWE.cjs');
|
|
5
|
+
require('./chunk-S5IKOOUR.cjs');
|
|
6
|
+
require('./chunk-Q7SFCCGT.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "UserOpClient", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkHSVQIFIK_cjs.UserOpClient; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "createEOAWalletClient", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkHSVQIFIK_cjs.createEOAWalletClient; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getUserOpHash", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkHSVQIFIK_cjs.getUserOpHash; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "packUserOpLimits", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkHSVQIFIK_cjs.packUserOpLimits; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "toSimpleSmartAccount", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkHSVQIFIK_cjs.toSimpleSmartAccount; }
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=account.cjs.map
|
|
31
|
+
//# sourceMappingURL=account.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"account.cjs"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { WalletClient, Address, Hex, Hash, Chain, Transport, LocalAccount } from 'viem';
|
|
2
|
+
|
|
3
|
+
type EOAWalletClient = WalletClient & {
|
|
4
|
+
sendTransaction: (args: {
|
|
5
|
+
to: Address;
|
|
6
|
+
value?: bigint;
|
|
7
|
+
data?: Hex;
|
|
8
|
+
}) => Promise<Hash>;
|
|
9
|
+
getAddress: () => Address;
|
|
10
|
+
};
|
|
11
|
+
declare const createEOAWalletClient: (privateKey: Hex, chain: Chain, transport?: Transport) => EOAWalletClient;
|
|
12
|
+
|
|
13
|
+
type SimpleSmartAccount = LocalAccount & {
|
|
14
|
+
signUserOperation: (userOp: any) => Promise<Hex>;
|
|
15
|
+
getInitCode: () => Promise<Hex>;
|
|
16
|
+
getDummySignature: () => Promise<Hex>;
|
|
17
|
+
entryPoint: Address;
|
|
18
|
+
};
|
|
19
|
+
declare function toSimpleSmartAccount(parameters: {
|
|
20
|
+
client: any;
|
|
21
|
+
owner: LocalAccount;
|
|
22
|
+
factoryAddress: Address;
|
|
23
|
+
entryPoint: {
|
|
24
|
+
address: Address;
|
|
25
|
+
version: '0.6' | '0.7';
|
|
26
|
+
};
|
|
27
|
+
salt?: bigint;
|
|
28
|
+
index?: bigint;
|
|
29
|
+
}): Promise<SimpleSmartAccount>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Common Pack Logic for v0.7 UserOperations
|
|
33
|
+
*/
|
|
34
|
+
declare function packUserOpLimits(high: bigint, low: bigint): Hex;
|
|
35
|
+
/**
|
|
36
|
+
* Local implementation of EntryPoint v0.7 getUserOpHash
|
|
37
|
+
*/
|
|
38
|
+
declare function getUserOpHash(op: any, ep: Address, chainId: number): Hex;
|
|
39
|
+
/**
|
|
40
|
+
* UserOperation Client for handling high-level flows
|
|
41
|
+
*/
|
|
42
|
+
declare class UserOpClient {
|
|
43
|
+
static estimateGas(bundler: any, op: any, entryPoint: Address): Promise<any>;
|
|
44
|
+
static sendUserOp(bundler: any, op: any, entryPoint: Address): Promise<any>;
|
|
45
|
+
static getReceipt(bundler: any, hash: Hex): Promise<any>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { type EOAWalletClient, type SimpleSmartAccount, UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount };
|
package/dist/admin.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkRNHSA3LO_cjs = require('./chunk-RNHSA3LO.cjs');
|
|
4
|
+
require('./chunk-FTJD2DWE.cjs');
|
|
5
|
+
require('./chunk-S5IKOOUR.cjs');
|
|
6
|
+
require('./chunk-Q7SFCCGT.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "ProtocolGovernance", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkRNHSA3LO_cjs.ProtocolGovernance; }
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=admin.cjs.map
|
|
15
|
+
//# sourceMappingURL=admin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"admin.cjs"}
|
package/dist/admin.d.cts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Address, Hash, Hex } from 'viem';
|
|
2
|
+
import { a as BaseClient, C as ClientConfig, T as TransactionOptions } from './BaseClient-CkBhQ1ou.cjs';
|
|
3
|
+
import './doc-types-471vSmPO.cjs';
|
|
4
|
+
|
|
5
|
+
interface ProtocolParams {
|
|
6
|
+
minStake: bigint;
|
|
7
|
+
treasury: Address;
|
|
8
|
+
entryPoint: Address;
|
|
9
|
+
superPaymaster: Address;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ProtocolGovernance - L3 Pattern
|
|
13
|
+
*
|
|
14
|
+
* Responsibilities:
|
|
15
|
+
* 1. Global Protocol Parameter Management (Registry, EntryPoint)
|
|
16
|
+
* 2. High-level Governance Operations (DAO Transfer, Upgrades)
|
|
17
|
+
* 3. SuperPaymaster & Module Approval
|
|
18
|
+
*/
|
|
19
|
+
declare class ProtocolGovernance extends BaseClient {
|
|
20
|
+
registryAddress: Address;
|
|
21
|
+
entryPointAddress: Address;
|
|
22
|
+
constructor(config: ClientConfig & {
|
|
23
|
+
registryAddress: Address;
|
|
24
|
+
entryPointAddress: Address;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Update the Global Treasury Address where protocol fees are collected
|
|
28
|
+
*/
|
|
29
|
+
setTreasury(treasury: Address, options?: TransactionOptions): Promise<Hash>;
|
|
30
|
+
/**
|
|
31
|
+
* Update the supported EntryPoint address
|
|
32
|
+
*/
|
|
33
|
+
updateEntryPoint(entryPoint: Address, options?: TransactionOptions): Promise<Hash>;
|
|
34
|
+
/**
|
|
35
|
+
* Approve a new SuperPaymaster contract address
|
|
36
|
+
*/
|
|
37
|
+
setSuperPaymaster(paymaster: Address, options?: TransactionOptions): Promise<Hash>;
|
|
38
|
+
/**
|
|
39
|
+
* Set the Staking contract address
|
|
40
|
+
*/
|
|
41
|
+
setStaking(staking: Address, options?: TransactionOptions): Promise<Hash>;
|
|
42
|
+
/**
|
|
43
|
+
* Configure a Role's parameters (Admin only).
|
|
44
|
+
* Reads the current on-chain config first, then merges the provided overrides
|
|
45
|
+
* and writes back the full struct via configureRole.
|
|
46
|
+
*/
|
|
47
|
+
configureRole(params: {
|
|
48
|
+
roleId: Hex;
|
|
49
|
+
minStake?: bigint;
|
|
50
|
+
ticketPrice?: bigint;
|
|
51
|
+
exitFeePercent?: bigint;
|
|
52
|
+
minExitFee?: bigint;
|
|
53
|
+
}, options?: TransactionOptions): Promise<Hash>;
|
|
54
|
+
/**
|
|
55
|
+
* Transfer Protocol Ownership to a DAO (Multisig/Timelock)
|
|
56
|
+
* This is the final step of "Protocol Admin" lifecycle.
|
|
57
|
+
*/
|
|
58
|
+
transferToDAO(daoAddress: Address, options?: TransactionOptions): Promise<Hash>;
|
|
59
|
+
getProtocolParams(): Promise<ProtocolParams>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { ProtocolGovernance, type ProtocolParams };
|