@aastar/sdk 0.14.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 AAStar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ import { type Client, type Transport, type Chain, type Account, type PublicActions, type WalletActions, type Address } from 'viem';
2
+ import { type RegistryActions, type SuperPaymasterActions, type PaymasterV4Actions, type StakingActions, type SBTActions, type DVTActions, type FactoryActions, type AggregatorActions } from '@aastar/core';
3
+ export type AdminClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SuperPaymasterActions & PaymasterV4Actions & StakingActions & SBTActions & DVTActions & FactoryActions & AggregatorActions;
4
+ export declare function createAdminClient({ chain, transport, account, addresses }: {
5
+ chain: Chain;
6
+ transport: Transport;
7
+ account?: Account;
8
+ addresses?: {
9
+ [key: string]: Address;
10
+ };
11
+ }): AdminClient;
12
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAgC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/K,OAAO,EASH,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAGzB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,eAAe,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAE1T,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACZ,EAAE;IACC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CACzC,GAAG,WAAW,CAmBd"}
@@ -0,0 +1,20 @@
1
+ import { createClient, publicActions, walletActions } from 'viem';
2
+ import { registryActions, superPaymasterActions, paymasterV4Actions, stakingActions, sbtActions, dvtActions, factoryActions, aggregatorActions, CORE_ADDRESSES, TOKEN_ADDRESSES } from '@aastar/core';
3
+ export function createAdminClient({ chain, transport, account, addresses }) {
4
+ const baseClient = createClient({ chain, transport, account })
5
+ .extend(publicActions)
6
+ .extend(walletActions);
7
+ const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...addresses };
8
+ const actions = {
9
+ ...registryActions(usedAddresses.registry)(baseClient),
10
+ ...superPaymasterActions(usedAddresses.superPaymaster)(baseClient),
11
+ ...paymasterV4Actions()(baseClient),
12
+ ...stakingActions(usedAddresses.gTokenStaking)(baseClient),
13
+ ...sbtActions(usedAddresses.mySBT)(baseClient),
14
+ ...dvtActions()(baseClient),
15
+ ...factoryActions()(baseClient),
16
+ ...aggregatorActions()(baseClient),
17
+ };
18
+ return Object.assign(baseClient, actions);
19
+ }
20
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyD,aAAa,EAAE,aAAa,EAAwD,MAAM,MAAM,CAAC;AAC/K,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,EASjB,cAAc,EACd,eAAe,EAClB,MAAM,cAAc,CAAC;AAItB,MAAM,UAAU,iBAAiB,CAAC,EAC9B,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EAMZ;IACG,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;SACzD,MAAM,CAAC,aAAa,CAAC;SACrB,MAAM,CAAC,aAAa,CAAC,CAAC;IAE3B,MAAM,aAAa,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,EAAE,CAAC;IAE9E,MAAM,OAAO,GAAG;QACZ,GAAG,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,UAAiB,CAAC;QAC7D,GAAG,qBAAqB,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,UAAiB,CAAC;QACzE,GAAG,kBAAkB,EAAE,CAAC,UAAiB,CAAC;QAC1C,GAAG,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,UAAiB,CAAC;QACjE,GAAG,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,UAAiB,CAAC;QACrD,GAAG,UAAU,EAAE,CAAC,UAAiB,CAAC;QAClC,GAAG,cAAc,EAAE,CAAC,UAAiB,CAAC;QACtC,GAAG,iBAAiB,EAAE,CAAC,UAAiB,CAAC;KAC5C,CAAC;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAgB,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Client, type Transport, type Chain, type Account, type PublicActions, type WalletActions, type Address } from 'viem';
2
+ import { type RegistryActions, type SBTActions } from '@aastar/core';
3
+ export type CommunityClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SBTActions;
4
+ export declare function createCommunityClient({ chain, transport, account, addresses }: {
5
+ chain: Chain;
6
+ transport: Transport;
7
+ account?: Account;
8
+ addresses?: {
9
+ [key: string]: Address;
10
+ };
11
+ }): CommunityClient;
12
+ //# sourceMappingURL=community.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src/clients/community.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAgC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/K,OAAO,EAGH,KAAK,eAAe,EACpB,KAAK,UAAU,EAGlB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,eAAe,GAAG,UAAU,CAAC;AAE9M,wBAAgB,qBAAqB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACZ,EAAE;IACC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CACzC,GAAG,eAAe,CAiBlB"}
@@ -0,0 +1,18 @@
1
+ import { createClient, publicActions, walletActions } from 'viem';
2
+ import { registryActions, sbtActions, CORE_ADDRESSES, TOKEN_ADDRESSES } from '@aastar/core';
3
+ export function createCommunityClient({ chain, transport, account, addresses }) {
4
+ const client = createClient({
5
+ chain,
6
+ transport,
7
+ account
8
+ })
9
+ .extend(publicActions)
10
+ .extend(walletActions);
11
+ const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...addresses };
12
+ const actions = {
13
+ ...registryActions(usedAddresses.registry)(client),
14
+ ...sbtActions(usedAddresses.mySBT)(client),
15
+ };
16
+ return Object.assign(client, actions);
17
+ }
18
+ //# sourceMappingURL=community.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.js","sourceRoot":"","sources":["../../src/clients/community.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyD,aAAa,EAAE,aAAa,EAAwD,MAAM,MAAM,CAAC;AAC/K,OAAO,EACH,eAAe,EACf,UAAU,EAGV,cAAc,EACd,eAAe,EAClB,MAAM,cAAc,CAAC;AAItB,MAAM,UAAU,qBAAqB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EAMZ;IACG,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,KAAK;QACL,SAAS;QACT,OAAO;KACV,CAAC;SACD,MAAM,CAAC,aAAa,CAAC;SACrB,MAAM,CAAC,aAAa,CAAC,CAAC;IAEvB,MAAM,aAAa,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,EAAE,CAAC;IAE9E,MAAM,OAAO,GAAG;QACZ,GAAG,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,MAAa,CAAC;QACzD,GAAG,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,MAAa,CAAC;KACpD,CAAC;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAoB,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Client, type Transport, type Chain, type Account, type PublicActions, type WalletActions, type Address } from 'viem';
2
+ import { type RegistryActions, type SBTActions, type SuperPaymasterActions, type PaymasterV4Actions } from '@aastar/core';
3
+ export type EndUserClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SBTActions & SuperPaymasterActions & PaymasterV4Actions;
4
+ export declare function createEndUserClient({ chain, transport, account, addresses }: {
5
+ chain: Chain;
6
+ transport: Transport;
7
+ account?: Account;
8
+ addresses?: {
9
+ [key: string]: Address;
10
+ };
11
+ }): EndUserClient;
12
+ //# sourceMappingURL=endUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endUser.d.ts","sourceRoot":"","sources":["../../src/clients/endUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAgC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/K,OAAO,EAKH,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAG1B,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,eAAe,GAAG,UAAU,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEzP,wBAAgB,mBAAmB,CAAC,EAChC,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACZ,EAAE;IACC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CACzC,GAAG,aAAa,CAmBhB"}
@@ -0,0 +1,20 @@
1
+ import { createClient, publicActions, walletActions } from 'viem';
2
+ import { registryActions, sbtActions, superPaymasterActions, paymasterV4Actions, CORE_ADDRESSES, TOKEN_ADDRESSES } from '@aastar/core';
3
+ export function createEndUserClient({ chain, transport, account, addresses }) {
4
+ const client = createClient({
5
+ chain,
6
+ transport,
7
+ account
8
+ })
9
+ .extend(publicActions)
10
+ .extend(walletActions);
11
+ const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...addresses };
12
+ const actions = {
13
+ ...registryActions(usedAddresses.registry)(client),
14
+ ...sbtActions(usedAddresses.mySBT)(client),
15
+ ...superPaymasterActions(usedAddresses.superPaymaster)(client),
16
+ ...paymasterV4Actions()(client)
17
+ };
18
+ return Object.assign(client, actions);
19
+ }
20
+ //# sourceMappingURL=endUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endUser.js","sourceRoot":"","sources":["../../src/clients/endUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyD,aAAa,EAAE,aAAa,EAAwD,MAAM,MAAM,CAAC;AAC/K,OAAO,EACH,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAKlB,cAAc,EACd,eAAe,EAClB,MAAM,cAAc,CAAC;AAItB,MAAM,UAAU,mBAAmB,CAAC,EAChC,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EAMZ;IACG,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,KAAK;QACL,SAAS;QACT,OAAO;KACV,CAAC;SACD,MAAM,CAAC,aAAa,CAAC;SACrB,MAAM,CAAC,aAAa,CAAC,CAAC;IAEvB,MAAM,aAAa,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,EAAE,CAAC;IAE9E,MAAM,OAAO,GAAG;QACZ,GAAG,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,MAAa,CAAC;QACzD,GAAG,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,MAAa,CAAC;QACjD,GAAG,qBAAqB,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,MAAa,CAAC;QACrE,GAAG,kBAAkB,EAAE,CAAC,MAAa,CAAC;KACzC,CAAC;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAkB,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type Client, type Transport, type Chain, type Account, type Hash, type Hex, type PublicActions, type WalletActions, type Address } from 'viem';
2
+ import { type StakingActions, type RegistryActions, type SuperPaymasterActions, type PaymasterV4Actions } from '@aastar/core';
3
+ export type OperatorClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & StakingActions & SuperPaymasterActions & PaymasterV4Actions & RegistryActions & {
4
+ onboardToSuperPaymaster: (args: {
5
+ stakeAmount: bigint;
6
+ depositAmount: bigint;
7
+ roleId: Hex;
8
+ }) => Promise<Hash[]>;
9
+ };
10
+ export declare function createOperatorClient({ chain, transport, account, addresses }: {
11
+ chain: Chain;
12
+ transport: Transport;
13
+ account?: Account;
14
+ addresses?: {
15
+ [key: string]: Address;
16
+ };
17
+ }): OperatorClient;
18
+ //# sourceMappingURL=operator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/clients/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,GAAG,EAA0C,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9M,OAAO,EAKH,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAG1B,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,cAAc,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,eAAe,GAAG;IAC5P,uBAAuB,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;CAClH,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACZ,EAAE;IACC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CACzC,GAAG,cAAc,CAsEjB"}
@@ -0,0 +1,65 @@
1
+ import { createClient, erc20Abi, publicActions, walletActions } from 'viem';
2
+ import { stakingActions, registryActions, superPaymasterActions, paymasterV4Actions, CORE_ADDRESSES, TEST_TOKEN_ADDRESSES } from '@aastar/core';
3
+ export function createOperatorClient({ chain, transport, account, addresses }) {
4
+ const client = createClient({
5
+ chain,
6
+ transport,
7
+ account
8
+ })
9
+ .extend(publicActions)
10
+ .extend(walletActions);
11
+ const usedAddresses = { ...CORE_ADDRESSES, ...TEST_TOKEN_ADDRESSES, ...addresses };
12
+ const actions = {
13
+ ...stakingActions(usedAddresses.gTokenStaking)(client),
14
+ ...superPaymasterActions(usedAddresses.superPaymaster)(client),
15
+ ...paymasterV4Actions()(client),
16
+ ...registryActions(usedAddresses.registry)(client),
17
+ };
18
+ return Object.assign(client, actions, {
19
+ async onboardToSuperPaymaster({ stakeAmount, depositAmount, roleId }) {
20
+ const txs = [];
21
+ // 1. Approve GToken needed for staking
22
+ const approveGToken = await client.writeContract({
23
+ address: usedAddresses.gToken,
24
+ abi: erc20Abi,
25
+ functionName: 'approve',
26
+ args: [usedAddresses.gTokenStaking, stakeAmount],
27
+ account,
28
+ chain
29
+ });
30
+ await client.waitForTransactionReceipt({ hash: approveGToken });
31
+ txs.push(approveGToken);
32
+ // ... (rest uses actions which capture usedAddresses)
33
+ // But we need to update steps 2 and 3 and 4 to use usedAddresses too if they use raw calls?
34
+ // Step 2 is actions.lockStake.
35
+ // Step 3 is approve APNTs.
36
+ // 2. Register Role (locks stake)
37
+ const registerTx = await actions.registerRoleSelf({
38
+ roleId,
39
+ data: '0x',
40
+ account: account
41
+ });
42
+ await client.waitForTransactionReceipt({ hash: registerTx });
43
+ txs.push(registerTx);
44
+ // 3. Approve APNTs needed for deposit
45
+ const approveAPNTs = await client.writeContract({
46
+ address: usedAddresses.aPNTs,
47
+ abi: erc20Abi,
48
+ functionName: 'approve',
49
+ args: [usedAddresses.superPaymaster, depositAmount],
50
+ account,
51
+ chain
52
+ });
53
+ await client.waitForTransactionReceipt({ hash: approveAPNTs });
54
+ txs.push(approveAPNTs);
55
+ // 4. Deposit APNTs
56
+ const depositTx = await actions.depositAPNTs({
57
+ amount: depositAmount,
58
+ account: account
59
+ });
60
+ txs.push(depositTx);
61
+ return txs;
62
+ }
63
+ });
64
+ }
65
+ //# sourceMappingURL=operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/clients/operator.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ export * from '@aastar/core';
2
+ export * from '@aastar/account';
3
+ export * from '@aastar/paymaster';
4
+ export * from '@aastar/identity';
5
+ export * from '@aastar/tokens';
6
+ export * from '@aastar/dapp';
7
+ export * from './clients/endUser.js';
8
+ export * from './clients/operator.js';
9
+ export * from './clients/community.js';
10
+ export * from './clients/admin.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAG7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ export * from '@aastar/core';
2
+ export * from '@aastar/account';
3
+ export * from '@aastar/paymaster';
4
+ export * from '@aastar/identity';
5
+ export * from '@aastar/tokens';
6
+ export * from '@aastar/dapp';
7
+ // Export Role-Based Clients
8
+ export * from './clients/endUser.js';
9
+ export * from './clients/operator.js';
10
+ export * from './clients/community.js';
11
+ export * from './clients/admin.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAE7B,4BAA4B;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@aastar/sdk",
3
+ "version": "0.14.0",
4
+ "description": "AAStar SDK - The all-in-one package for Mycelium Network",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "dependencies": {
15
+ "viem": "2.43.3",
16
+ "@aastar/account": "0.12.0",
17
+ "@aastar/core": "0.12.0",
18
+ "@aastar/dapp": "0.12.0",
19
+ "@aastar/identity": "0.12.0",
20
+ "@aastar/paymaster": "0.12.0",
21
+ "@aastar/tokens": "0.12.0"
22
+ },
23
+ "devDependencies": {
24
+ "typescript": "5.9.3"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc",
28
+ "example:local": "tsx examples/regression_test.ts"
29
+ }
30
+ }