@reown/appkit-ethers-react-native 0.0.0-feat-onramp-20250409135734 → 0.0.0-feat-multichain-20250513150920
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/adapter.js +98 -0
- package/lib/commonjs/adapter.js.map +1 -0
- package/lib/commonjs/index.js +3 -174
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/adapter.js +91 -0
- package/lib/module/adapter.js.map +1 -0
- package/lib/module/index.js +2 -133
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/adapter.d.ts +14 -0
- package/lib/typescript/adapter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -40
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/adapter.ts +111 -0
- package/src/index.tsx +2 -165
- package/lib/commonjs/client.js +0 -857
- package/lib/commonjs/client.js.map +0 -1
- package/lib/commonjs/utils/defaultConfig.js +0 -18
- package/lib/commonjs/utils/defaultConfig.js.map +0 -1
- package/lib/commonjs/utils/helpers.js +0 -27
- package/lib/commonjs/utils/helpers.js.map +0 -1
- package/lib/module/client.js +0 -849
- package/lib/module/client.js.map +0 -1
- package/lib/module/utils/defaultConfig.js +0 -12
- package/lib/module/utils/defaultConfig.js.map +0 -1
- package/lib/module/utils/helpers.js +0 -20
- package/lib/module/utils/helpers.js.map +0 -1
- package/lib/typescript/client.d.ts +0 -65
- package/lib/typescript/client.d.ts.map +0 -1
- package/lib/typescript/utils/defaultConfig.d.ts +0 -7
- package/lib/typescript/utils/defaultConfig.d.ts.map +0 -1
- package/lib/typescript/utils/helpers.d.ts +0 -10
- package/lib/typescript/utils/helpers.d.ts.map +0 -1
- package/src/client.ts +0 -1071
- package/src/utils/defaultConfig.ts +0 -19
- package/src/utils/helpers.ts +0 -27
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EthersAdapter = void 0;
|
|
7
|
+
var _ethers = require("ethers");
|
|
8
|
+
var _appkitCommonReactNative = require("@reown/appkit-common-react-native");
|
|
9
|
+
var _appkitScaffoldUtilsReactNative = require("@reown/appkit-scaffold-utils-react-native");
|
|
10
|
+
class EthersAdapter extends _appkitCommonReactNative.EVMAdapter {
|
|
11
|
+
static supportedNamespace = 'eip155';
|
|
12
|
+
constructor(configParams) {
|
|
13
|
+
super({
|
|
14
|
+
projectId: configParams.projectId,
|
|
15
|
+
supportedNamespace: EthersAdapter.supportedNamespace
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async getBalance(params) {
|
|
19
|
+
const {
|
|
20
|
+
network,
|
|
21
|
+
address
|
|
22
|
+
} = params;
|
|
23
|
+
if (!this.connector) throw new Error('No active connector');
|
|
24
|
+
if (!network) throw new Error('No network provided');
|
|
25
|
+
const balanceAddress = address || this.getAccounts()?.find(account => account.includes(network.id.toString()));
|
|
26
|
+
let balance = {
|
|
27
|
+
amount: '0.00',
|
|
28
|
+
symbol: network.nativeCurrency.symbol || 'ETH'
|
|
29
|
+
};
|
|
30
|
+
if (!balanceAddress) {
|
|
31
|
+
return Promise.resolve(balance);
|
|
32
|
+
}
|
|
33
|
+
const account = balanceAddress.split(':')[2];
|
|
34
|
+
try {
|
|
35
|
+
const jsonRpcProvider = new _ethers.JsonRpcProvider(network.rpcUrls.default.http[0], {
|
|
36
|
+
chainId: Number(network.id),
|
|
37
|
+
name: network.name
|
|
38
|
+
});
|
|
39
|
+
if (jsonRpcProvider && account) {
|
|
40
|
+
const _balance = await jsonRpcProvider.getBalance(account);
|
|
41
|
+
const formattedBalance = (0, _ethers.formatEther)(_balance);
|
|
42
|
+
balance = {
|
|
43
|
+
amount: formattedBalance,
|
|
44
|
+
symbol: network.nativeCurrency.symbol || 'ETH'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
this.emit('balanceChanged', {
|
|
48
|
+
namespace: this.getSupportedNamespace(),
|
|
49
|
+
address: balanceAddress,
|
|
50
|
+
balance
|
|
51
|
+
});
|
|
52
|
+
return balance;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
return balance;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async switchNetwork(network) {
|
|
58
|
+
if (!this.connector) throw new Error('No active connector');
|
|
59
|
+
const provider = this.connector.getProvider();
|
|
60
|
+
if (!provider) throw new Error('No active provider');
|
|
61
|
+
try {
|
|
62
|
+
await provider.request({
|
|
63
|
+
method: 'wallet_switchEthereumChain',
|
|
64
|
+
params: [{
|
|
65
|
+
chainId: _appkitScaffoldUtilsReactNative.EthersHelpersUtil.numberToHexString(Number(network.id))
|
|
66
|
+
}] //TODO: check util
|
|
67
|
+
}, `${network.chainNamespace ?? 'eip155'}:${network.id}`);
|
|
68
|
+
} catch (switchError) {
|
|
69
|
+
const message = switchError?.message;
|
|
70
|
+
if (/(?<temp1>user rejected)/u.test(message?.toLowerCase())) {
|
|
71
|
+
throw new Error('Chain is not supported');
|
|
72
|
+
}
|
|
73
|
+
throw switchError;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
getAccounts() {
|
|
77
|
+
if (!this.connector) throw new Error('No active connector');
|
|
78
|
+
const namespaces = this.connector.getNamespaces();
|
|
79
|
+
return namespaces[this.getSupportedNamespace()]?.accounts;
|
|
80
|
+
}
|
|
81
|
+
disconnect() {
|
|
82
|
+
if (!this.connector) throw new Error('EthersAdapter:disconnect - No active connector');
|
|
83
|
+
return this.connector.disconnect();
|
|
84
|
+
}
|
|
85
|
+
async request(method, params) {
|
|
86
|
+
if (!this.connector) throw new Error('No active connector');
|
|
87
|
+
const provider = this.connector.getProvider();
|
|
88
|
+
return provider.request({
|
|
89
|
+
method,
|
|
90
|
+
params
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
getSupportedNamespace() {
|
|
94
|
+
return EthersAdapter.supportedNamespace;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.EthersAdapter = EthersAdapter;
|
|
98
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ethers","require","_appkitCommonReactNative","_appkitScaffoldUtilsReactNative","EthersAdapter","EVMAdapter","supportedNamespace","constructor","configParams","projectId","getBalance","params","network","address","connector","Error","balanceAddress","getAccounts","find","account","includes","id","toString","balance","amount","symbol","nativeCurrency","Promise","resolve","split","jsonRpcProvider","JsonRpcProvider","rpcUrls","default","http","chainId","Number","name","_balance","formattedBalance","formatEther","emit","namespace","getSupportedNamespace","error","switchNetwork","provider","getProvider","request","method","EthersHelpersUtil","numberToHexString","chainNamespace","switchError","message","test","toLowerCase","namespaces","getNamespaces","accounts","disconnect","exports"],"sourceRoot":"../../src","sources":["adapter.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAQA,IAAAE,+BAAA,GAAAF,OAAA;AAEO,MAAMG,aAAa,SAASC,mCAAU,CAAC;EAC5C,OAAeC,kBAAkB,GAAmB,QAAQ;EAE5DC,WAAWA,CAACC,YAAmC,EAAE;IAC/C,KAAK,CAAC;MACJC,SAAS,EAAED,YAAY,CAACC,SAAS;MACjCH,kBAAkB,EAAEF,aAAa,CAACE;IACpC,CAAC,CAAC;EACJ;EAEA,MAAMI,UAAUA,CAACC,MAAwB,EAA+B;IACtE,MAAM;MAAEC,OAAO;MAAEC;IAAQ,CAAC,GAAGF,MAAM;IAEnC,IAAI,CAAC,IAAI,CAACG,SAAS,EAAE,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;IAC3D,IAAI,CAACH,OAAO,EAAE,MAAM,IAAIG,KAAK,CAAC,qBAAqB,CAAC;IAEpD,MAAMC,cAAc,GAClBH,OAAO,IAAI,IAAI,CAACI,WAAW,CAAC,CAAC,EAAEC,IAAI,CAACC,OAAO,IAAIA,OAAO,CAACC,QAAQ,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AAE;IAC5C,IAAI,CAAC,IAAI,CAACG,SAAS,EAAE,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;IAC3D,MAAM+B,QAAQ,GAAG,IAAI,CAAChC,SAAS,CAACiC,WAAW,CAAC,CAAC;IAE7C,OAAOD,QAAQ,CAACE,OAAO,CAAC;MAAEC,MAAM;MAAEtC;IAAO,CAAC,CAAC;EAC7C;EAEAgC,qBAAqBA,CAAA,EAAmB;IACtC,OAAOvC,aAAa,CAACE,kBAAkB;EACzC;AACF;AAACuD,OAAA,CAAAzD,aAAA,GAAAA,aAAA"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,182 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "EthersAdapter", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _adapter.EthersAdapter;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _appkitScaffoldReactNative.AppKit;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "AppKitButton", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _appkitScaffoldReactNative.AppKitButton;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "ConnectButton", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _appkitScaffoldReactNative.ConnectButton;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "NetworkButton", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _appkitScaffoldReactNative.NetworkButton;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
exports.createAppKit = createAppKit;
|
|
37
|
-
Object.defineProperty(exports, "defaultConfig", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _defaultConfig.defaultConfig;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
exports.useAppKit = useAppKit;
|
|
44
|
-
exports.useAppKitAccount = useAppKitAccount;
|
|
45
|
-
exports.useAppKitError = useAppKitError;
|
|
46
|
-
exports.useAppKitEventSubscription = useAppKitEventSubscription;
|
|
47
|
-
exports.useAppKitEvents = useAppKitEvents;
|
|
48
|
-
exports.useAppKitProvider = useAppKitProvider;
|
|
49
|
-
exports.useAppKitState = useAppKitState;
|
|
50
|
-
exports.useDisconnect = useDisconnect;
|
|
51
|
-
exports.useWalletInfo = useWalletInfo;
|
|
52
|
-
var _react = require("react");
|
|
53
|
-
var _valtio = require("valtio");
|
|
54
|
-
var _appkitScaffoldUtilsReactNative = require("@reown/appkit-scaffold-utils-react-native");
|
|
55
|
-
var _appkitScaffoldReactNative = require("@reown/appkit-scaffold-react-native");
|
|
56
|
-
var _appkitCommonReactNative = require("@reown/appkit-common-react-native");
|
|
57
|
-
var _defaultConfig = require("./utils/defaultConfig");
|
|
58
|
-
var _client = require("./client");
|
|
59
|
-
// -- Types -------------------------------------------------------------------
|
|
60
|
-
|
|
61
|
-
// -- Setup -------------------------------------------------------------------
|
|
62
|
-
let modal;
|
|
63
|
-
function createAppKit(options) {
|
|
64
|
-
if (!modal) {
|
|
65
|
-
modal = new _client.AppKit({
|
|
66
|
-
...options,
|
|
67
|
-
_sdkVersion: `react-native-ethers-${_appkitCommonReactNative.ConstantsUtil.VERSION}`
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return modal;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// -- Hooks -------------------------------------------------------------------
|
|
74
|
-
function useAppKit() {
|
|
75
|
-
if (!modal) {
|
|
76
|
-
throw new Error('Please call "createAppKit" before using "useAppKit" hook');
|
|
77
|
-
}
|
|
78
|
-
async function open(options) {
|
|
79
|
-
await modal?.open(options);
|
|
80
|
-
}
|
|
81
|
-
async function close() {
|
|
82
|
-
await modal?.close();
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
open,
|
|
86
|
-
close
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function useAppKitState() {
|
|
90
|
-
if (!modal) {
|
|
91
|
-
throw new Error('Please call "createAppKit" before using "useAppKitState" hook');
|
|
92
|
-
}
|
|
93
|
-
const [state, setState] = (0, _react.useState)(modal.getState());
|
|
94
|
-
(0, _react.useEffect)(() => {
|
|
95
|
-
const unsubscribe = modal?.subscribeState(newState => {
|
|
96
|
-
if (newState) setState({
|
|
97
|
-
...newState
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
return () => {
|
|
101
|
-
unsubscribe?.();
|
|
102
|
-
};
|
|
103
|
-
}, []);
|
|
104
|
-
return state;
|
|
105
|
-
}
|
|
106
|
-
function useAppKitProvider() {
|
|
107
|
-
const {
|
|
108
|
-
provider,
|
|
109
|
-
providerType
|
|
110
|
-
} = (0, _valtio.useSnapshot)(_appkitScaffoldUtilsReactNative.EthersStoreUtil.state);
|
|
111
|
-
const walletProvider = provider;
|
|
112
|
-
const walletProviderType = providerType;
|
|
113
|
-
return {
|
|
114
|
-
walletProvider,
|
|
115
|
-
walletProviderType
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function useDisconnect() {
|
|
119
|
-
async function disconnect() {
|
|
120
|
-
await modal?.disconnect();
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
disconnect
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function useAppKitAccount() {
|
|
127
|
-
const {
|
|
128
|
-
address,
|
|
129
|
-
isConnected,
|
|
130
|
-
chainId
|
|
131
|
-
} = (0, _valtio.useSnapshot)(_appkitScaffoldUtilsReactNative.EthersStoreUtil.state);
|
|
132
|
-
return {
|
|
133
|
-
address,
|
|
134
|
-
isConnected,
|
|
135
|
-
chainId
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function useWalletInfo() {
|
|
139
|
-
if (!modal) {
|
|
140
|
-
throw new Error('Please call "createAppKit" before using "useWalletInfo" hook');
|
|
141
|
-
}
|
|
142
|
-
const walletInfo = (0, _react.useSyncExternalStore)(modal.subscribeWalletInfo, modal.getWalletInfo, modal.getWalletInfo);
|
|
143
|
-
return {
|
|
144
|
-
walletInfo
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function useAppKitError() {
|
|
148
|
-
const {
|
|
149
|
-
error
|
|
150
|
-
} = (0, _valtio.useSnapshot)(_appkitScaffoldUtilsReactNative.EthersStoreUtil.state);
|
|
151
|
-
return {
|
|
152
|
-
error
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function useAppKitEvents(callback) {
|
|
156
|
-
if (!modal) {
|
|
157
|
-
throw new Error('Please call "createAppKit" before using "useAppKitEvents" hook');
|
|
158
|
-
}
|
|
159
|
-
const [event, setEvents] = (0, _react.useState)(modal.getEvent());
|
|
160
|
-
(0, _react.useEffect)(() => {
|
|
161
|
-
const unsubscribe = modal?.subscribeEvents(newEvent => {
|
|
162
|
-
setEvents({
|
|
163
|
-
...newEvent
|
|
164
|
-
});
|
|
165
|
-
callback?.(newEvent);
|
|
166
|
-
});
|
|
167
|
-
return () => {
|
|
168
|
-
unsubscribe?.();
|
|
169
|
-
};
|
|
170
|
-
}, [callback]);
|
|
171
|
-
return event;
|
|
172
|
-
}
|
|
173
|
-
function useAppKitEventSubscription(event, callback) {
|
|
174
|
-
if (!modal) {
|
|
175
|
-
throw new Error('Please call "createAppKit" before using "useAppKitEventSubscription" hook');
|
|
176
|
-
}
|
|
177
|
-
(0, _react.useEffect)(() => {
|
|
178
|
-
const unsubscribe = modal?.subscribeEvent(event, callback);
|
|
179
|
-
return () => {
|
|
180
|
-
unsubscribe?.();
|
|
181
|
-
};
|
|
182
|
-
}, [callback, event]);
|
|
183
|
-
}
|
|
12
|
+
var _adapter = require("./adapter");
|
|
184
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_adapter","require"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { formatEther, JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { EVMAdapter } from '@reown/appkit-common-react-native';
|
|
3
|
+
import { EthersHelpersUtil } from '@reown/appkit-scaffold-utils-react-native';
|
|
4
|
+
export class EthersAdapter extends EVMAdapter {
|
|
5
|
+
static supportedNamespace = 'eip155';
|
|
6
|
+
constructor(configParams) {
|
|
7
|
+
super({
|
|
8
|
+
projectId: configParams.projectId,
|
|
9
|
+
supportedNamespace: EthersAdapter.supportedNamespace
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async getBalance(params) {
|
|
13
|
+
const {
|
|
14
|
+
network,
|
|
15
|
+
address
|
|
16
|
+
} = params;
|
|
17
|
+
if (!this.connector) throw new Error('No active connector');
|
|
18
|
+
if (!network) throw new Error('No network provided');
|
|
19
|
+
const balanceAddress = address || this.getAccounts()?.find(account => account.includes(network.id.toString()));
|
|
20
|
+
let balance = {
|
|
21
|
+
amount: '0.00',
|
|
22
|
+
symbol: network.nativeCurrency.symbol || 'ETH'
|
|
23
|
+
};
|
|
24
|
+
if (!balanceAddress) {
|
|
25
|
+
return Promise.resolve(balance);
|
|
26
|
+
}
|
|
27
|
+
const account = balanceAddress.split(':')[2];
|
|
28
|
+
try {
|
|
29
|
+
const jsonRpcProvider = new JsonRpcProvider(network.rpcUrls.default.http[0], {
|
|
30
|
+
chainId: Number(network.id),
|
|
31
|
+
name: network.name
|
|
32
|
+
});
|
|
33
|
+
if (jsonRpcProvider && account) {
|
|
34
|
+
const _balance = await jsonRpcProvider.getBalance(account);
|
|
35
|
+
const formattedBalance = formatEther(_balance);
|
|
36
|
+
balance = {
|
|
37
|
+
amount: formattedBalance,
|
|
38
|
+
symbol: network.nativeCurrency.symbol || 'ETH'
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
this.emit('balanceChanged', {
|
|
42
|
+
namespace: this.getSupportedNamespace(),
|
|
43
|
+
address: balanceAddress,
|
|
44
|
+
balance
|
|
45
|
+
});
|
|
46
|
+
return balance;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return balance;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async switchNetwork(network) {
|
|
52
|
+
if (!this.connector) throw new Error('No active connector');
|
|
53
|
+
const provider = this.connector.getProvider();
|
|
54
|
+
if (!provider) throw new Error('No active provider');
|
|
55
|
+
try {
|
|
56
|
+
await provider.request({
|
|
57
|
+
method: 'wallet_switchEthereumChain',
|
|
58
|
+
params: [{
|
|
59
|
+
chainId: EthersHelpersUtil.numberToHexString(Number(network.id))
|
|
60
|
+
}] //TODO: check util
|
|
61
|
+
}, `${network.chainNamespace ?? 'eip155'}:${network.id}`);
|
|
62
|
+
} catch (switchError) {
|
|
63
|
+
const message = switchError?.message;
|
|
64
|
+
if (/(?<temp1>user rejected)/u.test(message?.toLowerCase())) {
|
|
65
|
+
throw new Error('Chain is not supported');
|
|
66
|
+
}
|
|
67
|
+
throw switchError;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
getAccounts() {
|
|
71
|
+
if (!this.connector) throw new Error('No active connector');
|
|
72
|
+
const namespaces = this.connector.getNamespaces();
|
|
73
|
+
return namespaces[this.getSupportedNamespace()]?.accounts;
|
|
74
|
+
}
|
|
75
|
+
disconnect() {
|
|
76
|
+
if (!this.connector) throw new Error('EthersAdapter:disconnect - No active connector');
|
|
77
|
+
return this.connector.disconnect();
|
|
78
|
+
}
|
|
79
|
+
async request(method, params) {
|
|
80
|
+
if (!this.connector) throw new Error('No active connector');
|
|
81
|
+
const provider = this.connector.getProvider();
|
|
82
|
+
return provider.request({
|
|
83
|
+
method,
|
|
84
|
+
params
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
getSupportedNamespace() {
|
|
88
|
+
return EthersAdapter.supportedNamespace;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["formatEther","JsonRpcProvider","EVMAdapter","EthersHelpersUtil","EthersAdapter","supportedNamespace","constructor","configParams","projectId","getBalance","params","network","address","connector","Error","balanceAddress","getAccounts","find","account","includes","id","toString","balance","amount","symbol","nativeCurrency","Promise","resolve","split","jsonRpcProvider","rpcUrls","default","http","chainId","Number","name","_balance","formattedBalance","emit","namespace","getSupportedNamespace","error","switchNetwork","provider","getProvider","request","method","numberToHexString","chainNamespace","switchError","message","test","toLowerCase","namespaces","getNamespaces","accounts","disconnect"],"sourceRoot":"../../src","sources":["adapter.ts"],"mappings":"AAAA,SAASA,WAAW,EAAEC,eAAe,QAAQ,QAAQ;AACrD,SACEC,UAAU,QAML,mCAAmC;AAC1C,SAASC,iBAAiB,QAAQ,2CAA2C;AAE7E,OAAO,MAAMC,aAAa,SAASF,UAAU,CAAC;EAC5C,OAAeG,kBAAkB,GAAmB,QAAQ;EAE5DC,WAAWA,CAACC,YAAmC,EAAE;IAC/C,KAAK,CAAC;MACJC,SAAS,EAAED,YAAY,CAACC,SAAS;MACjCH,kBAAkB,EAAED,aAAa,CAACC;IACpC,CAAC,CAAC;EACJ;EAEA,MAAMI,UAAUA,CAACC,MAAwB,EAA+B;IACtE,MAAM;MAAEC,OAAO;MAAEC;IAAQ,CAAC,GAAGF,MAAM;IAEnC,IAAI,CAAC,IAAI,CAACG,SAAS,EAAE,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;IAC3D,IAAI,CAACH,OAAO,EAAE,MAAM,IAAIG,KAAK,CAAC,qBAAqB,CAAC;IAEpD,MAAMC,cAAc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I,CAACD,SAAS,CAAC2C,UAAU,CAAC,CAAC;EACpC;EAEA,MAAMX,OAAOA,CAACC,MAAc,EAAEpC,MAAc,EAAE;IAC5C,IAAI,CAAC,IAAI,CAACG,SAAS,EAAE,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;IAC3D,MAAM6B,QAAQ,GAAG,IAAI,CAAC9B,SAAS,CAAC+B,WAAW,CAAC,CAAC;IAE7C,OAAOD,QAAQ,CAACE,OAAO,CAAC;MAAEC,MAAM;MAAEpC;IAAO,CAAC,CAAC;EAC7C;EAEA8B,qBAAqBA,CAAA,EAAmB;IACtC,OAAOpC,aAAa,CAACC,kBAAkB;EACzC;AACF"}
|
package/lib/module/index.js
CHANGED
|
@@ -1,134 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { EthersStoreUtil } from '@reown/appkit-scaffold-utils-react-native';
|
|
4
|
-
export { AccountButton, AppKitButton, ConnectButton, NetworkButton, AppKit } from '@reown/appkit-scaffold-react-native';
|
|
5
|
-
import { ConstantsUtil } from '@reown/appkit-common-react-native';
|
|
6
|
-
export { defaultConfig } from './utils/defaultConfig';
|
|
7
|
-
import { AppKit } from './client';
|
|
8
|
-
|
|
9
|
-
// -- Types -------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
// -- Setup -------------------------------------------------------------------
|
|
12
|
-
let modal;
|
|
13
|
-
export function createAppKit(options) {
|
|
14
|
-
if (!modal) {
|
|
15
|
-
modal = new AppKit({
|
|
16
|
-
...options,
|
|
17
|
-
_sdkVersion: `react-native-ethers-${ConstantsUtil.VERSION}`
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return modal;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// -- Hooks -------------------------------------------------------------------
|
|
24
|
-
export function useAppKit() {
|
|
25
|
-
if (!modal) {
|
|
26
|
-
throw new Error('Please call "createAppKit" before using "useAppKit" hook');
|
|
27
|
-
}
|
|
28
|
-
async function open(options) {
|
|
29
|
-
await modal?.open(options);
|
|
30
|
-
}
|
|
31
|
-
async function close() {
|
|
32
|
-
await modal?.close();
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
open,
|
|
36
|
-
close
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export function useAppKitState() {
|
|
40
|
-
if (!modal) {
|
|
41
|
-
throw new Error('Please call "createAppKit" before using "useAppKitState" hook');
|
|
42
|
-
}
|
|
43
|
-
const [state, setState] = useState(modal.getState());
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const unsubscribe = modal?.subscribeState(newState => {
|
|
46
|
-
if (newState) setState({
|
|
47
|
-
...newState
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return () => {
|
|
51
|
-
unsubscribe?.();
|
|
52
|
-
};
|
|
53
|
-
}, []);
|
|
54
|
-
return state;
|
|
55
|
-
}
|
|
56
|
-
export function useAppKitProvider() {
|
|
57
|
-
const {
|
|
58
|
-
provider,
|
|
59
|
-
providerType
|
|
60
|
-
} = useSnapshot(EthersStoreUtil.state);
|
|
61
|
-
const walletProvider = provider;
|
|
62
|
-
const walletProviderType = providerType;
|
|
63
|
-
return {
|
|
64
|
-
walletProvider,
|
|
65
|
-
walletProviderType
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export function useDisconnect() {
|
|
69
|
-
async function disconnect() {
|
|
70
|
-
await modal?.disconnect();
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
disconnect
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export function useAppKitAccount() {
|
|
77
|
-
const {
|
|
78
|
-
address,
|
|
79
|
-
isConnected,
|
|
80
|
-
chainId
|
|
81
|
-
} = useSnapshot(EthersStoreUtil.state);
|
|
82
|
-
return {
|
|
83
|
-
address,
|
|
84
|
-
isConnected,
|
|
85
|
-
chainId
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
export function useWalletInfo() {
|
|
89
|
-
if (!modal) {
|
|
90
|
-
throw new Error('Please call "createAppKit" before using "useWalletInfo" hook');
|
|
91
|
-
}
|
|
92
|
-
const walletInfo = useSyncExternalStore(modal.subscribeWalletInfo, modal.getWalletInfo, modal.getWalletInfo);
|
|
93
|
-
return {
|
|
94
|
-
walletInfo
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export function useAppKitError() {
|
|
98
|
-
const {
|
|
99
|
-
error
|
|
100
|
-
} = useSnapshot(EthersStoreUtil.state);
|
|
101
|
-
return {
|
|
102
|
-
error
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
export function useAppKitEvents(callback) {
|
|
106
|
-
if (!modal) {
|
|
107
|
-
throw new Error('Please call "createAppKit" before using "useAppKitEvents" hook');
|
|
108
|
-
}
|
|
109
|
-
const [event, setEvents] = useState(modal.getEvent());
|
|
110
|
-
useEffect(() => {
|
|
111
|
-
const unsubscribe = modal?.subscribeEvents(newEvent => {
|
|
112
|
-
setEvents({
|
|
113
|
-
...newEvent
|
|
114
|
-
});
|
|
115
|
-
callback?.(newEvent);
|
|
116
|
-
});
|
|
117
|
-
return () => {
|
|
118
|
-
unsubscribe?.();
|
|
119
|
-
};
|
|
120
|
-
}, [callback]);
|
|
121
|
-
return event;
|
|
122
|
-
}
|
|
123
|
-
export function useAppKitEventSubscription(event, callback) {
|
|
124
|
-
if (!modal) {
|
|
125
|
-
throw new Error('Please call "createAppKit" before using "useAppKitEventSubscription" hook');
|
|
126
|
-
}
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
const unsubscribe = modal?.subscribeEvent(event, callback);
|
|
129
|
-
return () => {
|
|
130
|
-
unsubscribe?.();
|
|
131
|
-
};
|
|
132
|
-
}, [callback, event]);
|
|
133
|
-
}
|
|
1
|
+
import { EthersAdapter } from './adapter';
|
|
2
|
+
export { EthersAdapter };
|
|
134
3
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["EthersAdapter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,WAAW;AACzC,SAASA,aAAa"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EVMAdapter, type AppKitNetwork, type CaipAddress, type ChainNamespace, type GetBalanceParams, type GetBalanceResponse } from '@reown/appkit-common-react-native';
|
|
2
|
+
export declare class EthersAdapter extends EVMAdapter {
|
|
3
|
+
private static supportedNamespace;
|
|
4
|
+
constructor(configParams: {
|
|
5
|
+
projectId: string;
|
|
6
|
+
});
|
|
7
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResponse>;
|
|
8
|
+
switchNetwork(network: AppKitNetwork): Promise<void>;
|
|
9
|
+
getAccounts(): CaipAddress[] | undefined;
|
|
10
|
+
disconnect(): Promise<void>;
|
|
11
|
+
request(method: string, params?: any[]): Promise<unknown>;
|
|
12
|
+
getSupportedNamespace(): ChainNamespace;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,mCAAmC,CAAC;AAG3C,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAA4B;gBAEjD,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE;IAOzC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA0CjE,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB1D,WAAW,IAAI,WAAW,EAAE,GAAG,SAAS;IAOxC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE;IAO5C,qBAAqB,IAAI,cAAc;CAGxC"}
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import type { EventName, EventsControllerState } from '@reown/appkit-scaffold-react-native';
|
|
4
|
-
export { defaultConfig } from './utils/defaultConfig';
|
|
5
|
-
import type { AppKitOptions } from './client';
|
|
6
|
-
import { AppKit } from './client';
|
|
7
|
-
export type { AppKitOptions } from './client';
|
|
8
|
-
type OpenOptions = Parameters<AppKit['open']>[0];
|
|
9
|
-
export declare function createAppKit(options: AppKitOptions): AppKit;
|
|
10
|
-
export declare function useAppKit(): {
|
|
11
|
-
open: (options?: OpenOptions) => Promise<void>;
|
|
12
|
-
close: () => Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
export declare function useAppKitState(): {
|
|
15
|
-
selectedNetworkId: number | undefined;
|
|
16
|
-
open: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare function useAppKitProvider(): {
|
|
19
|
-
walletProvider: Provider | undefined;
|
|
20
|
-
walletProviderType: "WALLET_CONNECT" | "COINBASE" | "AUTH" | "EXTERNAL" | undefined;
|
|
21
|
-
};
|
|
22
|
-
export declare function useDisconnect(): {
|
|
23
|
-
disconnect: () => Promise<void>;
|
|
24
|
-
};
|
|
25
|
-
export declare function useAppKitAccount(): {
|
|
26
|
-
address: `0x${string}` | undefined;
|
|
27
|
-
isConnected: boolean;
|
|
28
|
-
chainId: number | undefined;
|
|
29
|
-
};
|
|
30
|
-
export declare function useWalletInfo(): {
|
|
31
|
-
walletInfo: import("@reown/appkit-scaffold-react-native").ConnectedWalletInfo;
|
|
32
|
-
};
|
|
33
|
-
export declare function useAppKitError(): {
|
|
34
|
-
error: unknown;
|
|
35
|
-
};
|
|
36
|
-
export declare function useAppKitEvents(callback?: (newEvent: EventsControllerState) => void): {
|
|
37
|
-
timestamp: number;
|
|
38
|
-
data: import("@reown/appkit-scaffold-react-native").Event;
|
|
39
|
-
};
|
|
40
|
-
export declare function useAppKitEventSubscription(event: EventName, callback: (newEvent: EventsControllerState) => void): void;
|
|
1
|
+
import { EthersAdapter } from './adapter';
|
|
2
|
+
export { EthersAdapter };
|
|
41
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-ethers-react-native",
|
|
3
|
-
"version": "0.0.0-feat-
|
|
3
|
+
"version": "0.0.0-feat-multichain-20250513150920",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@reown/appkit-common-react-native": "0.0.0-feat-
|
|
42
|
-
"@reown/appkit-
|
|
43
|
-
"@reown/appkit-scaffold-utils-react-native": "0.0.0-feat-
|
|
44
|
-
"@reown/appkit-siwe-react-native": "0.0.0-feat-
|
|
45
|
-
"@walletconnect/ethereum-provider": "2.
|
|
41
|
+
"@reown/appkit-common-react-native": "0.0.0-feat-multichain-20250513150920",
|
|
42
|
+
"@reown/appkit-react-native": "0.0.0-feat-multichain-20250513150920",
|
|
43
|
+
"@reown/appkit-scaffold-utils-react-native": "0.0.0-feat-multichain-20250513150920",
|
|
44
|
+
"@reown/appkit-siwe-react-native": "0.0.0-feat-multichain-20250513150920",
|
|
45
|
+
"@walletconnect/ethereum-provider": "2.20.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@react-native-async-storage/async-storage": ">=1.17.0",
|