@crossmint/client-sdk-smart-wallet 0.1.0 → 0.1.2

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.
@@ -4,28 +4,8 @@ export const DATADOG_CLIENT_TOKEN = "pub035be8a594b35be1887b6ba76c4029ca";
4
4
  export const CROSSMINT_DEV_URL = "http://localhost:3000/api";
5
5
  export const CROSSMINT_STG_URL = "https://staging.crossmint.com/api";
6
6
  export const CROSSMINT_PROD_URL = "https://www.crossmint.com/api";
7
- export const ZD_ETHEREUM_PROJECT_ID = "9ee29857-8077-404b-9a9a-31eeea996a4a";
8
- export const ZD_POLYGON_PROJECT_ID = "023d4a21-d801-4450-b629-24439ab1369d";
9
- export const ZD_BSC_PROJECT_ID = "3d166617-da86-494b-9348-e8a13343bc04";
10
- export const ZD_OPTIMISM_PROJECT_ID = "e9314f9e-a13d-414f-b965-c591a0248243";
11
- export const ZD_ARBITRUM_PROJECT_ID = "1641cd99-c1ef-404a-9d26-a9dc67b1ba51";
12
- export const ZD_GOERLI_PROJECT_ID = "3cfecfb6-9d7d-4ef6-acaa-ac8f79f6cd5a";
13
- export const ZD_SEPOLIA_PROJECT_ID = "7ff22858-06f0-4f3a-8b46-5b41d8c75d0e";
14
- export const ZD_AMOY_PROJECT_ID = "3b24773b-d91e-4c01-8ce5-04807463bbca";
15
- export const ZD_ZKATANA_PROJECT_ID = "d54706a0-304b-419e-8a33-03c26ba3f0e9";
16
- export const ZD_ZKYOTO_PROJECT_ID = "ce986d52-4f27-4a2b-b429-eb2322f15f32";
17
- export const ZD_ASTAR_PROJECT_ID = "6204f336-643f-41af-94e1-f8d146c91675";
18
- export const ZD_BASE_SEPOLIA_PROJECT_ID = "3eb830c5-f91b-48e0-bb7d-dc30103a60b2";
19
- export const ZD_OPTIMISM_SEPOLIA_PROJECT_ID = "6188b92b-993e-4f39-be22-56e4806416a8";
20
- export const ZD_ARBITRUM_SEPOLIA_PROJECT_ID = "8b8b6d1a-184c-4198-8f29-c07e63aad595";
21
- export const ZD_BASE_PROJECT_ID = "5535aa3b-4f9c-45af-9c38-0072369564a3";
22
- export const ZD_ARBITRUM_NOVA_PROJECT_ID = "b6a6db7c-65de-4f74-9d8f-f70d9c083531";
23
- export const RELAY_API_KEY = "c8999b7e-8bb7-416d-a854-dac8632f9ee6_crossmint";
24
7
  export const SCW_SERVICE = "SCW_SDK";
25
8
  export const SDK_VERSION = "0.1.0";
26
9
  export const API_VERSION = "2024-06-09";
27
10
  export const BUNDLER_RPC = "https://rpc.zerodev.app/api/v2/bundler/";
28
11
  export const PAYMASTER_RPC = "https://rpc.zerodev.app/api/v2/paymaster/";
29
- export const PM_BASE_SEPOLIA_RPC =
30
- "https://api.developer.coinbase.com/rpc/v1/base-sepolia/6BTAmOQZ0x1YWtI24hIKKqdHWmVP1UXf";
31
- export const PM_BASE_RPC = "https://api.developer.coinbase.com/rpc/v1/base/6BTAmOQZ0x1YWtI24hIKKqdHWmVP1UXf";
@@ -2,14 +2,13 @@ import { providerToSmartAccountSigner } from "permissionless";
2
2
  import type { SmartAccountSigner } from "permissionless/accounts";
3
3
  import { Address, EIP1193Provider } from "viem";
4
4
 
5
- import { EVMBlockchainIncludingTestnet } from "@crossmint/common-sdk-base";
6
-
5
+ import { SmartWalletChain } from "../blockchain/chains";
7
6
  import { SmartWalletSDKError } from "../error";
8
7
  import { ViemAccount, WalletParams } from "../types/Config";
9
8
  import { logInputOutput } from "./log";
10
9
 
11
10
  type CreateOwnerSignerInput = {
12
- chain: EVMBlockchainIncludingTestnet;
11
+ chain: SmartWalletChain;
13
12
  walletParams: WalletParams;
14
13
  };
15
14
 
