@reown/appkit-common-react-native 0.0.0-feat-multi-siwe-20250623183423 → 0.0.0-feat-onramp-20250625192635
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/lib/commonjs/index.js +1 -62
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/ConstantsUtil.js +1 -1
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/NumberUtil.js +11 -52
- package/lib/commonjs/utils/NumberUtil.js.map +1 -1
- package/lib/commonjs/utils/PresetsUtil.js +3 -34
- package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
- package/lib/commonjs/utils/TypeUtil.js +0 -38
- package/lib/commonjs/utils/TypeUtil.js.map +1 -1
- package/lib/module/index.js +0 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/ConstantsUtil.js +1 -1
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/NumberUtil.js +11 -52
- package/lib/module/utils/NumberUtil.js.map +1 -1
- package/lib/module/utils/PresetsUtil.js +3 -34
- package/lib/module/utils/PresetsUtil.js.map +1 -1
- package/lib/module/utils/TypeUtil.js +0 -32
- package/lib/module/utils/TypeUtil.js.map +1 -1
- package/lib/typescript/index.d.ts +0 -5
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/NumberUtil.d.ts +11 -39
- package/lib/typescript/utils/NumberUtil.d.ts.map +1 -1
- package/lib/typescript/utils/PresetsUtil.d.ts +1 -1
- package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypeUtil.d.ts +1 -279
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -5
- package/src/utils/ConstantsUtil.ts +1 -1
- package/src/utils/NumberUtil.ts +11 -54
- package/src/utils/PresetsUtil.ts +3 -36
- package/src/utils/TypeUtil.ts +1 -346
- package/lib/commonjs/adapters/BlockchainAdapter.js +0 -79
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +0 -1
- package/lib/commonjs/adapters/EvmAdapter.js +0 -94
- package/lib/commonjs/adapters/EvmAdapter.js.map +0 -1
- package/lib/commonjs/adapters/SolanaBaseAdapter.js +0 -12
- package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +0 -1
- package/lib/commonjs/networks/bitcoin.js +0 -40
- package/lib/commonjs/networks/bitcoin.js.map +0 -1
- package/lib/commonjs/networks/solana.js +0 -78
- package/lib/commonjs/networks/solana.js.map +0 -1
- package/lib/module/adapters/BlockchainAdapter.js +0 -72
- package/lib/module/adapters/BlockchainAdapter.js.map +0 -1
- package/lib/module/adapters/EvmAdapter.js +0 -87
- package/lib/module/adapters/EvmAdapter.js.map +0 -1
- package/lib/module/adapters/SolanaBaseAdapter.js +0 -5
- package/lib/module/adapters/SolanaBaseAdapter.js.map +0 -1
- package/lib/module/networks/bitcoin.js +0 -34
- package/lib/module/networks/bitcoin.js.map +0 -1
- package/lib/module/networks/solana.js +0 -72
- package/lib/module/networks/solana.js.map +0 -1
- package/lib/typescript/adapters/BlockchainAdapter.d.ts +0 -27
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +0 -1
- package/lib/typescript/adapters/EvmAdapter.d.ts +0 -7
- package/lib/typescript/adapters/EvmAdapter.d.ts.map +0 -1
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +0 -4
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +0 -1
- package/lib/typescript/networks/bitcoin.d.ts +0 -4
- package/lib/typescript/networks/bitcoin.d.ts.map +0 -1
- package/lib/typescript/networks/solana.d.ts +0 -5
- package/lib/typescript/networks/solana.d.ts.map +0 -1
- package/src/adapters/BlockchainAdapter.ts +0 -109
- package/src/adapters/EvmAdapter.ts +0 -96
- package/src/adapters/SolanaBaseAdapter.ts +0 -5
- package/src/networks/bitcoin.ts +0 -32
- package/src/networks/solana.ts +0 -44
package/src/utils/PresetsUtil.ts
CHANGED
|
@@ -7,11 +7,11 @@ export const PresetsUtil = {
|
|
|
7
7
|
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa'
|
|
8
8
|
} as Record<string, string>,
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
EIP155NetworkImageIds: {
|
|
11
11
|
// Ethereum
|
|
12
12
|
1: 'ba0ba0cd-17c6-4806-ad93-f9d174f17900',
|
|
13
13
|
// Arbitrum
|
|
14
|
-
42161: '
|
|
14
|
+
42161: '600a9a04-c1b9-42ca-6785-9b4b6ff85200',
|
|
15
15
|
// Avalanche
|
|
16
16
|
43114: '30c46e53-e989-45fb-4549-be3bd4eb3b00',
|
|
17
17
|
// Binance Smart Chain
|
|
@@ -22,20 +22,6 @@ export const PresetsUtil = {
|
|
|
22
22
|
10: 'ab9c186a-c52f-464b-2906-ca59d760a400',
|
|
23
23
|
// Polygon
|
|
24
24
|
137: '41d04d42-da3b-4453-8506-668cc0727900',
|
|
25
|
-
// Mantle
|
|
26
|
-
5000: 'e86fae9b-b770-4eea-e520-150e12c81100',
|
|
27
|
-
// Hedera Mainnet
|
|
28
|
-
295: '6a97d510-cac8-4e58-c7ce-e8681b044c00',
|
|
29
|
-
// Sepolia
|
|
30
|
-
11_155_111: 'e909ea0a-f92a-4512-c8fc-748044ea6800',
|
|
31
|
-
// Base Sepolia
|
|
32
|
-
84532: 'a18a7ecd-e307-4360-4746-283182228e00',
|
|
33
|
-
// Unichain Sepolia
|
|
34
|
-
1301: '4eeea7ef-0014-4649-5d1d-07271a80f600',
|
|
35
|
-
// Unichain Mainnet
|
|
36
|
-
130: '2257980a-3463-48c6-cbac-a42d2a956e00',
|
|
37
|
-
// Monad Testnet
|
|
38
|
-
10_143: '0a728e83-bacb-46db-7844-948f05434900',
|
|
39
25
|
// Gnosis
|
|
40
26
|
100: '02b53f6a-e3d4-479e-1cb4-21178987d100',
|
|
41
27
|
// EVMos
|
|
@@ -59,26 +45,7 @@ export const PresetsUtil = {
|
|
|
59
45
|
// Base
|
|
60
46
|
8453: '7289c336-3981-4081-c5f4-efc26ac64a00',
|
|
61
47
|
// Aurora
|
|
62
|
-
1313161554: '3ff73439-a619-4894-9262-4470c773a100'
|
|
63
|
-
// Ronin Mainnet
|
|
64
|
-
2020: 'b8101fc0-9c19-4b6f-ec65-f6dfff106e00',
|
|
65
|
-
// Saigon Testnet (a.k.a. Ronin)
|
|
66
|
-
2021: 'b8101fc0-9c19-4b6f-ec65-f6dfff106e00',
|
|
67
|
-
// Berachain Mainnet
|
|
68
|
-
80094: 'e329c2c9-59b0-4a02-83e4-212ff3779900',
|
|
69
|
-
// Abstract Mainnet
|
|
70
|
-
2741: 'fc2427d1-5af9-4a9c-8da5-6f94627cd900',
|
|
71
|
-
|
|
72
|
-
// Solana networks
|
|
73
|
-
/// Mainnet
|
|
74
|
-
'5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': 'a1b58899-f671-4276-6a5e-56ca5bd59700',
|
|
75
|
-
/// Testnet
|
|
76
|
-
'4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z': 'a1b58899-f671-4276-6a5e-56ca5bd59700',
|
|
77
|
-
|
|
78
|
-
// Bitcoin
|
|
79
|
-
'000000000019d6689c085ae165831e93': '0b4838db-0161-4ffe-022d-532bf03dba00',
|
|
80
|
-
// Bitcoin Testnet
|
|
81
|
-
'000000000933ea01ad0ee984209779ba': '39354064-d79b-420b-065d-f980c4b78200'
|
|
48
|
+
1313161554: '3ff73439-a619-4894-9262-4470c773a100'
|
|
82
49
|
} as Record<string, string>,
|
|
83
50
|
|
|
84
51
|
ConnectorNamesMap: {
|
package/src/utils/TypeUtil.ts
CHANGED
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
|
|
3
|
-
export type CaipAddress = `${string}:${string}:${string}`;
|
|
4
|
-
|
|
5
|
-
export type CaipNetworkId = `${string}:${string}`;
|
|
6
|
-
|
|
7
|
-
export type ChainNamespace = 'eip155' | 'solana' | 'polkadot' | 'bip122';
|
|
8
|
-
|
|
9
|
-
export type Network = {
|
|
10
|
-
// Core viem/chain properties
|
|
11
|
-
id: number | string;
|
|
12
|
-
name: string;
|
|
13
|
-
nativeCurrency: { name: string; symbol: string; decimals: number };
|
|
14
|
-
rpcUrls: {
|
|
15
|
-
default: { http: readonly string[] };
|
|
16
|
-
[key: string]: { http: readonly string[] } | undefined;
|
|
17
|
-
};
|
|
18
|
-
blockExplorers?: {
|
|
19
|
-
default: { name: string; url: string };
|
|
20
|
-
[key: string]: { name: string; url: string } | undefined;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// AppKit specific / CAIP properties (Optional in type, but needed in practice)
|
|
24
|
-
chainNamespace?: ChainNamespace; // e.g., 'eip155'
|
|
25
|
-
caipNetworkId?: CaipNetworkId; // e.g., 'eip155:1'
|
|
26
|
-
testnet?: boolean;
|
|
27
|
-
deprecatedCaipNetworkId?: CaipNetworkId; // for Solana deprecated id
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type AppKitNetwork = Network & {
|
|
31
|
-
chainNamespace: ChainNamespace; // e.g., 'eip155'
|
|
32
|
-
caipNetworkId: CaipNetworkId; // e.g., 'eip155:1'
|
|
33
|
-
testnet?: boolean;
|
|
34
|
-
deprecatedCaipNetworkId?: CaipNetworkId; // for Solana deprecated id
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type AppKitConnectOptions = Pick<
|
|
38
|
-
ConnectOptions,
|
|
39
|
-
'namespaces' | 'defaultChain' | 'universalLink'
|
|
40
|
-
>;
|
|
41
|
-
|
|
42
|
-
export interface CaipNetwork {
|
|
43
|
-
id: CaipNetworkId;
|
|
44
|
-
name?: string;
|
|
45
|
-
imageId?: string;
|
|
46
|
-
imageUrl?: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
1
|
export interface Balance {
|
|
50
2
|
name: string;
|
|
51
3
|
symbol: string;
|
|
52
4
|
chainId: string;
|
|
53
|
-
address?:
|
|
5
|
+
address?: string;
|
|
54
6
|
value?: number;
|
|
55
7
|
price: number;
|
|
56
8
|
quantity: BalanceQuantity;
|
|
@@ -142,301 +94,4 @@ export interface ThemeVariables {
|
|
|
142
94
|
accent?: string;
|
|
143
95
|
}
|
|
144
96
|
|
|
145
|
-
export interface Token {
|
|
146
|
-
address: string;
|
|
147
|
-
image?: string;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export type Tokens = Record<CaipNetworkId, Token>;
|
|
151
|
-
|
|
152
97
|
export type ConnectorType = 'WALLET_CONNECT' | 'COINBASE' | 'AUTH' | 'EXTERNAL';
|
|
153
|
-
|
|
154
|
-
export type Metadata = {
|
|
155
|
-
name: string;
|
|
156
|
-
description: string;
|
|
157
|
-
url: string;
|
|
158
|
-
icons: string[];
|
|
159
|
-
redirect?: {
|
|
160
|
-
native?: string;
|
|
161
|
-
universal?: string;
|
|
162
|
-
linkMode?: boolean;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
//********** Adapter Event Payloads **********//
|
|
167
|
-
export type AccountsChangedEvent = {
|
|
168
|
-
accounts: string[];
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export type ChainChangedEvent = {
|
|
172
|
-
chainId: string;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
export type DisconnectEvent = {};
|
|
176
|
-
|
|
177
|
-
export type BalanceChangedEvent = {
|
|
178
|
-
address: CaipAddress;
|
|
179
|
-
balance: {
|
|
180
|
-
amount: string;
|
|
181
|
-
symbol: string;
|
|
182
|
-
contractAddress?: ContractAddress;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
//********** Adapter Event Map **********//
|
|
187
|
-
export interface AdapterEvents {
|
|
188
|
-
accountsChanged: (event: AccountsChangedEvent) => void;
|
|
189
|
-
chainChanged: (event: ChainChangedEvent) => void;
|
|
190
|
-
disconnect: (event: DisconnectEvent) => void;
|
|
191
|
-
balanceChanged: (event: BalanceChangedEvent) => void;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface GetBalanceParams {
|
|
195
|
-
address?: CaipAddress;
|
|
196
|
-
network?: AppKitNetwork;
|
|
197
|
-
tokens?: Tokens;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
type ContractAddress = CaipAddress;
|
|
201
|
-
|
|
202
|
-
export interface GetBalanceResponse {
|
|
203
|
-
amount: string;
|
|
204
|
-
symbol: string;
|
|
205
|
-
contractAddress?: ContractAddress;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
//********** Connector Types **********//
|
|
209
|
-
interface BaseNamespace {
|
|
210
|
-
chains?: CaipNetworkId[];
|
|
211
|
-
accounts: CaipAddress[];
|
|
212
|
-
methods: string[];
|
|
213
|
-
events: string[];
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
type Namespace = BaseNamespace;
|
|
217
|
-
|
|
218
|
-
export type Namespaces = Record<string, Namespace>;
|
|
219
|
-
|
|
220
|
-
export type ProposalNamespaces = Record<
|
|
221
|
-
string,
|
|
222
|
-
Omit<Namespace, 'accounts'> &
|
|
223
|
-
Required<Pick<Namespace, 'chains'>> & { rpcMap: Record<string, string> }
|
|
224
|
-
>;
|
|
225
|
-
|
|
226
|
-
export type ConnectOptions = {
|
|
227
|
-
namespaces?: ProposalNamespaces;
|
|
228
|
-
defaultChain?: CaipNetworkId;
|
|
229
|
-
universalLink?: string;
|
|
230
|
-
siweConfig?: AppKitSIWEClient;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
export type ConnectorInitOptions = {
|
|
234
|
-
storage: Storage;
|
|
235
|
-
metadata: Metadata;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
export abstract class WalletConnector extends EventEmitter {
|
|
239
|
-
public type: New_ConnectorType;
|
|
240
|
-
protected provider?: Provider;
|
|
241
|
-
protected namespaces?: Namespaces;
|
|
242
|
-
protected wallet?: WalletInfo;
|
|
243
|
-
protected storage?: Storage;
|
|
244
|
-
protected metadata?: Metadata;
|
|
245
|
-
|
|
246
|
-
constructor({ type }: { type: New_ConnectorType }) {
|
|
247
|
-
super();
|
|
248
|
-
this.type = type;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
public async init(ops: ConnectorInitOptions) {
|
|
252
|
-
this.storage = ops.storage;
|
|
253
|
-
this.metadata = ops.metadata;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
public setProvider(provider: Provider) {
|
|
257
|
-
this.provider = provider;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
|
|
261
|
-
abstract disconnect(): Promise<void>;
|
|
262
|
-
abstract getProvider(): Provider;
|
|
263
|
-
abstract getNamespaces(): Namespaces;
|
|
264
|
-
abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
|
|
265
|
-
abstract getWalletInfo(): WalletInfo | undefined;
|
|
266
|
-
abstract switchNetwork(network: AppKitNetwork): Promise<void>;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
//********** Provider Types **********//
|
|
270
|
-
|
|
271
|
-
export interface Provider {
|
|
272
|
-
connect<T>(params?: any): Promise<T>;
|
|
273
|
-
disconnect(): Promise<void>;
|
|
274
|
-
request<T = unknown>(
|
|
275
|
-
args: RequestArguments,
|
|
276
|
-
chain?: string | undefined,
|
|
277
|
-
expiry?: number | undefined
|
|
278
|
-
): Promise<T>;
|
|
279
|
-
on(event: string, listener: (args?: any) => void): any;
|
|
280
|
-
off(event: string, listener: (args?: any) => void): any;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface RequestArguments {
|
|
284
|
-
method: string;
|
|
285
|
-
params?: unknown[] | Record<string, unknown> | object | undefined;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
//TODO: rename this and remove the old one ConnectorType
|
|
289
|
-
export type New_ConnectorType = 'walletconnect' | 'coinbase' | 'auth' | 'phantom';
|
|
290
|
-
|
|
291
|
-
//********** Others **********//
|
|
292
|
-
|
|
293
|
-
export interface ConnectionResponse {
|
|
294
|
-
accounts: string[];
|
|
295
|
-
chainId: string;
|
|
296
|
-
[key: string]: any;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export interface WalletInfo {
|
|
300
|
-
name?: string;
|
|
301
|
-
icon?: string;
|
|
302
|
-
description?: string;
|
|
303
|
-
url?: string;
|
|
304
|
-
icons?: string[];
|
|
305
|
-
redirect?: {
|
|
306
|
-
native?: string;
|
|
307
|
-
universal?: string;
|
|
308
|
-
linkMode?: boolean;
|
|
309
|
-
};
|
|
310
|
-
[key: string]: unknown;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export interface Storage {
|
|
314
|
-
/**
|
|
315
|
-
* Returns all keys in storage.
|
|
316
|
-
*/
|
|
317
|
-
getKeys(): Promise<string[]>;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Returns all key-value entries in storage.
|
|
321
|
-
*/
|
|
322
|
-
getEntries<T = any>(): Promise<[string, T][]>;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Get an item from storage for a given key.
|
|
326
|
-
* @param key The key to retrieve.
|
|
327
|
-
*/
|
|
328
|
-
getItem<T = any>(key: string): Promise<T | undefined>;
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Set an item in storage for a given key.
|
|
332
|
-
* @param key The key to set.
|
|
333
|
-
* @param value The value to set.
|
|
334
|
-
*/
|
|
335
|
-
setItem<T = any>(key: string, value: T): Promise<void>;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Remove an item from storage for a given key.
|
|
339
|
-
* @param key The key to remove.
|
|
340
|
-
*/
|
|
341
|
-
removeItem(key: string): Promise<void>;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
//********** SIWE Types **********//
|
|
345
|
-
export interface SIWESession {
|
|
346
|
-
address: string;
|
|
347
|
-
chainId: number;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
interface CacaoHeader {
|
|
351
|
-
t: 'caip122';
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export interface SIWECreateMessageArgs {
|
|
355
|
-
chainId: number;
|
|
356
|
-
domain: string;
|
|
357
|
-
nonce: string;
|
|
358
|
-
uri: string;
|
|
359
|
-
address: string;
|
|
360
|
-
version: '1';
|
|
361
|
-
type?: CacaoHeader['t'];
|
|
362
|
-
nbf?: string;
|
|
363
|
-
exp?: string;
|
|
364
|
-
statement?: string;
|
|
365
|
-
requestId?: string;
|
|
366
|
-
resources?: string[];
|
|
367
|
-
expiry?: number;
|
|
368
|
-
iat?: string;
|
|
369
|
-
}
|
|
370
|
-
export type SIWEMessageArgs = {
|
|
371
|
-
chains: string[];
|
|
372
|
-
methods?: string[];
|
|
373
|
-
} & Omit<SIWECreateMessageArgs, 'address' | 'chainId' | 'nonce' | 'version'>;
|
|
374
|
-
// Signed Cacao (CAIP-74)
|
|
375
|
-
interface CacaoPayload {
|
|
376
|
-
domain: string;
|
|
377
|
-
aud: string;
|
|
378
|
-
nonce: string;
|
|
379
|
-
iss: string;
|
|
380
|
-
version?: string;
|
|
381
|
-
iat?: string;
|
|
382
|
-
nbf?: string;
|
|
383
|
-
exp?: string;
|
|
384
|
-
statement?: string;
|
|
385
|
-
requestId?: string;
|
|
386
|
-
resources?: string[];
|
|
387
|
-
type?: string;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
interface Cacao {
|
|
391
|
-
h: CacaoHeader;
|
|
392
|
-
p: CacaoPayload;
|
|
393
|
-
s: {
|
|
394
|
-
t: 'eip191' | 'eip1271';
|
|
395
|
-
s: string;
|
|
396
|
-
m?: string;
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export interface SIWEVerifyMessageArgs {
|
|
401
|
-
message: string;
|
|
402
|
-
signature: string;
|
|
403
|
-
cacao?: Cacao;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
export interface SIWEClientMethods {
|
|
407
|
-
getNonce: (address?: string) => Promise<string>;
|
|
408
|
-
createMessage: (args: SIWECreateMessageArgs) => string;
|
|
409
|
-
verifyMessage: (args: SIWEVerifyMessageArgs) => Promise<boolean>;
|
|
410
|
-
getSession: () => Promise<SIWESession | null>;
|
|
411
|
-
signOut: () => Promise<boolean>;
|
|
412
|
-
getMessageParams?: () => Promise<SIWEMessageArgs>;
|
|
413
|
-
onSignIn?: (session?: SIWESession) => void;
|
|
414
|
-
onSignOut?: () => void;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export interface SIWEConfig extends SIWEClientMethods {
|
|
418
|
-
// Defaults to true
|
|
419
|
-
enabled?: boolean;
|
|
420
|
-
// In milliseconds, defaults to 5 minutes
|
|
421
|
-
nonceRefetchIntervalMs?: number;
|
|
422
|
-
// In milliseconds, defaults to 5 minutes
|
|
423
|
-
sessionRefetchIntervalMs?: number;
|
|
424
|
-
// Defaults to true
|
|
425
|
-
signOutOnDisconnect?: boolean;
|
|
426
|
-
// Defaults to true
|
|
427
|
-
signOutOnAccountChange?: boolean;
|
|
428
|
-
// Defaults to true
|
|
429
|
-
signOutOnNetworkChange?: boolean;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export interface AppKitSIWEClient extends SIWEClientMethods {
|
|
433
|
-
signIn: () => Promise<SIWESession | undefined>;
|
|
434
|
-
options: {
|
|
435
|
-
enabled: boolean;
|
|
436
|
-
nonceRefetchIntervalMs: number;
|
|
437
|
-
sessionRefetchIntervalMs: number;
|
|
438
|
-
signOutOnDisconnect: boolean;
|
|
439
|
-
signOutOnAccountChange: boolean;
|
|
440
|
-
signOutOnNetworkChange: boolean;
|
|
441
|
-
};
|
|
442
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BlockchainAdapter = void 0;
|
|
7
|
-
var _events = require("events");
|
|
8
|
-
class BlockchainAdapter extends _events.EventEmitter {
|
|
9
|
-
// Typed emit method
|
|
10
|
-
emit(event, payload) {
|
|
11
|
-
return super.emit(event, payload);
|
|
12
|
-
}
|
|
13
|
-
constructor({
|
|
14
|
-
projectId,
|
|
15
|
-
supportedNamespace
|
|
16
|
-
}) {
|
|
17
|
-
super();
|
|
18
|
-
this.projectId = projectId;
|
|
19
|
-
this.supportedNamespace = supportedNamespace;
|
|
20
|
-
}
|
|
21
|
-
setConnector(connector) {
|
|
22
|
-
this.connector = connector;
|
|
23
|
-
this.subscribeToEvents();
|
|
24
|
-
}
|
|
25
|
-
removeConnector() {
|
|
26
|
-
this.connector = undefined;
|
|
27
|
-
}
|
|
28
|
-
getProvider() {
|
|
29
|
-
if (!this.connector) throw new Error('No active connector');
|
|
30
|
-
return this.connector.getProvider();
|
|
31
|
-
}
|
|
32
|
-
subscribeToEvents() {
|
|
33
|
-
const provider = this.connector?.getProvider();
|
|
34
|
-
if (!provider) return;
|
|
35
|
-
provider.on('chainChanged', this.onChainChanged.bind(this));
|
|
36
|
-
provider.on('accountsChanged', this.onAccountsChanged.bind(this));
|
|
37
|
-
provider.on('disconnect', this.onDisconnect.bind(this));
|
|
38
|
-
}
|
|
39
|
-
onChainChanged(chainId) {
|
|
40
|
-
const _chains = this.getAccounts()?.map(account => account.split(':')[1]);
|
|
41
|
-
const shouldEmit = _chains?.some(chain => chain === chainId);
|
|
42
|
-
if (shouldEmit) {
|
|
43
|
-
this.emit('chainChanged', {
|
|
44
|
-
chainId
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
onAccountsChanged(accounts) {
|
|
49
|
-
const _accounts = this.getAccounts();
|
|
50
|
-
const shouldEmit = _accounts?.some(account => {
|
|
51
|
-
const accountAddress = account.split(':')[2];
|
|
52
|
-
return accountAddress !== undefined && accounts.includes(accountAddress);
|
|
53
|
-
});
|
|
54
|
-
if (shouldEmit) {
|
|
55
|
-
this.emit('accountsChanged', {
|
|
56
|
-
accounts
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
onDisconnect() {
|
|
61
|
-
this.emit('disconnect', {
|
|
62
|
-
namespace: this.getSupportedNamespace()
|
|
63
|
-
});
|
|
64
|
-
const provider = this.connector?.getProvider();
|
|
65
|
-
if (provider) {
|
|
66
|
-
provider.off('chainChanged', this.onChainChanged.bind(this));
|
|
67
|
-
provider.off('accountsChanged', this.onAccountsChanged.bind(this));
|
|
68
|
-
provider.off('disconnect', this.onDisconnect.bind(this));
|
|
69
|
-
}
|
|
70
|
-
this.connector = undefined;
|
|
71
|
-
}
|
|
72
|
-
parseUnits(value, decimals) {
|
|
73
|
-
const [whole, fraction = ''] = value.split('.');
|
|
74
|
-
const paddedFraction = (fraction + '0'.repeat(decimals)).slice(0, decimals);
|
|
75
|
-
return BigInt(whole + paddedFraction);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.BlockchainAdapter = BlockchainAdapter;
|
|
79
|
-
//# sourceMappingURL=BlockchainAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_events","require","BlockchainAdapter","EventEmitter","emit","event","payload","constructor","projectId","supportedNamespace","setConnector","connector","subscribeToEvents","removeConnector","undefined","getProvider","Error","provider","on","onChainChanged","bind","onAccountsChanged","onDisconnect","chainId","_chains","getAccounts","map","account","split","shouldEmit","some","chain","accounts","_accounts","accountAddress","includes","namespace","getSupportedNamespace","off","parseUnits","value","decimals","whole","fraction","paddedFraction","repeat","slice","BigInt","exports"],"sourceRoot":"../../../src","sources":["adapters/BlockchainAdapter.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,MAAeC,iBAAiB,SAASC,oBAAY,CAAC;EAK3D;EACSC,IAAIA,CACXC,KAAQ,EACRC,OAAwC,EAC/B;IACT,OAAO,KAAK,CAACF,IAAI,CAACC,KAAK,EAAEC,OAAO,CAAC;EACnC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EC,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACZ,KAAK,CAAC,GAAG,CAAC;IAC/C,MAAMgB,cAAc,GAAG,CAACD,QAAQ,GAAG,GAAG,CAACE,MAAM,CAACJ,QAAQ,CAAC,EAAEK,KAAK,CAAC,CAAC,EAAEL,QAAQ,CAAC;IAE3E,OAAOM,MAAM,CAACL,KAAK,GAAGE,cAAc,CAAC;EACvC;AAOF;AAACI,OAAA,CAAA9C,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EVMAdapter = void 0;
|
|
7
|
-
var _BlockchainAdapter = require("./BlockchainAdapter");
|
|
8
|
-
var _NumberUtil = require("../utils/NumberUtil");
|
|
9
|
-
class EVMAdapter extends _BlockchainAdapter.BlockchainAdapter {
|
|
10
|
-
async signMessage(address, message, chain) {
|
|
11
|
-
const provider = this.getProvider();
|
|
12
|
-
if (!provider) {
|
|
13
|
-
throw new Error('EVMAdapter:signMessage - provider is undefined');
|
|
14
|
-
}
|
|
15
|
-
const signature = await provider.request({
|
|
16
|
-
method: 'personal_sign',
|
|
17
|
-
params: [message, address]
|
|
18
|
-
}, `eip155:${chain}`);
|
|
19
|
-
return signature;
|
|
20
|
-
}
|
|
21
|
-
async estimateGas({
|
|
22
|
-
address,
|
|
23
|
-
to,
|
|
24
|
-
data,
|
|
25
|
-
chainNamespace
|
|
26
|
-
}) {
|
|
27
|
-
const provider = this.getProvider();
|
|
28
|
-
if (!provider) {
|
|
29
|
-
throw new Error('EVMAdapter:estimateGas - provider is undefined');
|
|
30
|
-
}
|
|
31
|
-
if (!address) {
|
|
32
|
-
throw new Error('EVMAdapter:estimateGas - from address is undefined');
|
|
33
|
-
}
|
|
34
|
-
if (chainNamespace && chainNamespace !== 'eip155') {
|
|
35
|
-
throw new Error('EVMAdapter:estimateGas - chainNamespace is not eip155');
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
const txParams = {
|
|
39
|
-
from: address,
|
|
40
|
-
to,
|
|
41
|
-
data,
|
|
42
|
-
type: '0x0' // optional, legacy type
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const estimatedGasHex = await provider.request({
|
|
46
|
-
method: 'eth_estimateGas',
|
|
47
|
-
params: [txParams]
|
|
48
|
-
});
|
|
49
|
-
return BigInt(estimatedGasHex);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw new Error('EVMAdapter:estimateGas - eth_estimateGas RPC failed');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async sendTransaction(data) {
|
|
55
|
-
const {
|
|
56
|
-
address
|
|
57
|
-
} = data || {};
|
|
58
|
-
if (!this.getProvider()) {
|
|
59
|
-
throw new Error('EVMAdapter:sendTransaction - provider is undefined');
|
|
60
|
-
}
|
|
61
|
-
if (!address) {
|
|
62
|
-
throw new Error('EVMAdapter:sendTransaction - address is undefined');
|
|
63
|
-
}
|
|
64
|
-
const txParams = {
|
|
65
|
-
from: address,
|
|
66
|
-
to: data.to,
|
|
67
|
-
value: _NumberUtil.NumberUtil.convertNumericToHexString(data.value),
|
|
68
|
-
gas: _NumberUtil.NumberUtil.convertNumericToHexString(data.gas),
|
|
69
|
-
gasPrice: _NumberUtil.NumberUtil.convertNumericToHexString(data.gasPrice),
|
|
70
|
-
data: data.data,
|
|
71
|
-
// hex-encoded bytecode
|
|
72
|
-
type: '0x0' // optional: legacy transaction type
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const txHash = await this.getProvider().request({
|
|
76
|
-
method: 'eth_sendTransaction',
|
|
77
|
-
params: [txParams]
|
|
78
|
-
});
|
|
79
|
-
let receipt = null;
|
|
80
|
-
while (!receipt) {
|
|
81
|
-
receipt = await this.getProvider().request({
|
|
82
|
-
method: 'eth_getTransactionReceipt',
|
|
83
|
-
params: [txHash]
|
|
84
|
-
});
|
|
85
|
-
if (!receipt) {
|
|
86
|
-
await new Promise(r => setTimeout(r, 1000)); // wait 1s
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return receipt?.blockHash || null;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.EVMAdapter = EVMAdapter;
|
|
94
|
-
//# sourceMappingURL=EvmAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_BlockchainAdapter","require","_NumberUtil","EVMAdapter","BlockchainAdapter","signMessage","address","message","chain","provider","getProvider","Error","signature","request","method","params","estimateGas","to","data","chainNamespace","txParams","from","type","estimatedGasHex","BigInt","error","sendTransaction","value","NumberUtil","convertNumericToHexString","gas","gasPrice","txHash","receipt","Promise","r","setTimeout","blockHash","exports"],"sourceRoot":"../../../src","sources":["adapters/EvmAdapter.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEO,MAAeE,UAAU,SAASC,oCAAiB,CAAC;EACzD,MAAMC,WAAWA,CAACC,OAAe,EAAEC,OAAe,EAAEC,KAAc,EAAmB;IACnF,MAAMC,QAAQ,GAAG,IAAI,CAACC,WAAW,CAAC,CAAC;IAEnC,IAAI,CAACD,QAAQ,EAAE;MACb,MAAM,IAAIE,KAAK,CAAC,gDAAgD,CAAC;IACnE;IAEA,MAAMC,SAAS,GAAG,MAAMH,QAAQ,CAACI,OAAO,CACtC;MACEC,MAAM,EAAE,eAAe;MACvBC,MAAM,EAAE,CAACR,OAAO,EAAED,OAAO;IAC3B,CAAC,EACA,UAASE,KAAM,EAClB,CAAC;IAED,OAAOI,SAAS;EAClB;EACA,MAAMI,WAAWA,CAAC;IAAEV,OAAO;IAAEW,EAAE;IAAEC,IAAI;IAAEC;EAAoB,CAAC,EAAmB;IAC7E,MAAMV,QAAQ,GAAG,IAAI,CAACC,WAAW,CAAC,CAAC;IAEnC,IAAI,C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,CAACa,QAAQ,CAAC;MAC7Db,IAAI,EAAEA,IAAI,CAACA,IAAI;MAAE;MACjBI,IAAI,EAAE,KAAK,CAAC;IACd,CAAC;;IAED,MAAMU,MAAM,GAAG,MAAM,IAAI,CAACtB,WAAW,CAAC,CAAC,CAACG,OAAO,CAAC;MAC9CC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE,CAACK,QAAQ;IACnB,CAAC,CAAC;IAEF,IAAIa,OAAO,GAAG,IAAI;IAClB,OAAO,CAACA,OAAO,EAAE;MACfA,OAAO,GAAI,MAAM,IAAI,CAACvB,WAAW,CAAC,CAAC,CAACG,OAAO,CAAC;QAC1CC,MAAM,EAAE,2BAA2B;QACnCC,MAAM,EAAE,CAACiB,MAAM;MACjB,CAAC,CAAmC;MAEpC,IAAI,CAACC,OAAO,EAAE;QACZ,MAAM,IAAIC,OAAO,CAACC,CAAC,IAAIC,UAAU,CAACD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;MAC/C;IACF;;IAEA,OAAOF,OAAO,EAAEI,SAAS,IAAI,IAAI;EACnC;AACF;AAACC,OAAA,CAAAnC,UAAA,GAAAA,UAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SolanaBaseAdapter = void 0;
|
|
7
|
-
var _BlockchainAdapter = require("./BlockchainAdapter");
|
|
8
|
-
class SolanaBaseAdapter extends _BlockchainAdapter.BlockchainAdapter {
|
|
9
|
-
// solana logic
|
|
10
|
-
}
|
|
11
|
-
exports.SolanaBaseAdapter = SolanaBaseAdapter;
|
|
12
|
-
//# sourceMappingURL=SolanaBaseAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_BlockchainAdapter","require","SolanaBaseAdapter","BlockchainAdapter","exports"],"sourceRoot":"../../../src","sources":["adapters/SolanaBaseAdapter.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAeC,iBAAiB,SAASC,oCAAiB,CAAC;EAChE;AAAA;AACDC,OAAA,CAAAF,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.bitcoinTestnet = exports.bitcoin = void 0;
|
|
7
|
-
const bitcoin = exports.bitcoin = {
|
|
8
|
-
id: '000000000019d6689c085ae165831e93',
|
|
9
|
-
caipNetworkId: 'bip122:000000000019d6689c085ae165831e93',
|
|
10
|
-
chainNamespace: 'bip122',
|
|
11
|
-
name: 'Bitcoin',
|
|
12
|
-
nativeCurrency: {
|
|
13
|
-
name: 'Bitcoin',
|
|
14
|
-
symbol: 'BTC',
|
|
15
|
-
decimals: 8
|
|
16
|
-
},
|
|
17
|
-
rpcUrls: {
|
|
18
|
-
default: {
|
|
19
|
-
http: ['https://rpc.walletconnect.org/v1']
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const bitcoinTestnet = exports.bitcoinTestnet = {
|
|
24
|
-
id: '000000000933ea01ad0ee984209779ba',
|
|
25
|
-
caipNetworkId: 'bip122:000000000933ea01ad0ee984209779ba',
|
|
26
|
-
chainNamespace: 'bip122',
|
|
27
|
-
name: 'Bitcoin Testnet',
|
|
28
|
-
nativeCurrency: {
|
|
29
|
-
name: 'Bitcoin',
|
|
30
|
-
symbol: 'BTC',
|
|
31
|
-
decimals: 8
|
|
32
|
-
},
|
|
33
|
-
rpcUrls: {
|
|
34
|
-
default: {
|
|
35
|
-
http: ['https://rpc.walletconnect.org/v1']
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
testnet: true
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=bitcoin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["bitcoin","exports","id","caipNetworkId","chainNamespace","name","nativeCurrency","symbol","decimals","rpcUrls","default","http","bitcoinTestnet","testnet"],"sourceRoot":"../../../src","sources":["networks/bitcoin.ts"],"mappings":";;;;;;AAEO,MAAMA,OAAsB,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACpCE,EAAE,EAAE,kCAAkC;EACtCC,aAAa,EAAE,yCAAyC;EACxDC,cAAc,EAAE,QAAQ;EACxBC,IAAI,EAAE,SAAS;EACfC,cAAc,EAAE;IACdD,IAAI,EAAE,SAAS;IACfE,MAAM,EAAE,KAAK;IACbC,QAAQ,EAAE;EACZ,CAAC;EACDC,OAAO,EAAE;IACPC,OAAO,EAAE;MAAEC,IAAI,EAAE,CAAC,kCAAkC;IAAE;EACxD;AACF,CAAC;AAEM,MAAMC,cAA6B,GAAAX,OAAA,CAAAW,cAAA,GAAG;EAC3CV,EAAE,EAAE,kCAAkC;EACtCC,aAAa,EAAE,yCAAyC;EACxDC,cAAc,EAAE,QAAQ;EACxBC,IAAI,EAAE,iBAAiB;EACvBC,cAAc,EAAE;IACdD,IAAI,EAAE,SAAS;IACfE,MAAM,EAAE,KAAK;IACbC,QAAQ,EAAE;EACZ,CAAC;EACDC,OAAO,EAAE;IACPC,OAAO,EAAE;MAAEC,IAAI,EAAE,CAAC,kCAAkC;IAAE;EACxD,CAAC;EACDE,OAAO,EAAE;AACX,CAAC"}
|