@aastar/sdk 0.20.1 → 0.20.3
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/README.md +115 -35
- package/dist/UserClient-JMNNZT4P.js +6 -0
- package/dist/{UserClient-YUHCJJJL.js.map → UserClient-JMNNZT4P.js.map} +1 -1
- package/dist/account.js +3 -3
- package/dist/admin.js +3 -3
- package/dist/channel.js +3 -3
- package/dist/{chunk-4DVUM4MC.js → chunk-5TDDS3T5.js} +3 -3
- package/dist/{chunk-4DVUM4MC.js.map → chunk-5TDDS3T5.js.map} +1 -1
- package/dist/{chunk-O3Y7II3B.js → chunk-KL6SCEIU.js} +4 -4
- package/dist/{chunk-O3Y7II3B.js.map → chunk-KL6SCEIU.js.map} +1 -1
- package/dist/{chunk-DI3E6PMI.js → chunk-LNICTATJ.js} +6 -6
- package/dist/{chunk-DI3E6PMI.js.map → chunk-LNICTATJ.js.map} +1 -1
- package/dist/{chunk-PCLPYRTX.js → chunk-M5ORP2PM.js} +8 -8
- package/dist/{chunk-PCLPYRTX.js.map → chunk-M5ORP2PM.js.map} +1 -1
- package/dist/{chunk-MPOMWT2J.js → chunk-NAPMVAVJ.js} +3 -3
- package/dist/{chunk-MPOMWT2J.js.map → chunk-NAPMVAVJ.js.map} +1 -1
- package/dist/{chunk-NZGXB2C5.js → chunk-O454V5ML.js} +3 -3
- package/dist/{chunk-NZGXB2C5.js.map → chunk-O454V5ML.js.map} +1 -1
- package/dist/{chunk-XFI3AK32.js → chunk-QNYP7RPI.js} +3 -3
- package/dist/{chunk-XFI3AK32.js.map → chunk-QNYP7RPI.js.map} +1 -1
- package/dist/{chunk-YHM77LIP.js → chunk-R2RATIK2.js} +9 -9
- package/dist/{chunk-YHM77LIP.js.map → chunk-R2RATIK2.js.map} +1 -1
- package/dist/{chunk-ZSSNU3UF.js → chunk-TBDMSJVL.js} +12 -12
- package/dist/{chunk-ZSSNU3UF.js.map → chunk-TBDMSJVL.js.map} +1 -1
- package/dist/{chunk-OSPRJZ5T.js → chunk-Y3KP7R2Y.js} +3 -3
- package/dist/{chunk-OSPRJZ5T.js.map → chunk-Y3KP7R2Y.js.map} +1 -1
- package/dist/{chunk-HVAB4TTT.js → chunk-YSDWB6DO.js} +3 -3
- package/dist/{chunk-HVAB4TTT.js.map → chunk-YSDWB6DO.js.map} +1 -1
- package/dist/{chunk-DSZ372PH.js → chunk-ZJLIKMCA.js} +20 -3
- package/dist/chunk-ZJLIKMCA.js.map +1 -0
- package/dist/{contract-addresses-JE3X6DFY.js → contract-addresses-VLAHHXOO.js} +3 -3
- package/dist/{contract-addresses-JE3X6DFY.js.map → contract-addresses-VLAHHXOO.js.map} +1 -1
- package/dist/core.js +2 -2
- package/dist/dapp.js +280 -4
- package/dist/dapp.js.map +1 -1
- package/dist/{dist-GHTBO7CD.js → dist-WMYQOYRO.js} +5 -5
- package/dist/{dist-GHTBO7CD.js.map → dist-WMYQOYRO.js.map} +1 -1
- package/dist/enduser.js +4 -4
- package/dist/identity.js +3 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +45 -24
- package/dist/index.js.map +1 -1
- package/dist/{index.node-55LOPHNQ.js → index.node-GNYPFVZQ.js} +4 -4
- package/dist/{index.node-55LOPHNQ.js.map → index.node-GNYPFVZQ.js.map} +1 -1
- package/dist/operator.js +3 -3
- package/dist/paymaster.js +3 -3
- package/dist/tokens.js +3 -3
- package/dist/x402.js +3 -3
- package/package.json +33 -8
- package/dist/UserClient-YUHCJJJL.js +0 -6
- package/dist/chunk-6JCYPTSH.js +0 -281
- package/dist/chunk-6JCYPTSH.js.map +0 -1
- package/dist/chunk-DSZ372PH.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"dist-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"dist-WMYQOYRO.js"}
|
package/dist/enduser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { CommunityClient, UserLifecycle } from './chunk-
|
|
2
|
-
export { UserClient } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { CommunityClient, UserLifecycle } from './chunk-R2RATIK2.js';
|
|
2
|
+
export { UserClient } from './chunk-LNICTATJ.js';
|
|
3
|
+
import './chunk-TBDMSJVL.js';
|
|
4
|
+
import './chunk-ZJLIKMCA.js';
|
|
5
5
|
import './chunk-PZ5AY32C.js';
|
|
6
6
|
//# sourceMappingURL=enduser.js.map
|
|
7
7
|
//# sourceMappingURL=enduser.js.map
|
package/dist/identity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ReputationClient, checkMySBT, getMySBTId } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { ReputationClient, checkMySBT, getMySBTId } from './chunk-O454V5ML.js';
|
|
2
|
+
import './chunk-TBDMSJVL.js';
|
|
3
|
+
import './chunk-ZJLIKMCA.js';
|
|
4
4
|
import './chunk-PZ5AY32C.js';
|
|
5
5
|
//# sourceMappingURL=identity.js.map
|
|
6
6
|
//# sourceMappingURL=identity.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from '@aastar/account';
|
|
|
4
4
|
export * from '@aastar/paymaster';
|
|
5
5
|
export * from '@aastar/identity';
|
|
6
6
|
export * from '@aastar/tokens';
|
|
7
|
-
export * from '@aastar/dapp';
|
|
8
7
|
export * from '@aastar/x402';
|
|
9
8
|
export * from '@aastar/channel';
|
|
10
9
|
import { Client, Transport, Chain, Account, PublicActions, WalletActions, Address, Hex, Hash, PublicClient } from 'viem';
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
export { ChannelClient, VOUCHER_TYPES, getVoucherDomain, signVoucher } from './chunk-
|
|
2
|
-
export { CommunityClient, UserLifecycle } from './chunk-
|
|
3
|
-
export { UserClient } from './chunk-
|
|
4
|
-
export { OperatorLifecycle, PaymasterOperatorClient, ProposalState, ProtocolClient } from './chunk-
|
|
5
|
-
export { ProtocolGovernance } from './chunk-
|
|
1
|
+
export { ChannelClient, VOUCHER_TYPES, getVoucherDomain, signVoucher } from './chunk-Y3KP7R2Y.js';
|
|
2
|
+
export { CommunityClient, UserLifecycle } from './chunk-R2RATIK2.js';
|
|
3
|
+
export { UserClient } from './chunk-LNICTATJ.js';
|
|
4
|
+
export { OperatorLifecycle, PaymasterOperatorClient, ProposalState, ProtocolClient } from './chunk-KL6SCEIU.js';
|
|
5
|
+
export { ProtocolGovernance } from './chunk-5TDDS3T5.js';
|
|
6
6
|
export { dist_exports as AirAccount } from './chunk-4KRQXOTI.js';
|
|
7
|
-
export { UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount } from './chunk-
|
|
8
|
-
export { ReputationClient, checkMySBT, getMySBTId } from './chunk-
|
|
9
|
-
export { FinanceClient } from './chunk-
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { AGENT_IDENTITY_REGISTRY_ADDRESS, AGENT_REPUTATION_REGISTRY_ADDRESS, ALL_ADDRESSES, APNTS_ADDRESS, BLS_AGGREGATOR_ADDRESS, BLS_VALIDATOR_ADDRESS, BPS_DENOMINATOR, 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 } from './chunk-DSZ372PH.js';
|
|
7
|
+
export { UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount } from './chunk-YSDWB6DO.js';
|
|
8
|
+
export { ReputationClient, checkMySBT, getMySBTId } from './chunk-O454V5ML.js';
|
|
9
|
+
export { FinanceClient } from './chunk-M5ORP2PM.js';
|
|
10
|
+
export { PaymasterClient, PaymasterManager, PaymasterOperator, SuperPaymasterAdminClient, SuperPaymasterClient, buildPaymasterData, buildSuperPaymasterData, checkEligibility, formatUserOpV07, getPaymasterV4Middleware, getSuperPaymasterMiddleware, getUserOpHashV07, tuneGasLimit } from './chunk-NAPMVAVJ.js';
|
|
11
|
+
export { EIP3009_TYPES, FacilitatorClient, GTOKEN_EIP712_DOMAIN, HEADER_PAYMENT_REQUIRED, HEADER_PAYMENT_RESPONSE, HEADER_PAYMENT_SIGNATURE, HEADER_V1_PAYMENT, HEADER_V1_PAYMENT_RESPONSE, X402Client, decodePaymentPayload, decodePaymentRequired, decodeSettleResponse, encodePaymentPayload, encodePaymentRequired, encodeSettleResponse, extractPaymentRequired, extractSettleResponse, generateNonce, getEIP3009Domain, signCancelAuthorization, signGTokenTransferWithAuthorization, signReceiveWithAuthorization, signTransferWithAuthorization } from './chunk-QNYP7RPI.js';
|
|
12
|
+
import { paymasterActions, superPaymasterActions, sbtActions, registryActions, RegistryABI, stakingActions, aggregatorActions, xPNTsFactoryActions, dvtActions, SuperPaymasterABI, xPNTsTokenABI, PaymasterFactoryABI } from './chunk-TBDMSJVL.js';
|
|
13
|
+
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-TBDMSJVL.js';
|
|
14
|
+
import { getCanonicalAddresses, listSupportedChainIds, TEST_ACCOUNT_ADDRESSES, TOKEN_ADDRESSES, CORE_ADDRESSES, TEST_TOKEN_ADDRESSES } from './chunk-ZJLIKMCA.js';
|
|
15
|
+
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, getCanonicalAddresses, isSupportedChainId, listSupportedChainIds } from './chunk-ZJLIKMCA.js';
|
|
17
16
|
import './chunk-PZ5AY32C.js';
|
|
18
17
|
import { keccak256, stringToBytes, createClient, publicActions, walletActions, parseAbi, decodeAbiParameters, encodeAbiParameters, zeroAddress, decodeErrorResult, formatEther, http, createPublicClient, createWalletClient, parseEther, erc20Abi, concat, pad, parseAbiParameters, toBytes, encodeFunctionData } from 'viem';
|
|
19
18
|
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
|
|
@@ -30,9 +29,13 @@ function createEndUserClient({
|
|
|
30
29
|
transport,
|
|
31
30
|
account
|
|
32
31
|
}).extend(publicActions).extend(walletActions);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const chainDefaults = getCanonicalAddresses(chain.id);
|
|
33
|
+
if (!chainDefaults && !addresses) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`[createEndUserClient] No canonical addresses for chainId ${chain.id}. Pass \`addresses\` explicitly, or use a supported chain: ${listSupportedChainIds().join(", ")}.`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...TEST_ACCOUNT_ADDRESSES, ...chainDefaults, ...addresses };
|
|
36
39
|
const actions = {
|
|
37
40
|
...registryActions(usedAddresses.registry)(client),
|
|
38
41
|
...sbtActions(usedAddresses.mySBT)(client),
|
|
@@ -229,7 +232,7 @@ function createEndUserClient({
|
|
|
229
232
|
async checkJoinRequirements(address) {
|
|
230
233
|
const accountToUse = address || account?.address;
|
|
231
234
|
if (!accountToUse) throw new Error("Account address required for requirement check");
|
|
232
|
-
const { RequirementChecker: RequirementChecker2 } = await import('./index.node-
|
|
235
|
+
const { RequirementChecker: RequirementChecker2 } = await import('./index.node-GNYPFVZQ.js');
|
|
233
236
|
const checker = new RequirementChecker2(client, usedAddresses);
|
|
234
237
|
return await checker.checkRequirements({
|
|
235
238
|
address: accountToUse,
|
|
@@ -239,7 +242,7 @@ function createEndUserClient({
|
|
|
239
242
|
});
|
|
240
243
|
},
|
|
241
244
|
async createSmartAccount({ owner, salt = 0n }) {
|
|
242
|
-
const { SimpleAccountFactoryABI: SimpleAccountFactoryABI2 } = await import('./index.node-
|
|
245
|
+
const { SimpleAccountFactoryABI: SimpleAccountFactoryABI2 } = await import('./index.node-GNYPFVZQ.js');
|
|
243
246
|
const { encodeFunctionData: encodeFunctionData2, concat: concat2 } = await import('viem');
|
|
244
247
|
let factoryAddress = usedAddresses.simpleAccountFactory;
|
|
245
248
|
console.log(` SDK: Using SimpleAccountFactory: ${factoryAddress} (Owner: ${owner}, Salt: ${salt})`);
|
|
@@ -270,7 +273,7 @@ function createEndUserClient({
|
|
|
270
273
|
if (isDeployed) {
|
|
271
274
|
console.log(` \u2139\uFE0F Account ${accountAddress} already deployed.`);
|
|
272
275
|
} else {
|
|
273
|
-
const { SimpleAccountFactoryABI: SimpleAccountFactoryABI2 } = await import('./index.node-
|
|
276
|
+
const { SimpleAccountFactoryABI: SimpleAccountFactoryABI2 } = await import('./index.node-GNYPFVZQ.js');
|
|
274
277
|
let factoryAddress = usedAddresses.simpleAccountFactory;
|
|
275
278
|
if (!factoryAddress || factoryAddress === "0x0000000000000000000000000000000000000000") {
|
|
276
279
|
factoryAddress = "0x9406Cc6185a346906296840746125a0E44976454";
|
|
@@ -487,7 +490,13 @@ function createOperatorClient({
|
|
|
487
490
|
transport,
|
|
488
491
|
account
|
|
489
492
|
}).extend(publicActions).extend(walletActions);
|
|
490
|
-
const
|
|
493
|
+
const chainDefaults = getCanonicalAddresses(chain.id);
|
|
494
|
+
if (!chainDefaults && !addresses) {
|
|
495
|
+
throw new Error(
|
|
496
|
+
`[createOperatorClient] No canonical addresses for chainId ${chain.id}. Pass \`addresses\` explicitly, or use a supported chain: ${listSupportedChainIds().join(", ")}.`
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
const usedAddresses = { ...CORE_ADDRESSES, ...TEST_TOKEN_ADDRESSES, ...TEST_ACCOUNT_ADDRESSES, ...chainDefaults, ...addresses };
|
|
491
500
|
const spActions = superPaymasterActions(usedAddresses.superPaymaster)(client);
|
|
492
501
|
const regActions = registryActions(usedAddresses.registry)(client);
|
|
493
502
|
const stkActions = stakingActions(usedAddresses.gTokenStaking)(client);
|
|
@@ -696,7 +705,13 @@ function createCommunityClient({
|
|
|
696
705
|
transport,
|
|
697
706
|
account
|
|
698
707
|
}).extend(publicActions).extend(walletActions);
|
|
699
|
-
const
|
|
708
|
+
const chainDefaults = getCanonicalAddresses(chain.id);
|
|
709
|
+
if (!chainDefaults && !addresses) {
|
|
710
|
+
throw new Error(
|
|
711
|
+
`[createCommunityClient] No canonical addresses for chainId ${chain.id}. Pass \`addresses\` explicitly, or use a supported chain: ${listSupportedChainIds().join(", ")}.`
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
const usedAddresses = { ...CORE_ADDRESSES, ...TEST_TOKEN_ADDRESSES, ...chainDefaults, ...addresses };
|
|
700
715
|
const registryActionsObj = registryActions(usedAddresses.registry)(client);
|
|
701
716
|
const sbtActionsObj = sbtActions(usedAddresses.mySBT)(client);
|
|
702
717
|
const launch = async (args) => {
|
|
@@ -962,7 +977,13 @@ function createAdminClient({
|
|
|
962
977
|
addresses
|
|
963
978
|
}) {
|
|
964
979
|
const baseClient = createClient({ chain, transport, account }).extend(publicActions).extend(walletActions);
|
|
965
|
-
const
|
|
980
|
+
const chainDefaults = getCanonicalAddresses(chain.id);
|
|
981
|
+
if (!chainDefaults && !addresses) {
|
|
982
|
+
throw new Error(
|
|
983
|
+
`[createAdminClient] No canonical addresses for chainId ${chain.id}. Pass \`addresses\` explicitly, or use a supported chain: ${listSupportedChainIds().join(", ")}.`
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...chainDefaults, ...addresses };
|
|
966
987
|
const actions = {
|
|
967
988
|
...registryActions(usedAddresses.registry)(baseClient),
|
|
968
989
|
...superPaymasterActions(usedAddresses.superPaymaster)(baseClient),
|