@@ -1,121 +0,0 @@
1
- import {
2
- BUNDLER_RPC,
3
- PM_BASE_RPC,
4
- PM_BASE_SEPOLIA_RPC,
5
- ZD_AMOY_PROJECT_ID,
6
- ZD_ARBITRUM_NOVA_PROJECT_ID,
7
- ZD_ARBITRUM_PROJECT_ID,
8
- ZD_ARBITRUM_SEPOLIA_PROJECT_ID,
9
- ZD_ASTAR_PROJECT_ID,
10
- ZD_BASE_PROJECT_ID,
11
- ZD_BASE_SEPOLIA_PROJECT_ID,
12
- ZD_BSC_PROJECT_ID,
13
- ZD_ETHEREUM_PROJECT_ID,
14
- ZD_GOERLI_PROJECT_ID,
15
- ZD_OPTIMISM_PROJECT_ID,
16
- ZD_OPTIMISM_SEPOLIA_PROJECT_ID,
17
- ZD_POLYGON_PROJECT_ID,
18
- ZD_SEPOLIA_PROJECT_ID,
19
- ZD_ZKATANA_PROJECT_ID,
20
- ZD_ZKYOTO_PROJECT_ID,
21
- } from "@/utils/constants";
22
- import {
23
- arbitrum,
24
- arbitrumNova,
25
- arbitrumSepolia,
26
- astarZkEVM,
27
- astarZkyoto,
28
- base,
29
- baseSepolia,
30
- bsc,
31
- goerli,
32
- mainnet,
33
- optimism,
34
- optimismSepolia,
35
- polygon,
36
- polygonAmoy,
37
- sepolia,
38
- } from "viem/chains";
39
-
40
- import { EVMBlockchainIncludingTestnet } from "@crossmint/common-sdk-base";
41
-
42
- export const getZeroDevProjectIdByBlockchain = (chain: EVMBlockchainIncludingTestnet) => {
43
- const zeroDevProjectId = new Map<EVMBlockchainIncludingTestnet, string | null>([
44
- ["ethereum", ZD_ETHEREUM_PROJECT_ID],
45
- ["polygon", ZD_POLYGON_PROJECT_ID],
46
- ["bsc", ZD_BSC_PROJECT_ID],
47
- ["optimism", ZD_OPTIMISM_PROJECT_ID],
48
- ["arbitrum", ZD_ARBITRUM_PROJECT_ID],
49
- ["ethereum-goerli", ZD_GOERLI_PROJECT_ID],
50
- ["ethereum-sepolia", ZD_SEPOLIA_PROJECT_ID],
51
- ["polygon-amoy", ZD_AMOY_PROJECT_ID],
52
- ["zkatana", ZD_ZKATANA_PROJECT_ID],
53
- ["zkyoto", ZD_ZKYOTO_PROJECT_ID],
54
- ["arbitrum-sepolia", ZD_ARBITRUM_SEPOLIA_PROJECT_ID],
55
- ["base-goerli", null],
56
- ["base-sepolia", ZD_BASE_SEPOLIA_PROJECT_ID],
57
- ["bsc-testnet", null],
58
- ["optimism-goerli", null],
59
- ["optimism-sepolia", ZD_OPTIMISM_SEPOLIA_PROJECT_ID],
60
- ["zora-goerli", null],
61
- ["zora-sepolia", null],
62
- ["base", ZD_BASE_PROJECT_ID],
63
- ["zora", null],
64
- ["arbitrumnova", ZD_ARBITRUM_NOVA_PROJECT_ID],
65
- ["astar-zkevm", ZD_ASTAR_PROJECT_ID],
66
- ["apex", null],
67
- ]).get(chain)!;
68
-
69
- if (zeroDevProjectId == null) {
70
- throw new Error(`ZeroDev project id not found for chain ${chain}`);
71
- }
72
- return zeroDevProjectId;
73
- };
74
-
75
- export const getViemNetwork = (cmChain: EVMBlockchainIncludingTestnet) => {
76
- switch (cmChain) {
77
- case "ethereum":
78
- return mainnet;
79
- case "ethereum-goerli":
80
- return goerli;
81
- case "ethereum-sepolia":
82
- return sepolia;
83
- case "polygon":
84
- return polygon;
85
- case "polygon-amoy":
86
- return polygonAmoy;
87
- case "optimism":
88
- return optimism;
89
- case "optimism-sepolia":
90
- return optimismSepolia;
91
- case "arbitrum":
92
- return arbitrum;
93
- case "arbitrumnova":
94
- return arbitrumNova;
95
- case "arbitrum-sepolia":
96
- return arbitrumSepolia;
97
- case "base":
98
- return base;
99
- case "base-sepolia":
100
- return baseSepolia;
101
- case "zkyoto":
102
- return astarZkyoto;
103
- case "astar-zkevm":
104
- return astarZkEVM;
105
- case "bsc":
106
- return bsc;
107
- default:
108
- throw new Error(`Unsupported network: ${cmChain}`);
109
- }
110
- };
111
-
112
- export const getBundlerRPC = (chain: EVMBlockchainIncludingTestnet) => {
113
- switch (chain) {
114
- case EVMBlockchainIncludingTestnet.BASE_SEPOLIA:
115
- return PM_BASE_SEPOLIA_RPC;
116
- case EVMBlockchainIncludingTestnet.BASE:
117
- return PM_BASE_RPC;
118
- default:
119
- return BUNDLER_RPC + getZeroDevProjectIdByBlockchain(chain) + "?bundlerProvider=STACKUP";
120
- }
121
- };
@@ -1 +0,0 @@
1
- export * from "./Tokens";