@depay/web3-wallets-evm 17.4.8 → 17.6.1
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/README.md +5 -3
- package/dist/esm/index.evm.js +8 -3
- package/dist/esm/index.js +8 -3
- package/dist/esm/index.solana.js +3 -1
- package/dist/umd/index.evm.js +8 -3
- package/dist/umd/index.js +8 -3
- package/dist/umd/index.solana.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -222,11 +222,13 @@ await wallet.switchTo('bsc')
|
|
|
222
222
|
|
|
223
223
|
### Data Structure
|
|
224
224
|
|
|
225
|
+
`accepted: Function ()=>{}`: Callback that will be executed once the transaction has been accepted by the wallet but not sent to the network yet (e.g. relayer, World App). Has no transaction yet, as only sent can contain the transaction.
|
|
226
|
+
|
|
225
227
|
`api: Array`: Api of the contract (e.g. abi for Ethereum, Layout/Struct for Solana).
|
|
226
228
|
|
|
227
229
|
`blockchain: String`: Name of the blockchain e.g. 'ethereum'.
|
|
228
230
|
|
|
229
|
-
`failed: Function (transaction, error)=>{}`: Callback
|
|
231
|
+
`failed: Function (transaction, error)=>{}`: Callback that will be executed once the transaction failed onchain (reverted).
|
|
230
232
|
|
|
231
233
|
`from: String`: Address of the transaction sender.
|
|
232
234
|
|
|
@@ -242,9 +244,9 @@ await wallet.switchTo('bsc')
|
|
|
242
244
|
|
|
243
245
|
`params: Object or Array`: Parameters passed to the method (EVM).
|
|
244
246
|
|
|
245
|
-
`sent: Function (transaction)=>{}`: Callback
|
|
247
|
+
`sent: Function (transaction)=>{}`: Callback that will be executed executed once the transaction has been sent to the network.
|
|
246
248
|
|
|
247
|
-
`succeeded: Function (transaction)=>{}`: Callback
|
|
249
|
+
`succeeded: Function (transaction)=>{}`: Callback that will be executed once the transaction was successful and has been confirmed at least once by the network.
|
|
248
250
|
|
|
249
251
|
`to String`: Address of the contract to be transacted with (EVM).
|
|
250
252
|
|
package/dist/esm/index.evm.js
CHANGED
|
@@ -25,7 +25,8 @@ class Transaction {
|
|
|
25
25
|
alts,
|
|
26
26
|
sent,
|
|
27
27
|
succeeded,
|
|
28
|
-
failed
|
|
28
|
+
failed,
|
|
29
|
+
accepted,
|
|
29
30
|
}) {
|
|
30
31
|
|
|
31
32
|
// required
|
|
@@ -38,6 +39,7 @@ class Transaction {
|
|
|
38
39
|
this.api = api;
|
|
39
40
|
this.method = method;
|
|
40
41
|
this.params = params;
|
|
42
|
+
this.accepted = accepted;
|
|
41
43
|
this.sent = sent;
|
|
42
44
|
this.succeeded = succeeded;
|
|
43
45
|
this.failed = failed;
|
|
@@ -1651,6 +1653,9 @@ class WorldApp {
|
|
|
1651
1653
|
MiniKit.subscribe(ResponseEvent.MiniAppSendTransaction, (payload)=> {
|
|
1652
1654
|
console.log('payload', payload);
|
|
1653
1655
|
if (payload.status == "success") {
|
|
1656
|
+
console.log('before transaction.accepted', transaction);
|
|
1657
|
+
if (transaction.accepted) { transaction.accepted(); }
|
|
1658
|
+
console.log('after transaction.accepted', transaction);
|
|
1654
1659
|
this.fetchTransaction(transaction, payload).then((transactionHash)=>{
|
|
1655
1660
|
if(transactionHash) {
|
|
1656
1661
|
resolve(transaction);
|
|
@@ -1761,7 +1766,7 @@ class WorldApp {
|
|
|
1761
1766
|
|
|
1762
1767
|
MiniKit.subscribe(ResponseEvent.MiniAppWalletAuth, async (payload) => {
|
|
1763
1768
|
if (payload.status === "error") {
|
|
1764
|
-
return reject()
|
|
1769
|
+
return reject(payload.message)
|
|
1765
1770
|
} else {
|
|
1766
1771
|
return resolve(MiniKit.walletAddress)
|
|
1767
1772
|
}
|
|
@@ -1771,7 +1776,7 @@ class WorldApp {
|
|
|
1771
1776
|
nonce: crypto.randomUUID().replace(/-/g, ""),
|
|
1772
1777
|
expirationTime: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000),
|
|
1773
1778
|
notBefore: new Date(new Date().getTime() - 24 * 60 * 60 * 1000),
|
|
1774
|
-
statement: "Connect wallet (v17.
|
|
1779
|
+
statement: "Connect wallet (v17.6.0)"
|
|
1775
1780
|
});
|
|
1776
1781
|
|
|
1777
1782
|
})
|
package/dist/esm/index.js
CHANGED
|
@@ -22,7 +22,8 @@ class Transaction {
|
|
|
22
22
|
alts,
|
|
23
23
|
sent,
|
|
24
24
|
succeeded,
|
|
25
|
-
failed
|
|
25
|
+
failed,
|
|
26
|
+
accepted,
|
|
26
27
|
}) {
|
|
27
28
|
|
|
28
29
|
// required
|
|
@@ -35,6 +36,7 @@ class Transaction {
|
|
|
35
36
|
this.api = api;
|
|
36
37
|
this.method = method;
|
|
37
38
|
this.params = params;
|
|
39
|
+
this.accepted = accepted;
|
|
38
40
|
this.sent = sent;
|
|
39
41
|
this.succeeded = succeeded;
|
|
40
42
|
this.failed = failed;
|
|
@@ -2250,6 +2252,9 @@ class WorldApp {
|
|
|
2250
2252
|
MiniKit.subscribe(ResponseEvent.MiniAppSendTransaction, (payload)=> {
|
|
2251
2253
|
console.log('payload', payload);
|
|
2252
2254
|
if (payload.status == "success") {
|
|
2255
|
+
console.log('before transaction.accepted', transaction);
|
|
2256
|
+
if (transaction.accepted) { transaction.accepted(); }
|
|
2257
|
+
console.log('after transaction.accepted', transaction);
|
|
2253
2258
|
this.fetchTransaction(transaction, payload).then((transactionHash)=>{
|
|
2254
2259
|
if(transactionHash) {
|
|
2255
2260
|
resolve(transaction);
|
|
@@ -2360,7 +2365,7 @@ class WorldApp {
|
|
|
2360
2365
|
|
|
2361
2366
|
MiniKit.subscribe(ResponseEvent.MiniAppWalletAuth, async (payload) => {
|
|
2362
2367
|
if (payload.status === "error") {
|
|
2363
|
-
return reject()
|
|
2368
|
+
return reject(payload.message)
|
|
2364
2369
|
} else {
|
|
2365
2370
|
return resolve(MiniKit.walletAddress)
|
|
2366
2371
|
}
|
|
@@ -2370,7 +2375,7 @@ class WorldApp {
|
|
|
2370
2375
|
nonce: crypto.randomUUID().replace(/-/g, ""),
|
|
2371
2376
|
expirationTime: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000),
|
|
2372
2377
|
notBefore: new Date(new Date().getTime() - 24 * 60 * 60 * 1000),
|
|
2373
|
-
statement: "Connect wallet (v17.
|
|
2378
|
+
statement: "Connect wallet (v17.6.0)"
|
|
2374
2379
|
});
|
|
2375
2380
|
|
|
2376
2381
|
})
|
package/dist/esm/index.solana.js
CHANGED
|
@@ -19,7 +19,8 @@ class Transaction {
|
|
|
19
19
|
alts,
|
|
20
20
|
sent,
|
|
21
21
|
succeeded,
|
|
22
|
-
failed
|
|
22
|
+
failed,
|
|
23
|
+
accepted,
|
|
23
24
|
}) {
|
|
24
25
|
|
|
25
26
|
// required
|
|
@@ -32,6 +33,7 @@ class Transaction {
|
|
|
32
33
|
this.api = api;
|
|
33
34
|
this.method = method;
|
|
34
35
|
this.params = params;
|
|
36
|
+
this.accepted = accepted;
|
|
35
37
|
this.sent = sent;
|
|
36
38
|
this.succeeded = succeeded;
|
|
37
39
|
this.failed = failed;
|
package/dist/umd/index.evm.js
CHANGED
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
alts,
|
|
29
29
|
sent,
|
|
30
30
|
succeeded,
|
|
31
|
-
failed
|
|
31
|
+
failed,
|
|
32
|
+
accepted,
|
|
32
33
|
}) {
|
|
33
34
|
|
|
34
35
|
// required
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
this.api = api;
|
|
42
43
|
this.method = method;
|
|
43
44
|
this.params = params;
|
|
45
|
+
this.accepted = accepted;
|
|
44
46
|
this.sent = sent;
|
|
45
47
|
this.succeeded = succeeded;
|
|
46
48
|
this.failed = failed;
|
|
@@ -1654,6 +1656,9 @@
|
|
|
1654
1656
|
worldcoinPrecompiled.MiniKit.subscribe(worldcoinPrecompiled.ResponseEvent.MiniAppSendTransaction, (payload)=> {
|
|
1655
1657
|
console.log('payload', payload);
|
|
1656
1658
|
if (payload.status == "success") {
|
|
1659
|
+
console.log('before transaction.accepted', transaction);
|
|
1660
|
+
if (transaction.accepted) { transaction.accepted(); }
|
|
1661
|
+
console.log('after transaction.accepted', transaction);
|
|
1657
1662
|
this.fetchTransaction(transaction, payload).then((transactionHash)=>{
|
|
1658
1663
|
if(transactionHash) {
|
|
1659
1664
|
resolve(transaction);
|
|
@@ -1764,7 +1769,7 @@
|
|
|
1764
1769
|
|
|
1765
1770
|
worldcoinPrecompiled.MiniKit.subscribe(worldcoinPrecompiled.ResponseEvent.MiniAppWalletAuth, async (payload) => {
|
|
1766
1771
|
if (payload.status === "error") {
|
|
1767
|
-
return reject()
|
|
1772
|
+
return reject(payload.message)
|
|
1768
1773
|
} else {
|
|
1769
1774
|
return resolve(worldcoinPrecompiled.MiniKit.walletAddress)
|
|
1770
1775
|
}
|
|
@@ -1774,7 +1779,7 @@
|
|
|
1774
1779
|
nonce: crypto.randomUUID().replace(/-/g, ""),
|
|
1775
1780
|
expirationTime: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000),
|
|
1776
1781
|
notBefore: new Date(new Date().getTime() - 24 * 60 * 60 * 1000),
|
|
1777
|
-
statement: "Connect wallet (v17.
|
|
1782
|
+
statement: "Connect wallet (v17.6.0)"
|
|
1778
1783
|
});
|
|
1779
1784
|
|
|
1780
1785
|
})
|
package/dist/umd/index.js
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
alts,
|
|
25
25
|
sent,
|
|
26
26
|
succeeded,
|
|
27
|
-
failed
|
|
27
|
+
failed,
|
|
28
|
+
accepted,
|
|
28
29
|
}) {
|
|
29
30
|
|
|
30
31
|
// required
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
this.api = api;
|
|
38
39
|
this.method = method;
|
|
39
40
|
this.params = params;
|
|
41
|
+
this.accepted = accepted;
|
|
40
42
|
this.sent = sent;
|
|
41
43
|
this.succeeded = succeeded;
|
|
42
44
|
this.failed = failed;
|
|
@@ -2252,6 +2254,9 @@
|
|
|
2252
2254
|
worldcoinPrecompiled.MiniKit.subscribe(worldcoinPrecompiled.ResponseEvent.MiniAppSendTransaction, (payload)=> {
|
|
2253
2255
|
console.log('payload', payload);
|
|
2254
2256
|
if (payload.status == "success") {
|
|
2257
|
+
console.log('before transaction.accepted', transaction);
|
|
2258
|
+
if (transaction.accepted) { transaction.accepted(); }
|
|
2259
|
+
console.log('after transaction.accepted', transaction);
|
|
2255
2260
|
this.fetchTransaction(transaction, payload).then((transactionHash)=>{
|
|
2256
2261
|
if(transactionHash) {
|
|
2257
2262
|
resolve(transaction);
|
|
@@ -2362,7 +2367,7 @@
|
|
|
2362
2367
|
|
|
2363
2368
|
worldcoinPrecompiled.MiniKit.subscribe(worldcoinPrecompiled.ResponseEvent.MiniAppWalletAuth, async (payload) => {
|
|
2364
2369
|
if (payload.status === "error") {
|
|
2365
|
-
return reject()
|
|
2370
|
+
return reject(payload.message)
|
|
2366
2371
|
} else {
|
|
2367
2372
|
return resolve(worldcoinPrecompiled.MiniKit.walletAddress)
|
|
2368
2373
|
}
|
|
@@ -2372,7 +2377,7 @@
|
|
|
2372
2377
|
nonce: crypto.randomUUID().replace(/-/g, ""),
|
|
2373
2378
|
expirationTime: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000),
|
|
2374
2379
|
notBefore: new Date(new Date().getTime() - 24 * 60 * 60 * 1000),
|
|
2375
|
-
statement: "Connect wallet (v17.
|
|
2380
|
+
statement: "Connect wallet (v17.6.0)"
|
|
2376
2381
|
});
|
|
2377
2382
|
|
|
2378
2383
|
})
|
package/dist/umd/index.solana.js
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
alts,
|
|
25
25
|
sent,
|
|
26
26
|
succeeded,
|
|
27
|
-
failed
|
|
27
|
+
failed,
|
|
28
|
+
accepted,
|
|
28
29
|
}) {
|
|
29
30
|
|
|
30
31
|
// required
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
this.api = api;
|
|
38
39
|
this.method = method;
|
|
39
40
|
this.params = params;
|
|
41
|
+
this.accepted = accepted;
|
|
40
42
|
this.sent = sent;
|
|
41
43
|
this.succeeded = succeeded;
|
|
42
44
|
this.failed = failed;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/web3-wallets-evm",
|
|
3
3
|
"moduleName": "Web3Wallets",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.6.1",
|
|
5
5
|
"description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
|
|
6
6
|
"main": "dist/umd/index.evm.js",
|
|
7
7
|
"module": "dist/esm/index.evm.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@depay/walletconnect-v2": "^2.12.2",
|
|
29
29
|
"@depay/web3-blockchains": "^9.6.1",
|
|
30
30
|
"@depay/web3-client-evm": "^10.19.0",
|
|
31
|
-
"@depay/worldcoin-precompiled": "^
|
|
31
|
+
"@depay/worldcoin-precompiled": "^1.2.0",
|
|
32
32
|
"ethers": "^5.7.1"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|