@reown/appkit-common-react-native 0.0.0-feat-coinbase-20250722202925 → 0.0.0-feat-onramp-20250722205908
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 +3 -13
- 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 +10 -35
- package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
- package/lib/commonjs/utils/TypeUtil.js +0 -42
- 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 +3 -13
- 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 +10 -35
- package/lib/module/utils/PresetsUtil.js.map +1 -1
- package/lib/module/utils/TypeUtil.js +0 -36
- 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/ConstantsUtil.d.ts +1 -10
- package/lib/typescript/utils/ConstantsUtil.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 +3 -1
- package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypeUtil.d.ts +12 -296
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -5
- package/src/utils/ConstantsUtil.ts +3 -14
- package/src/utils/NumberUtil.ts +11 -54
- package/src/utils/PresetsUtil.ts +12 -37
- package/src/utils/TypeUtil.ts +14 -379
- package/lib/commonjs/adapters/BlockchainAdapter.js +0 -81
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +0 -1
- package/lib/commonjs/adapters/EvmAdapter.js +0 -208
- package/lib/commonjs/adapters/EvmAdapter.js.map +0 -1
- package/lib/commonjs/adapters/SolanaBaseAdapter.js +0 -10
- 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 -74
- package/lib/module/adapters/BlockchainAdapter.js.map +0 -1
- package/lib/module/adapters/EvmAdapter.js +0 -202
- package/lib/module/adapters/EvmAdapter.js.map +0 -1
- package/lib/module/adapters/SolanaBaseAdapter.js +0 -3
- 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 -25
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +0 -1
- package/lib/typescript/adapters/EvmAdapter.d.ts +0 -27
- package/lib/typescript/adapters/EvmAdapter.d.ts.map +0 -1
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +0 -6
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +0 -1
- package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +0 -2
- package/lib/typescript/adapters/__tests__/EvmAdapter.test.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 -107
- package/src/adapters/EvmAdapter.ts +0 -260
- package/src/adapters/SolanaBaseAdapter.ts +0 -6
- package/src/adapters/__tests__/EvmAdapter.test.ts +0 -126
- package/src/networks/bitcoin.ts +0 -32
- package/src/networks/solana.ts +0 -44
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { BlockchainAdapter } from './BlockchainAdapter';
|
|
2
|
-
import { NumberUtil } from '../utils/NumberUtil';
|
|
3
|
-
import type { AppKitNetwork } from '../utils/TypeUtil';
|
|
4
|
-
|
|
5
|
-
// Type definitions for writeContract
|
|
6
|
-
export interface WriteContractData {
|
|
7
|
-
tokenAddress: `0x${string}`;
|
|
8
|
-
receiverAddress: `0x${string}`;
|
|
9
|
-
tokenAmount: bigint;
|
|
10
|
-
fromAddress: `0x${string}`;
|
|
11
|
-
method: 'transfer' | 'transferFrom' | 'approve';
|
|
12
|
-
abi?: any; // Optional ABI for future extensibility
|
|
13
|
-
spenderAddress?: `0x${string}`; // Required for transferFrom and approve
|
|
14
|
-
network: AppKitNetwork;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SendTransactionData {
|
|
18
|
-
address: `0x${string}`;
|
|
19
|
-
network: AppKitNetwork;
|
|
20
|
-
to: `0x${string}`;
|
|
21
|
-
value: string;
|
|
22
|
-
data: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Simple ABI encoder for ERC20 functions
|
|
26
|
-
function encodeERC20Function(method: string, params: any[]): string {
|
|
27
|
-
const functionSelectors = {
|
|
28
|
-
transfer: '0xa9059cbb', // transfer(address,uint256)
|
|
29
|
-
transferFrom: '0x23b872dd', // transferFrom(address,address,uint256)
|
|
30
|
-
approve: '0x095ea7b3' // approve(address,uint256)
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const selector = functionSelectors[method as keyof typeof functionSelectors];
|
|
34
|
-
if (!selector) {
|
|
35
|
-
throw new Error(`EVMAdapter:encodeERC20Function - unsupported method: ${method}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let encodedParams = '';
|
|
39
|
-
|
|
40
|
-
switch (method) {
|
|
41
|
-
case 'transfer':
|
|
42
|
-
if (params.length !== 2) throw new Error('transfer requires 2 parameters: to, amount');
|
|
43
|
-
const [to, amount] = params;
|
|
44
|
-
encodedParams =
|
|
45
|
-
to.toLowerCase().slice(2).padStart(64, '0') + amount.toString(16).padStart(64, '0');
|
|
46
|
-
break;
|
|
47
|
-
|
|
48
|
-
case 'transferFrom':
|
|
49
|
-
if (params.length !== 3)
|
|
50
|
-
throw new Error('transferFrom requires 3 parameters: from, to, amount');
|
|
51
|
-
const [from, toTransferFrom, amountTransferFrom] = params;
|
|
52
|
-
encodedParams =
|
|
53
|
-
from.toLowerCase().slice(2).padStart(64, '0') +
|
|
54
|
-
toTransferFrom.toLowerCase().slice(2).padStart(64, '0') +
|
|
55
|
-
amountTransferFrom.toString(16).padStart(64, '0');
|
|
56
|
-
break;
|
|
57
|
-
|
|
58
|
-
case 'approve':
|
|
59
|
-
if (params.length !== 2) throw new Error('approve requires 2 parameters: spender, amount');
|
|
60
|
-
const [spender, amountApprove] = params;
|
|
61
|
-
encodedParams =
|
|
62
|
-
spender.toLowerCase().slice(2).padStart(64, '0') +
|
|
63
|
-
amountApprove.toString(16).padStart(64, '0');
|
|
64
|
-
break;
|
|
65
|
-
|
|
66
|
-
default:
|
|
67
|
-
throw new Error(`EVMAdapter:encodeERC20Function - unsupported method: ${method}`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return selector + encodedParams;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export abstract class EVMAdapter extends BlockchainAdapter {
|
|
74
|
-
override subscribeToEvents(): void {
|
|
75
|
-
super.subscribeToEvents();
|
|
76
|
-
const provider = this.getProvider();
|
|
77
|
-
if (!provider) return;
|
|
78
|
-
|
|
79
|
-
provider.on('reown_updateEmail', (info: any) => {
|
|
80
|
-
// this.emit('updateEmail', email);
|
|
81
|
-
//TODO: check this
|
|
82
|
-
//eslint-disable-next-line no-console
|
|
83
|
-
console.log('reown_updateEmail', info);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async signMessage(address: string, message: string, chain?: string): Promise<string> {
|
|
88
|
-
const provider = this.getProvider();
|
|
89
|
-
|
|
90
|
-
if (!provider) {
|
|
91
|
-
throw new Error('EVMAdapter:signMessage - provider is undefined');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const signature = await provider.request(
|
|
95
|
-
{
|
|
96
|
-
method: 'personal_sign',
|
|
97
|
-
params: [message, address]
|
|
98
|
-
},
|
|
99
|
-
`eip155:${chain}`
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
return signature as string;
|
|
103
|
-
}
|
|
104
|
-
async estimateGas({ address, to, data, chainNamespace }: any): Promise<bigint> {
|
|
105
|
-
const provider = this.getProvider();
|
|
106
|
-
|
|
107
|
-
if (!provider) {
|
|
108
|
-
throw new Error('EVMAdapter:estimateGas - provider is undefined');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!address) {
|
|
112
|
-
throw new Error('EVMAdapter:estimateGas - from address is undefined');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (chainNamespace && chainNamespace !== 'eip155') {
|
|
116
|
-
throw new Error('EVMAdapter:estimateGas - chainNamespace is not eip155');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
try {
|
|
120
|
-
const txParams = {
|
|
121
|
-
from: address,
|
|
122
|
-
to,
|
|
123
|
-
data,
|
|
124
|
-
type: '0x0' // optional, legacy type
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const estimatedGasHex = await provider.request({
|
|
128
|
-
method: 'eth_estimateGas',
|
|
129
|
-
params: [txParams]
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
return BigInt(estimatedGasHex as string);
|
|
133
|
-
} catch (error) {
|
|
134
|
-
throw new Error('EVMAdapter:estimateGas - eth_estimateGas RPC failed');
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
async sendTransaction(data: SendTransactionData): Promise<`0x${string}` | null> {
|
|
139
|
-
const { address, network } = data || {};
|
|
140
|
-
|
|
141
|
-
if (!this.getProvider()) {
|
|
142
|
-
throw new Error('EVMAdapter:sendTransaction - provider is undefined');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (!address) {
|
|
146
|
-
throw new Error('EVMAdapter:sendTransaction - address is undefined');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (!network) {
|
|
150
|
-
throw new Error('EVMAdapter:sendTransaction - network is undefined');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const txParams = {
|
|
154
|
-
from: address,
|
|
155
|
-
to: data.to,
|
|
156
|
-
value: NumberUtil.convertNumericToHexString(data.value),
|
|
157
|
-
data: data.data, // hex-encoded bytecode
|
|
158
|
-
type: '0x0' // optional: legacy transaction type
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
const txHash = await this.getProvider().request(
|
|
162
|
-
{
|
|
163
|
-
method: 'eth_sendTransaction',
|
|
164
|
-
params: [txParams]
|
|
165
|
-
},
|
|
166
|
-
network.caipNetworkId
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
return txHash as `0x${string}` | null;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async writeContract(data: WriteContractData): Promise<`0x${string}` | null> {
|
|
173
|
-
const {
|
|
174
|
-
tokenAddress,
|
|
175
|
-
receiverAddress,
|
|
176
|
-
tokenAmount,
|
|
177
|
-
method,
|
|
178
|
-
fromAddress,
|
|
179
|
-
spenderAddress,
|
|
180
|
-
network
|
|
181
|
-
} = data;
|
|
182
|
-
|
|
183
|
-
if (!this.getProvider()) {
|
|
184
|
-
throw new Error('EVMAdapter:writeContract - provider is undefined');
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (!fromAddress) {
|
|
188
|
-
throw new Error('EVMAdapter:writeContract - fromAddress is undefined');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (!tokenAddress) {
|
|
192
|
-
throw new Error('EVMAdapter:writeContract - tokenAddress is undefined');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (!tokenAmount) {
|
|
196
|
-
throw new Error('EVMAdapter:writeContract - tokenAmount is undefined');
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (!method) {
|
|
200
|
-
throw new Error('EVMAdapter:writeContract - method is undefined');
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Validate method-specific parameters
|
|
204
|
-
if (method === 'transfer' && !receiverAddress) {
|
|
205
|
-
throw new Error('EVMAdapter:writeContract - receiverAddress is required for transfer method');
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if ((method === 'transferFrom' || method === 'approve') && !spenderAddress) {
|
|
209
|
-
throw new Error(`EVMAdapter:writeContract - spenderAddress is required for ${method} method`);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Encode the function call data based on method
|
|
213
|
-
let encodedData: string;
|
|
214
|
-
|
|
215
|
-
switch (method) {
|
|
216
|
-
case 'transfer':
|
|
217
|
-
encodedData = encodeERC20Function('transfer', [receiverAddress, tokenAmount]);
|
|
218
|
-
break;
|
|
219
|
-
case 'transferFrom':
|
|
220
|
-
encodedData = encodeERC20Function('transferFrom', [
|
|
221
|
-
fromAddress,
|
|
222
|
-
receiverAddress,
|
|
223
|
-
tokenAmount
|
|
224
|
-
]);
|
|
225
|
-
break;
|
|
226
|
-
case 'approve':
|
|
227
|
-
encodedData = encodeERC20Function('approve', [spenderAddress, tokenAmount]);
|
|
228
|
-
break;
|
|
229
|
-
default:
|
|
230
|
-
throw new Error(`EVMAdapter:writeContract - method '${method}' is not supported`);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Create transaction parameters
|
|
234
|
-
const txParams = {
|
|
235
|
-
from: fromAddress,
|
|
236
|
-
to: tokenAddress,
|
|
237
|
-
data: encodedData,
|
|
238
|
-
value: '0x0', // No ETH value for token operations
|
|
239
|
-
type: '0x0' // legacy transaction type
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
try {
|
|
243
|
-
// Send the transaction
|
|
244
|
-
const txHash = await this.getProvider().request(
|
|
245
|
-
{
|
|
246
|
-
method: 'eth_sendTransaction',
|
|
247
|
-
params: [txParams]
|
|
248
|
-
},
|
|
249
|
-
network.caipNetworkId
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
return txHash as `0x${string}` | null;
|
|
253
|
-
} catch (error) {
|
|
254
|
-
if (error instanceof Error) {
|
|
255
|
-
throw new Error(`EVMAdapter:writeContract - ${error.message}`);
|
|
256
|
-
}
|
|
257
|
-
throw new Error('EVMAdapter:writeContract - unknown error occurred');
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { EVMAdapter } from '../EvmAdapter';
|
|
2
|
-
import type { AppKitNetwork, CaipAddress } from '../../utils/TypeUtil';
|
|
3
|
-
|
|
4
|
-
const network: AppKitNetwork = {
|
|
5
|
-
id: 1,
|
|
6
|
-
name: 'Ethereum',
|
|
7
|
-
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
|
|
8
|
-
rpcUrls: {
|
|
9
|
-
default: {
|
|
10
|
-
http: ['https://eth.merkle.io']
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
blockExplorers: {
|
|
14
|
-
default: {
|
|
15
|
-
name: 'Etherscan',
|
|
16
|
-
url: 'https://etherscan.io'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
chainNamespace: 'eip155',
|
|
20
|
-
caipNetworkId: 'eip155:1'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Mock implementation for testing
|
|
24
|
-
class MockEVMAdapter extends EVMAdapter {
|
|
25
|
-
private mockProvider: any;
|
|
26
|
-
|
|
27
|
-
constructor() {
|
|
28
|
-
super({ projectId: 'test', supportedNamespace: 'eip155', adapterType: 'ethers' });
|
|
29
|
-
this.mockProvider = {
|
|
30
|
-
request: jest.fn(),
|
|
31
|
-
on: jest.fn(),
|
|
32
|
-
off: jest.fn()
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
setMockProvider(provider: any) {
|
|
37
|
-
this.mockProvider = provider;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
override getProvider() {
|
|
41
|
-
return this.mockProvider;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async disconnect(): Promise<void> {}
|
|
45
|
-
getSupportedNamespace() {
|
|
46
|
-
return 'eip155' as const;
|
|
47
|
-
}
|
|
48
|
-
async getBalance() {
|
|
49
|
-
return { amount: '0', symbol: 'ETH' };
|
|
50
|
-
}
|
|
51
|
-
getAccounts(): CaipAddress[] | undefined {
|
|
52
|
-
return ['eip155:1:0x1234567890123456789012345678901234567890'];
|
|
53
|
-
}
|
|
54
|
-
async switchNetwork() {}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
describe('EVMAdapter', () => {
|
|
58
|
-
let adapter: MockEVMAdapter;
|
|
59
|
-
|
|
60
|
-
beforeEach(() => {
|
|
61
|
-
adapter = new MockEVMAdapter();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe('writeContract', () => {
|
|
65
|
-
it('should encode transfer function correctly', async () => {
|
|
66
|
-
const mockProvider = {
|
|
67
|
-
request: jest.fn().mockResolvedValueOnce('0x1234567890abcdef') // eth_sendTransaction
|
|
68
|
-
};
|
|
69
|
-
adapter.setMockProvider(mockProvider);
|
|
70
|
-
|
|
71
|
-
const result = await adapter.writeContract({
|
|
72
|
-
tokenAddress: '0x1234567890123456789012345678901234567890',
|
|
73
|
-
receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
74
|
-
tokenAmount: BigInt(1000000000000000000), // 1 token with 18 decimals
|
|
75
|
-
fromAddress: '0x1234567890123456789012345678901234567890',
|
|
76
|
-
method: 'transfer',
|
|
77
|
-
network
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
expect(result).toBe('0x1234567890abcdef');
|
|
81
|
-
expect(mockProvider.request).toHaveBeenCalledWith(
|
|
82
|
-
{
|
|
83
|
-
method: 'eth_sendTransaction',
|
|
84
|
-
params: [
|
|
85
|
-
{
|
|
86
|
-
from: '0x1234567890123456789012345678901234567890',
|
|
87
|
-
to: '0x1234567890123456789012345678901234567890',
|
|
88
|
-
data: '0xa9059cbb000000000000000000000000abcdefabcdefabcdefabcdefabcdefabcdefabcd0000000000000000000000000000000000000000000000000de0b6b3a7640000',
|
|
89
|
-
value: '0x0',
|
|
90
|
-
type: '0x0'
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
'eip155:1'
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('should throw error for unsupported method', async () => {
|
|
99
|
-
await expect(
|
|
100
|
-
adapter.writeContract({
|
|
101
|
-
tokenAddress: '0x1234567890123456789012345678901234567890',
|
|
102
|
-
receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
103
|
-
tokenAmount: BigInt(1000000000000000000),
|
|
104
|
-
fromAddress: '0x1234567890123456789012345678901234567890',
|
|
105
|
-
method: 'unsupported' as any,
|
|
106
|
-
network
|
|
107
|
-
})
|
|
108
|
-
).rejects.toThrow("method 'unsupported' is not supported");
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('should throw error when provider is undefined', async () => {
|
|
112
|
-
adapter.setMockProvider(undefined);
|
|
113
|
-
|
|
114
|
-
await expect(
|
|
115
|
-
adapter.writeContract({
|
|
116
|
-
tokenAddress: '0x1234567890123456789012345678901234567890',
|
|
117
|
-
receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
118
|
-
tokenAmount: BigInt(1000000000000000000),
|
|
119
|
-
fromAddress: '0x1234567890123456789012345678901234567890',
|
|
120
|
-
method: 'transfer',
|
|
121
|
-
network
|
|
122
|
-
})
|
|
123
|
-
).rejects.toThrow('provider is undefined');
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
});
|
package/src/networks/bitcoin.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AppKitNetwork } from '../utils/TypeUtil';
|
|
2
|
-
|
|
3
|
-
export const bitcoin: AppKitNetwork = {
|
|
4
|
-
id: '000000000019d6689c085ae165831e93',
|
|
5
|
-
caipNetworkId: 'bip122:000000000019d6689c085ae165831e93',
|
|
6
|
-
chainNamespace: 'bip122',
|
|
7
|
-
name: 'Bitcoin',
|
|
8
|
-
nativeCurrency: {
|
|
9
|
-
name: 'Bitcoin',
|
|
10
|
-
symbol: 'BTC',
|
|
11
|
-
decimals: 8
|
|
12
|
-
},
|
|
13
|
-
rpcUrls: {
|
|
14
|
-
default: { http: ['https://rpc.walletconnect.org/v1'] }
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const bitcoinTestnet: AppKitNetwork = {
|
|
19
|
-
id: '000000000933ea01ad0ee984209779ba',
|
|
20
|
-
caipNetworkId: 'bip122:000000000933ea01ad0ee984209779ba',
|
|
21
|
-
chainNamespace: 'bip122',
|
|
22
|
-
name: 'Bitcoin Testnet',
|
|
23
|
-
nativeCurrency: {
|
|
24
|
-
name: 'Bitcoin',
|
|
25
|
-
symbol: 'BTC',
|
|
26
|
-
decimals: 8
|
|
27
|
-
},
|
|
28
|
-
rpcUrls: {
|
|
29
|
-
default: { http: ['https://rpc.walletconnect.org/v1'] }
|
|
30
|
-
},
|
|
31
|
-
testnet: true
|
|
32
|
-
};
|
package/src/networks/solana.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { AppKitNetwork } from '../utils/TypeUtil';
|
|
2
|
-
|
|
3
|
-
export const solana: AppKitNetwork = {
|
|
4
|
-
id: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
|
|
5
|
-
name: 'Solana',
|
|
6
|
-
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 },
|
|
7
|
-
rpcUrls: {
|
|
8
|
-
default: {
|
|
9
|
-
http: ['https://rpc.walletconnect.org/v1']
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
blockExplorers: { default: { name: 'Solscan', url: 'https://solscan.io' } },
|
|
13
|
-
chainNamespace: 'solana',
|
|
14
|
-
caipNetworkId: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
|
|
15
|
-
deprecatedCaipNetworkId: 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ',
|
|
16
|
-
testnet: false
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const solanaDevnet: AppKitNetwork = {
|
|
20
|
-
id: 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
|
|
21
|
-
name: 'Solana Devnet',
|
|
22
|
-
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 },
|
|
23
|
-
rpcUrls: {
|
|
24
|
-
default: { http: ['https://rpc.walletconnect.org/v1'] }
|
|
25
|
-
},
|
|
26
|
-
blockExplorers: { default: { name: 'Solscan', url: 'https://solscan.io' } },
|
|
27
|
-
chainNamespace: 'solana',
|
|
28
|
-
caipNetworkId: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
|
|
29
|
-
deprecatedCaipNetworkId: 'solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K',
|
|
30
|
-
testnet: true
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const solanaTestnet: AppKitNetwork = {
|
|
34
|
-
id: '4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z',
|
|
35
|
-
name: 'Solana Testnet',
|
|
36
|
-
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 },
|
|
37
|
-
rpcUrls: {
|
|
38
|
-
default: { http: ['https://rpc.walletconnect.org/v1'] }
|
|
39
|
-
},
|
|
40
|
-
blockExplorers: { default: { name: 'Solscan', url: 'https://solscan.io' } },
|
|
41
|
-
chainNamespace: 'solana',
|
|
42
|
-
caipNetworkId: 'solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z',
|
|
43
|
-
testnet: true
|
|
44
|
-
};
|