@getpara/cosmos-wallet-connectors 3.5.0 → 3.6.0
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.
|
@@ -149,17 +149,17 @@ function CosmosExternalWalletProvider({
|
|
|
149
149
|
if (!para.isSetup) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const initializeConfig = () => __async(
|
|
152
|
+
const initializeConfig = () => __async(null, null, function* () {
|
|
153
153
|
yield para.initExternalWalletProvider({
|
|
154
154
|
type: "COSMOS",
|
|
155
155
|
interface: {
|
|
156
|
-
disconnect: () => __async(
|
|
156
|
+
disconnect: () => __async(null, null, function* () {
|
|
157
157
|
yield disconnectAsync();
|
|
158
158
|
}),
|
|
159
|
-
getAddress: () => __async(
|
|
159
|
+
getAddress: () => __async(null, null, function* () {
|
|
160
160
|
return ethAddressRef.current;
|
|
161
161
|
}),
|
|
162
|
-
signMessage: (_0) => __async(
|
|
162
|
+
signMessage: (_0) => __async(null, [_0], function* ({ message }) {
|
|
163
163
|
try {
|
|
164
164
|
const wallet = grazGetWallet(walletType);
|
|
165
165
|
const signAddress = bech32AddressRef.current;
|
|
@@ -194,7 +194,7 @@ function CosmosExternalWalletProvider({
|
|
|
194
194
|
walletChangeCallbackRef.current = null;
|
|
195
195
|
};
|
|
196
196
|
},
|
|
197
|
-
connectParaConnector: () => __async(
|
|
197
|
+
connectParaConnector: () => __async(null, null, function* () {
|
|
198
198
|
const chainId = multiChain ? chains.map((c) => c.chainId) : selectedChainId;
|
|
199
199
|
yield connectAsync({ walletType: GrazWalletType.PARA, chainId });
|
|
200
200
|
})
|
|
@@ -204,7 +204,7 @@ function CosmosExternalWalletProvider({
|
|
|
204
204
|
initializeConfig();
|
|
205
205
|
}, [para.isSetup]);
|
|
206
206
|
const switchChain = useCallback(
|
|
207
|
-
(chainId) => __async(
|
|
207
|
+
(chainId) => __async(null, null, function* () {
|
|
208
208
|
var _a2;
|
|
209
209
|
let error;
|
|
210
210
|
let changeResp = {};
|
|
@@ -261,7 +261,7 @@ function CosmosExternalWalletProvider({
|
|
|
261
261
|
]
|
|
262
262
|
);
|
|
263
263
|
const switchAccount = useCallback(
|
|
264
|
-
(connectorName) => __async(
|
|
264
|
+
(connectorName) => __async(null, null, function* () {
|
|
265
265
|
const chainId = multiChain ? chains.map((c) => c.chainId) : selectedChainId;
|
|
266
266
|
yield connectAsync({
|
|
267
267
|
walletType: connectorName.toLowerCase(),
|
|
@@ -271,7 +271,7 @@ function CosmosExternalWalletProvider({
|
|
|
271
271
|
[chains, connectAsync, multiChain, selectedChainId]
|
|
272
272
|
);
|
|
273
273
|
const signMessageBase = useCallback(
|
|
274
|
-
(_0) => __async(
|
|
274
|
+
(_0) => __async(null, [_0], function* ({
|
|
275
275
|
message,
|
|
276
276
|
wallet,
|
|
277
277
|
bech32Address,
|
|
@@ -297,7 +297,7 @@ function CosmosExternalWalletProvider({
|
|
|
297
297
|
[selectedChainId]
|
|
298
298
|
);
|
|
299
299
|
const signMessage = useCallback(
|
|
300
|
-
(_0) => __async(
|
|
300
|
+
(_0) => __async(null, [_0], function* ({ message, externalWallet }) {
|
|
301
301
|
let wallet, bech32Address, ethAddress;
|
|
302
302
|
if (externalWallet) {
|
|
303
303
|
const commonWallet = getExternalWalletMetadata(externalWallet);
|
|
@@ -335,7 +335,7 @@ function CosmosExternalWalletProvider({
|
|
|
335
335
|
[getExternalWalletMetadata, signMessageBase, walletType]
|
|
336
336
|
);
|
|
337
337
|
const connectBase = useCallback(
|
|
338
|
-
(walletType2, chainId) => __async(
|
|
338
|
+
(walletType2, chainId) => __async(null, null, function* () {
|
|
339
339
|
var _a2, _b2;
|
|
340
340
|
if (!chainId) {
|
|
341
341
|
yield disconnectAsync();
|
|
@@ -414,7 +414,7 @@ function CosmosExternalWalletProvider({
|
|
|
414
414
|
);
|
|
415
415
|
const connectCallback = useCallback(
|
|
416
416
|
(walletType2) => {
|
|
417
|
-
return () => __async(
|
|
417
|
+
return () => __async(null, null, function* () {
|
|
418
418
|
try {
|
|
419
419
|
const _chainId = multiChain ? chains.map((c) => c.chainId) : selectedChainId;
|
|
420
420
|
const firstChain = typeof _chainId === "string" ? _chainId : _chainId[0];
|
|
@@ -430,7 +430,7 @@ function CosmosExternalWalletProvider({
|
|
|
430
430
|
[chains, connectBase, multiChain, selectedChainId]
|
|
431
431
|
);
|
|
432
432
|
const connect = useCallback(
|
|
433
|
-
(walletType2) => __async(
|
|
433
|
+
(walletType2) => __async(null, null, function* () {
|
|
434
434
|
var _a2, _b2;
|
|
435
435
|
updateExternalWalletState({ isConnecting: true });
|
|
436
436
|
try {
|
|
@@ -474,7 +474,7 @@ function CosmosExternalWalletProvider({
|
|
|
474
474
|
}),
|
|
475
475
|
[chains]
|
|
476
476
|
);
|
|
477
|
-
const connectParaEmbedded = useCallback(() => __async(
|
|
477
|
+
const connectParaEmbedded = useCallback(() => __async(null, null, function* () {
|
|
478
478
|
if (!para) {
|
|
479
479
|
return { error: "No para instance available" };
|
|
480
480
|
}
|
|
@@ -488,7 +488,7 @@ function CosmosExternalWalletProvider({
|
|
|
488
488
|
}
|
|
489
489
|
}), [chains, connectAsync, multiChain, para, selectedChainId]);
|
|
490
490
|
const requestInfo = useCallback(
|
|
491
|
-
(providerId) => __async(
|
|
491
|
+
(providerId) => __async(null, null, function* () {
|
|
492
492
|
var _a2;
|
|
493
493
|
const wallet = wallets.find((w) => w.id === providerId);
|
|
494
494
|
if (!wallet) {
|
|
@@ -509,7 +509,7 @@ function CosmosExternalWalletProvider({
|
|
|
509
509
|
[chains, connectBase, multiChain, selectedChainId, wallets]
|
|
510
510
|
);
|
|
511
511
|
const disconnectBase = useCallback(
|
|
512
|
-
(_0, ..._1) => __async(
|
|
512
|
+
(_0, ..._1) => __async(null, [_0, ..._1], function* (_, { disconnectType } = {}) {
|
|
513
513
|
var _a2;
|
|
514
514
|
if (disconnectType) {
|
|
515
515
|
disconnectTypeRef.current = disconnectType;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/cosmos-wallet-connectors",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/graz-connector": "3.
|
|
6
|
-
"@getpara/react-common": "3.
|
|
7
|
-
"@getpara/web-sdk": "3.
|
|
5
|
+
"@getpara/graz-connector": "3.6.0",
|
|
6
|
+
"@getpara/react-common": "3.6.0",
|
|
7
|
+
"@getpara/web-sdk": "3.6.0",
|
|
8
8
|
"@leapwallet/cosmos-social-login-capsule-provider": "^0.0.41",
|
|
9
9
|
"zustand": "^4.5.2",
|
|
10
10
|
"zustand-sync-tabs": "^0.2.2"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist",
|
|
24
24
|
"package.json"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "565535ab0cf38d65f6996fc9f1ede52d133ddac0",
|
|
27
27
|
"main": "dist/index.js",
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"graz": ">=0.4.1",
|