@utexo/rgb-sdk 1.0.0-beta.8 → 1.0.0-beta.9
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 +22 -1
- package/cli/data/README.md +8 -0
- package/cli/data/bridge-prod.json +11 -0
- package/cli/data/bridge-test.json +11 -0
- package/cli/data/bridge.txt +113 -0
- package/cli/data/devreceiver.json +11 -0
- package/cli/data/devsender.json +11 -0
- package/cli/data/newwallet.json +11 -0
- package/cli/data/prodreceiver.json +11 -0
- package/cli/data/prodsender.json +11 -0
- package/cli/data/receiver.json +1 -0
- package/cli/data/sender.json +1 -0
- package/cli/data/signet.json +11 -0
- package/cli/data/vanilla.json +11 -0
- package/cli/scripts/send-batch-wm.mjs +176 -0
- package/dist/index.cjs +69 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +68 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
package/Readme.md
CHANGED
|
@@ -30,7 +30,9 @@ The primary wallet class is **`UTEXOWallet`**: initialize with a mnemonic (or se
|
|
|
30
30
|
| `restoreUtxoWalletFromVss({ mnemonic, targetDir, config?, vssServerUrl? })` | Restore UTEXO wallet from VSS cloud backup – top-level function |
|
|
31
31
|
| `deriveKeysFromMnemonic(network, mnemonic)` | Derive wallet keys from existing mnemonic |
|
|
32
32
|
| `deriveKeysFromSeed(network, seed)` | Derive wallet keys from BIP39 seed |
|
|
33
|
-
| `getAddress()` | Get deposit address (async) |
|
|
33
|
+
| `getAddress()` | Get current deposit address (async) |
|
|
34
|
+
| `rotateVanillaAddress()` | Rotate to the next vanilla (BTC) receive address and return it (async) |
|
|
35
|
+
| `rotateColoredAddress()` | Rotate to the next colored (RGB) receive address and return it (async) |
|
|
34
36
|
| `getBtcBalance()` | Get on-chain BTC balance (async) |
|
|
35
37
|
| `getXpub()` | Get vanilla and colored xpubs |
|
|
36
38
|
| `getNetwork()` | Get current network |
|
|
@@ -187,6 +189,11 @@ await wallet.initialize();
|
|
|
187
189
|
const walletWithDir = new UTEXOWallet(keys.mnemonic, { network: 'testnet', dataDir: './wallet-data' });
|
|
188
190
|
await walletWithDir.initialize();
|
|
189
191
|
|
|
192
|
+
// Optional: enable address reuse — getAddress() returns the same address on every call
|
|
193
|
+
// instead of advancing the derivation index. Default: false.
|
|
194
|
+
const reuseWallet = new UTEXOWallet(keys.mnemonic, { network: 'testnet', reuseAddresses: true });
|
|
195
|
+
await reuseWallet.initialize();
|
|
196
|
+
|
|
190
197
|
// Restore from file backup (layer1 + utexo in one folder)
|
|
191
198
|
const { targetDir } = restoreUtxoWalletFromBackup({
|
|
192
199
|
backupPath: './backup-folder',
|
|
@@ -234,6 +241,20 @@ const asset = await wallet.issueAssetNia({
|
|
|
234
241
|
console.log('Asset issued:', asset.asset?.assetId);
|
|
235
242
|
```
|
|
236
243
|
|
|
244
|
+
### Address Reuse and Rotation
|
|
245
|
+
|
|
246
|
+
By default, each call to `getAddress()` advances the derivation index so a fresh receive address is returned. Set `reuseAddresses: true` to keep returning the same address — useful for testing or scenarios where address rotation is handled externally.
|
|
247
|
+
|
|
248
|
+
The address can be rotated manually at any time:
|
|
249
|
+
|
|
250
|
+
```javascript
|
|
251
|
+
// Advance to the next vanilla (BTC) receive address
|
|
252
|
+
const newVanilla = await wallet.rotateVanillaAddress();
|
|
253
|
+
|
|
254
|
+
// Advance to the next colored (RGB) receive address
|
|
255
|
+
const newColored = await wallet.rotateColoredAddress();
|
|
256
|
+
```
|
|
257
|
+
|
|
237
258
|
### Asset Transfers
|
|
238
259
|
|
|
239
260
|
```javascript
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Test data
|
|
2
|
+
|
|
3
|
+
This folder holds wallet configs and other test data used by the scripts in `cli/`.
|
|
4
|
+
|
|
5
|
+
- **`<wallet_name>.json`** — Wallet configs created by `generate_keys.mjs` (mnemonic, xpubs, etc.). Do not commit files that contain real secrets.
|
|
6
|
+
- **`bridge.txt`** — Optional bridge-related data.
|
|
7
|
+
|
|
8
|
+
Wallet configs are read from and written to this directory by all test scripts.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "bridge-prod",
|
|
3
|
+
"network": "mainnet",
|
|
4
|
+
"mnemonic": "salt nature member mother between lady major process example sentence lizard attend",
|
|
5
|
+
"xpub": "xpub661MyMwAqRbcEckPVEswkNBUNZZnSLpAX3tHrRrcXs5Zc3tAifRZobMUydxsFX3VGXsVgb1NNPajcTdZmsF6hW8r9Upsppor6BpssNq1dtf",
|
|
6
|
+
"accountXpubVanilla": "xpub6CLNt9YMY8UmEq3xA6ZU69rBLBaNn6inPmKVkkW4NzwRYGvvN8FVzXS1wbWzXz5xNQumtJU6kwJbQD6A3hwNonzoM66xFwFsWZWdPxAFELi",
|
|
7
|
+
"accountXpubColored": "xpub6CZBEZULYZCcV7EkP8DXMPC27PdxsHawE11mPbhA5bE12XBqAhBiqwACWyQk5LGbxfHkzYEVdE8tJLWr8ocVdT9Pse4AVRWduB4zUpswJsq",
|
|
8
|
+
"masterFingerprint": "e475fc15",
|
|
9
|
+
"xpriv": "xprv9s21ZrQH143K28fvPDLwPEEjpXjJ2t6K9pxh43SzyXYajFZ2B87KFo318PnFvfmryZRjtw12g8GW6Lpx2f1MHkGVTjdAbTzrgWsLy94yxDR",
|
|
10
|
+
"createdAt": "2026-03-04T20:32:41.208Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "bridge-test",
|
|
3
|
+
"network": "testnet",
|
|
4
|
+
"mnemonic": "market attend true accident injury creek smooth gospel neck shop help require",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4YAk9q3gJvhrqKxhpGg42fX9rGnnZT7v8C5noro4g6mbUik1mpu4epr2GxNVqniPMX2BDzbYupyA1dksD7LJMCfXQaoPjfTS",
|
|
6
|
+
"accountXpubVanilla": "tpubDCu91F3hgkQZJAHeCngVLJwYYAwEjQZwEWXoYTcoxJuDgGd5Xh471q3HZvcRhUooSZYj2av3JyyP4qGBeRCsHPaF8if8wujSsd4CDg5funq",
|
|
7
|
+
"accountXpubColored": "tpubDCnR1nLHtY1jX7mSVieRkPr77MtE262GCdQHpiCCs93jTcVoPi5jokibrz9Sc3C9f2ohZgDK8EZ989chVvc9aCqob9nL2QTGyoNsHxPhcR3",
|
|
8
|
+
"masterFingerprint": "9ab3cebe",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPehiMwQ1iXJCikwBt7Ls86DZ4zGkG2r7jMbY3EQF5vGycYbTSGjpwcCfzVy4veCC2PxK8vNoT4GwMLNqtLTvjYtgYqpsPyma",
|
|
10
|
+
"createdAt": "2026-02-24T12:11:58.964Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
there no estimate api
|
|
2
|
+
https://dev.bridge.gateway.tricorn.network/api/v0/transfers/estimate/RGB/UTEXO/4/2?sender-address=rgb-address&recipient-address=rgb%3A%7E%2F%7E%2F%7E%2Fbcrt%3Autxob%3AXj26wT35-_t3yqlb-pBhSFee-iZeQX7A-6eyxScP-%7EDK5HrO-opqY%7E%3Fexpiry%3D1770367530%26endpoints%3Drpc%3A%2F%2Fregtest.thunderstack.org%3A3000%2Fjson-rpc
|
|
3
|
+
|
|
4
|
+
RGB->Utexo
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
https://dev.bridge.gateway.tricorn.network/api/v0/transfers/bridge-in-signature
|
|
8
|
+
{"sender":{"address":"rgb-address","networkName":"RGB","networkId":36},"tokenId":4,"amount":"12","destination":{"address":"rgb:~/~/~/bcrt:utxob:Xj26wT35-_t3yqlb-pBhSFee-iZeQX7A-6eyxScP-~DK5HrO-opqY~?expiry=1770367530&endpoints=rpc://regtest.thunderstack.org:3000/json-rpc","networkName":"UTEXO","networkId":96},"additionalAddresses":[]}
|
|
9
|
+
|
|
10
|
+
{"sender":{"address":"rgb-address","networkName":"RGB","networkId":36},"tokenId":4,"amount":"12","destination":{"address":"rgb:~/~/~/bcrt:utxob:Xj26wT35-_t3yqlb-pBhSFee-iZeQX7A-6eyxScP-~DK5HrO-opqY~?expiry=1770367530&endpoints=rpc://regtest.thunderstack.org:3000/json-rpc","networkName":"UTEXO","networkId":96},"additionalAddresses":[]}
|
|
11
|
+
responce
|
|
12
|
+
{
|
|
13
|
+
"token": "rgb:WPRv95Nj-icdrgPp-zpQhIp_-2TyJ~Ge-k~FvuMZ-~vVnkA0",
|
|
14
|
+
"amount": "2000000",
|
|
15
|
+
"gasCommission": "394831",
|
|
16
|
+
"destination": {
|
|
17
|
+
"networkId": 96,
|
|
18
|
+
"networkName": "UTEXO",
|
|
19
|
+
"address": "rgb:~/~/~/bcrt:utxob:Xj26wT35-_t3yqlb-pBhSFee-iZeQX7A-6eyxScP-~DK5HrO-opqY~?expiry=1770367530\u0026endpoints=rpc://regtest.thunderstack.org:3000/json-rpc"
|
|
20
|
+
},
|
|
21
|
+
"deadline": "0",
|
|
22
|
+
"nonce": 0,
|
|
23
|
+
"transferId": 9544,
|
|
24
|
+
"signature": "0x7267623a5750527639354e6a2d696364726750702d7a70516849705f2d3254794a7e47652d6b7e4676754d5a2d7e76566e6b41302f525768775566544d707550325a6678317e6a346e737743414e47654a72594f7144634b656c614d56347a552f46636362572f7462333a7574786f623a614e63394e7a66472d666f46675143542d5f776e6f4a73532d38786b535350322d54494667445f362d6f623065384d5a2d357a73345f3f61737369676e6d656e745f6e616d653d61737365744f776e6572266578706972793d3137373032383237303926656e64706f696e74733d727063733a2f2f70726f78792e6972697377616c6c65742e636f6d2f302e322f6a736f6e2d727063",
|
|
25
|
+
"transferType": "WU",
|
|
26
|
+
"estimation": {
|
|
27
|
+
"fee": "0.394831",
|
|
28
|
+
"feePercentage": "0.10",
|
|
29
|
+
"estimatedConfirmationTime": "6",
|
|
30
|
+
"stableFee": "0.002",
|
|
31
|
+
"resultAmount": "1.603169",
|
|
32
|
+
"swapResultAmount": "1.603169"
|
|
33
|
+
},
|
|
34
|
+
"totalCommission": "396831"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// does RLN node have signet FIX - if yes need to upgrade RLN to latest
|
|
38
|
+
// move Tricorn to signet, Run signet ifra for tricorn
|
|
39
|
+
- 1. signet RGB node
|
|
40
|
+
- 2. signet RLN node for lightning
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
RGB->UTEXO
|
|
44
|
+
https://tricorn-gw.test.thunderstack.org/api/v0/transfers/estimate/RGB/UTEXO/4/5?sender-address=rgb-address&recipient-address=rgb%3A%7E%2F%7E%2FaM%2Fsb%3Awvout%3ABf7TY04A-VGnzafd-5rRhJVZ-Z%7ElPCgM-162DCe8-TWMJK%7EH-UD319NQ%3Fassignment_name%3DassetOwner%26expiry%3D1770997414%26endpoints%3Drpcs%3A%2F%2Fproxy.iriswallet.com%2F0.2%2Fjson-rpc
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
https://tricorn-gw.test.thunderstack.org/api/v0/transfers/bridge-in-signature
|
|
49
|
+
{"sender":{"address":"rgb-address","networkName":"RGB","networkId":36},"tokenId":4,"amount":"5","destination":{"address":"rgb:~/~/aM/sb:wvout:Bf7TY04A-VGnzafd-5rRhJVZ-Z~lPCgM-162DCe8-TWMJK~H-UD319NQ?assignment_name=assetOwner&expiry=1770997414&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc","networkName":"UTEXO","networkId":96},"additionalAddresses":[]}
|
|
50
|
+
|
|
51
|
+
responce
|
|
52
|
+
{
|
|
53
|
+
"token": "rgb:WPRv95Nj-icdrgPp-zpQhIp_-2TyJ~Ge-k~FvuMZ-~vVnkA0",
|
|
54
|
+
"amount": "5000000",
|
|
55
|
+
"gasCommission": "1540240",
|
|
56
|
+
"destination": {
|
|
57
|
+
"networkId": 96,
|
|
58
|
+
"networkName": "UTEXO",
|
|
59
|
+
"address": "rgb:~/~/aM/sb:wvout:Bf7TY04A-VGnzafd-5rRhJVZ-Z~lPCgM-162DCe8-TWMJK~H-UD319NQ?assignment_name=assetOwner\u0026expiry=1770997414\u0026endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc"
|
|
60
|
+
},
|
|
61
|
+
"deadline": "0",
|
|
62
|
+
"nonce": 0,
|
|
63
|
+
"transferId": 386,
|
|
64
|
+
"signature": "0x7267623a5750527639354e6a2d696364726750702d7a70516849705f2d3254794a7e47652d6b7e4676754d5a2d7e76566e6b41302f525768775566544d707550325a6678317e6a346e737743414e47654a72594f7144634b656c614d56347a552f6b62664d522f7462333a7574786f623a3164756e317a73572d596974507336682d6d50726846646e2d306c4d797662592d7e7237697378662d384449495a63622d3871616d6f3f61737369676e6d656e745f6e616d653d61737365744f776e6572266578706972793d3137373039393639363526656e64706f696e74733d727063733a2f2f70726f78792e6972697377616c6c65742e636f6d2f302e322f6a736f6e2d727063",
|
|
65
|
+
"transferType": "WU",
|
|
66
|
+
"estimation": {
|
|
67
|
+
"fee": "1.54024",
|
|
68
|
+
"feePercentage": "0.10",
|
|
69
|
+
"estimatedConfirmationTime": "6",
|
|
70
|
+
"stableFee": "0.005",
|
|
71
|
+
"resultAmount": "3.45476",
|
|
72
|
+
"swapResultAmount": "3.45476"
|
|
73
|
+
},
|
|
74
|
+
"totalCommission": "1545240"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
https://tricorn-gw.test.thunderstack.org/api/v0/transfers/verify-bridge-in
|
|
78
|
+
|
|
79
|
+
{"transferId":386,"networkId":36,"txHash":"0x7267623a5750527639354e6a2d696364726750702d7a70516849705f2d3254794a7e47652d6b7e4676754d5a2d7e76566e6b41302f525768775566544d707550325a6678317e6a346e737743414e47654a72594f7144634b656c614d56347a552f6b62664d522f7462333a7574786f623a3164756e317a73572d596974507336682d6d50726846646e2d306c4d797662592d7e7237697378662d384449495a63622d3871616d6f3f61737369676e6d656e745f6e616d653d61737365744f776e6572266578706972793d3137373039393639363526656e64706f696e74733d727063733a2f2f70726f78792e6972697377616c6c65742e636f6d2f302e322f6a736f6e2d727063","publicKey":"rgb-address","authenticationSignature":"7267622d61646472657373"}
|
|
80
|
+
|
|
81
|
+
respone
|
|
82
|
+
null
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
https://tricorn-gw.test.thunderstack.org/api/v0/transfers/bridge-in-signature
|
|
86
|
+
{"sender":{"address":"rgb-address","networkName":"RGB-LIGHTNING","networkId":94},"tokenId":4,"amount":"6","destination":{"address":"rgb:~/~/aM/sb:wvout:Bays1hhk-QJ~EH~W-JMCFmnB-SYh32cf-oCSz3oS-dogTRvb-BIlVVcQ?assignment_name=assetOwner&expiry=1770998672&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc","networkName":"UTEXO","networkId":96},"additionalAddresses":[]}
|
|
87
|
+
{
|
|
88
|
+
"token": "rgb:WPRv95Nj-icdrgPp-zpQhIp_-2TyJ~Ge-k~FvuMZ-~vVnkA0",
|
|
89
|
+
"amount": "6000000",
|
|
90
|
+
"gasCommission": "1394679",
|
|
91
|
+
"destination": {
|
|
92
|
+
"networkId": 96,
|
|
93
|
+
"networkName": "UTEXO",
|
|
94
|
+
"address": "rgb:~/~/aM/sb:wvout:Bays1hhk-QJ~EH~W-JMCFmnB-SYh32cf-oCSz3oS-dogTRvb-BIlVVcQ?assignment_name=assetOwner\u0026expiry=1770998672\u0026endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc"
|
|
95
|
+
},
|
|
96
|
+
"deadline": "0",
|
|
97
|
+
"nonce": 0,
|
|
98
|
+
"transferId": 387,
|
|
99
|
+
"signature": "0x6c6e746233307531703563373433666471716e703471666d347173756532307773337234396c34706c673363397633747a756439676578726a386d7876633339393077396c786675797a70703565617170783770747979676b66306b7a6e6c307a6c326d756a673339327a67306b61766c756577346d35797566656e33743578737370356e6b6778356432736e3630326373326139636c7a676c33353078787a36303361306538327877746a356778357435786d63367a713971797973677163717a70327871797a3576716c7035747236786c61756e76777975773675716c666536327a7a67356c6b65386a796c636561796c3364377576766c616174386a71787337717a6a636137646b6b7174636d356d6b6465797672306d397433377678773973686577716a656b65677834656d6c726c7130767978673972357a7a796a38353963306b377276667275746730796b7771796667613479743671683630747a7a356c6b6b647770683366776771616766333570",
|
|
100
|
+
"transferType": "WU",
|
|
101
|
+
"estimation": {
|
|
102
|
+
"fee": "1.394679",
|
|
103
|
+
"feePercentage": "0.00",
|
|
104
|
+
"estimatedConfirmationTime": "6",
|
|
105
|
+
"stableFee": "0",
|
|
106
|
+
"resultAmount": "4.605321",
|
|
107
|
+
"swapResultAmount": "4.605321"
|
|
108
|
+
},
|
|
109
|
+
"totalCommission": "1394679"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
https://tricorn-gw.test.thunderstack.org/api/v0/transfers/verify-bridge-in
|
|
113
|
+
{"transferId":387,"networkId":94,"txHash":"0x6c6e746233307531703563373433666471716e703471666d347173756532307773337234396c34706c673363397633747a756439676578726a386d7876633339393077396c786675797a70703565617170783770747979676b66306b7a6e6c307a6c326d756a673339327a67306b61766c756577346d35797566656e33743578737370356e6b6778356432736e3630326373326139636c7a676c33353078787a36303361306538327877746a356778357435786d63367a713971797973677163717a70327871797a3576716c7035747236786c61756e76777975773675716c666536327a7a67356c6b65386a796c636561796c3364377576766c616174386a71787337717a6a636137646b6b7174636d356d6b6465797672306d397433377678773973686577716a656b65677834656d6c726c7130767978673972357a7a796a38353963306b377276667275746730796b7771796667613479743671683630747a7a356c6b6b647770683366776771616766333570","publicKey":"rgb-address","authenticationSignature":"7267622d61646472657373"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "devreceiver",
|
|
3
|
+
"network": "testnet",
|
|
4
|
+
"mnemonic": "resource secret bitter cycle can derive bottom skull area tackle unable rug",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4YiBEkSh3BGRPnyNEFANTfm2vufucoSTaJqD9YqVFjeKu82y6BduNmMN7hGBjFFumRiGF2x7U5iBTTJvawxiA8gygNz5miVP",
|
|
6
|
+
"accountXpubVanilla": "tpubDC8ws3Ka4DcJb1oDcWnhGMoTeNdJeV4XHWh15s6vqiPx6qeyykGCy33KAMaV3moCnH4EbYQTwJMdQ4fw8hz5kFykyaHgf6td6jHLshFeVyW",
|
|
7
|
+
"accountXpubColored": "tpubDCFUJur52J5NRgQvBgRqv4MopgyuZcyVPxuFWZm7koGoyAFgvsBScrMHksYuDr4uPecS1KcN8un7htVgvkKHqANpKa4mf5ZkFffSZWa69S8",
|
|
8
|
+
"masterFingerprint": "7a1b913f",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPfF9Sro2SmrmHDwrJ5qBZ6TS9d9sKPAfBULxNvSffZ9i2wv95cnAN4EvRax6pvV58ZLRW1ieUbXzWdnWGY8Vq6fAPm33J2Mk",
|
|
10
|
+
"createdAt": "2026-03-12T12:56:46.906Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "devsender",
|
|
3
|
+
"network": "testnet",
|
|
4
|
+
"mnemonic": "panther obey empower lonely shy hazard pink dutch clean arch because come",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4XtZqdmkf8H32LgAjJNdGHae1ocbD2UVQVpD5HhXU5U1ePKUb3nutfY1xY3BomtWUiPPssD3HGAkC9hjT3Xd61gVsS6ayWpf",
|
|
6
|
+
"accountXpubVanilla": "tpubDCgL6XjTDiWkPHm1Tbwo7SGxBsgZrJ5Zqpy7dWHHHssQyVqidViNd6wkpeSGyt1W36LxZkd31RzSMwU8YMcnGSioqrK58TbJLM7t8zBAHq4",
|
|
7
|
+
"accountXpubColored": "tpubDC3d6FAcsKTmFuRxGWGi7FCLA7HPWaKDC5HbcfnC3h2HpYZkKKeBvHmVkbNxRuiCEDHJon29VxdCno6QyTiLdSkomgPJBTvo5PKXHiDx58B",
|
|
8
|
+
"masterFingerprint": "96d7ed4d",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPeRY3k864isNumeeo93SMiH3EX6YucCh1fKxJfJhstyPnDDbXXcb9GdxrwkcJMxGs6LhpW91WQJKuTVLgUUmghzp7vPXwERN",
|
|
10
|
+
"createdAt": "2026-03-12T12:56:31.312Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "newwallet",
|
|
3
|
+
"network": "testnet",
|
|
4
|
+
"mnemonic": "devote receive install marine visa today point ancient leopard attend visit aspect",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4X1WUgFE9nqWHSdMFG48ZdnjMjBe3zCn39SX2trzvodm11cnxaH2CT1kx3HRKHYrRCWsngk1f1LDNRLcKRpRtqvZSBhXETmJ",
|
|
6
|
+
"accountXpubVanilla": "tpubDCKun27Shdx5ovoB9jrrsRy39UnYu218kiNWhjY7vBSoUMj3C4zdqrnJrYRkxYXE26QAeeUyqzfCa25TLZBB2y57LZqmJKfm3sFV421YT8m",
|
|
7
|
+
"accountXpubColored": "tpubDDF7si9LzZrUvQ8PX9oFPKM8aU1DN1mvZ2ZGZ2G9jYpkwi6q5zCidsRcfmKUCZ2hhcatDf9SoFwBXQZSTE2tmWc2TfS4ZdinDH8C8VpdD5N",
|
|
8
|
+
"masterFingerprint": "aae2d7d4",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPdYUgnbZZPRrAsbqK6iwf4V8aSfbkZvyeJxGGGUBLd998qWDWj4jfErBsp36htADNtVjRJT1M262sg1xzRwm2nH1PbbjuCR4",
|
|
10
|
+
"createdAt": "2026-02-19T21:17:20.363Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "prodreceiver",
|
|
3
|
+
"network": "mainnet",
|
|
4
|
+
"mnemonic": "sugar embark unlock decade lamp duty sure wheel crumble frost regular hope",
|
|
5
|
+
"xpub": "xpub661MyMwAqRbcEuhQjxhGreqk3ZjPykbiy8eL7U5Mtro38igGJXDk7SVLpE6ZyBHug26r3kuy8GbLoeEWM8dWWZ93kdgNwHdiAfGgDBE73Rn",
|
|
6
|
+
"accountXpubVanilla": "xpub6CPWuxmGK3CM9jfUhdSKPecSM5o6L8VvUJdd2mgdyoMgQLLdHfPnoMrXU1Y1AgQSmtrjW7Z59trzCp1tE19z2hvhSoLA6XYpQSkD7gGN5ez",
|
|
7
|
+
"accountXpubColored": "xpub6DXUTuiL17bZ8EGyLumTcRo9ooZkt5i2vNK6fHmUV2KiTsSbe6XnANVDbpmUuAKNVVrvWvRheC3eqnBDZUi4WF7y9zi3M3teJ64zsdq4RJu",
|
|
8
|
+
"masterFingerprint": "04fcbcea",
|
|
9
|
+
"xpriv": "xprv9s21ZrQH143K2RcwdwAGVWu1VXtuaHssbuijK5fkLXG4FvM7kyuVZeArxyE8jGDxjLmAZ9BJ7Mk5FyPvbDv4oL6MSzccbttjR3KnQpxj5CF",
|
|
10
|
+
"createdAt": "2026-03-12T16:03:48.686Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "prodsender",
|
|
3
|
+
"network": "mainnet",
|
|
4
|
+
"mnemonic": "autumn devote keep patrol wreck enrich lion lift buddy crater reopen enjoy",
|
|
5
|
+
"xpub": "xpub661MyMwAqRbcFXLKoD5SoWXvyZY3mbC6SnQoH3duBzusPjbDfryzgrnqQAkhPdE68Le3kPW2kSMKRzCx7r1ynYgn1ePiLdrrEuTEwTnfDZh",
|
|
6
|
+
"accountXpubVanilla": "xpub6CfBpPK18d6EairxBBGLpbEZYvHdrVXfPXw17yAfRpVNChf6XvEpwnWoNhchrnysfAUdoRPZYsyYftBzVDAguJ1m5M5noPTSbcXagFRQN2Q",
|
|
7
|
+
"accountXpubColored": "xpub6CQS43J72uF9QMuTEJzgH3Ao1Jko2nGdCMNEz1fGmnh5Q7RLvJReDE2cBhe8uNDgXLtvdQmWzTC8QkjpYaEcYvanSTX2gRDEyeSgvvog8Vu",
|
|
8
|
+
"masterFingerprint": "39d48761",
|
|
9
|
+
"xpriv": "xprv9s21ZrQH143K33FrhBYSSNbCRXhZN8UF5ZVCUfEHdfNtWwG58Kfk94UMYsupRi9fdnetq6aZ84TCsiRk6XqkKruoGMLGTQvPVDNh8TJ2Ldn",
|
|
10
|
+
"createdAt": "2026-03-12T16:03:34.581Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"walletName":"receiver","network":"testnet","mnemonic":"post cat hobby balcony decide youth crew dash math tomato drip antenna","xpub":"tpubD6NzVbkrYhZ4XHeraHegLaXvRRcRa1GN4S2eeL4UAch7rVWjh8bMS8qJngaXGxTqaSEuiGUEGjGLNPGLR22wgiFsSWrvyyyoqinzunS8t99","accountXpubVanilla":"tpubDCApzWkigYeETUpiQ4Vfd9bw1pZo7PrUjFQYnxZMUfYbpQisuVHVTQq6H4Tx4Jeybng1UfvE34VfcxuE62ALaG3EFT2De7KfN8QEhrEyJZx","accountXpubColored":"tpubDCuZPR2WHjZUnfLtuaXbGFM7zohKVmiy4hRjtH9v8SnYZD82RS25KSNt9nKxPpvpLi7b91nZNw3RZMSHAnLKtNacJ8Rhv9JZJ28iE3QcZqu","masterFingerprint":"8cb160f8","xpriv":"tprv8ZgxMBicQKsPdpd4gdz5wAsorQ6VQg5TV8RsMp2AkLtj21Fy4jmmFeDScZjSdyZafzeC1DQGvj43Cq9UL6qTaPjVudDnYoi97HYnbA4qBEW","createdAt":"2026-02-12T17:29:10.435Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"walletName":"sender","network":"testnet","mnemonic":"tape lemon drink pass faint glue ivory decline forget club what search","xpub":"tpubD6NzVbkrYhZ4XqcB1HX9DZMeZ4wXv5bK3ivW2SFt8iAbgc9fpStF8KPr48tfFGihkBYAnhF2qmUUCtdyS8KdqtrX2KjBn7JgzyUgEAUgxSY","accountXpubVanilla":"tpubDCfKYA61NXPe4kvJG73D4gZ4VCs6G1FmFwjoBkwFJaPh32pCgDVhjrptkwuD6QdXHWmYgoCFysZSDndXKxnYzwSuoVyzwGHPpJ376jjNHa4","accountXpubColored":"tpubDC7AeYtSytQaEsKbkpwoHpnw4mDpYLw6yFuGN8bjYg7WXxGbLRKeJcoobVJX2BsYkZ7Eg7UVt4Wvz5q4nvrKRzrr8PmdSCzmPb1i8s9MqU3","masterFingerprint":"e48cd9cd","xpriv":"tprv8ZgxMBicQKsPeNaP7drYp9hXz3RbkkQQURKijvDaiSNCr7tuC44ewpmyt2PBJUwVnQp1nwjokuYp8vUWfgby2p9khoSgfEFRrHHuTbuqxas","createdAt":"2026-02-12T17:29:30.254Z"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "sender",
|
|
3
|
+
"network": "signet",
|
|
4
|
+
"mnemonic": "hat another thank load rare dance lottery organ knock decorate stomach brush",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4WunG2DzBtpc9HduzhvxLMT7vhZhMQQ96hur9xWz6PB5pzebasdS6hKCF7eKM46TkGDNBP7jcJGEFaJs54y4iAC5D8jG4Yh5",
|
|
6
|
+
"accountXpubVanilla": "tpubDC3wwETUKqc2kYAHgtmcvMxnPaHRhr3tazFk7vPRAtteTGGqtQ76yQQofk1K8mB3nGHETgasJy9pVo7vNAcsCFkvjDADMjZKEJgnv8XqYiv",
|
|
7
|
+
"accountXpubColored": "tpubDCpRSx4L43cFzgDcj2bn3Cipvq78NUtWmAmV1xMKvmj9ffFhvtUwcVpnVTpRMGcBfA1xdqKd3BSYCugNWq2gA6hiCxRTL3t7PgfambbvWKu",
|
|
8
|
+
"masterFingerprint": "d3da93a6",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPeNaP7drYp9hXz3RbkkQQURKijvDaiSNCr7tuC44ewpmyt2PBJUwVnQp1nwjokuYp8vUWfgby2p9khoSgfEFRrHHuTbuqxas",
|
|
10
|
+
"createdAt": "2026-02-12T17:29:30.254Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"walletName": "vanilla",
|
|
3
|
+
"network": "testnet",
|
|
4
|
+
"mnemonic": "flight seminar tray bulb level embody switch enhance august deny scene dismiss",
|
|
5
|
+
"xpub": "tpubD6NzVbkrYhZ4WLw9njYmLvMEWp5nqVmjfkgAZfj7uivNXCFS7Ls9DyDZM82P4cDpobCDGAZpNsR9Gs9wuvv5yYCNFsqxcbsDn6VU4nU3ZcW",
|
|
6
|
+
"accountXpubVanilla": "tpubDDTg3fRGqAvEvshRUUwuS8brXkewNsE6y6Jbb9xZcuzBbmxAWa3UCmwyQG4peM9RwjgY8BDwuRVRU5KGtvRby5kiv1dk13YHU8z39o18QJK",
|
|
7
|
+
"accountXpubColored": "tpubDDqoEexZxewBLjXmZ7kxSHgZgmdAtej6DrXLBMiSSuPCdGQqjkTvyETLLVY7qNpxNRGUivvxDj8sswHHihT5effNNDmsbMUX2Lrpy4zjRcS",
|
|
8
|
+
"masterFingerprint": "42424232",
|
|
9
|
+
"xpriv": "tprv8ZgxMBicQKsPcsuMu5tAwWh7wnZrgAaq6T5PH9gpVT7yghzfUx3Z3UbhB1Va1ossgNZ7C5dMTJD2UR6ppUkfN2ryYBL3kBSZnnkCoXDK1HC",
|
|
10
|
+
"createdAt": "2026-03-11T15:54:05.981Z"
|
|
11
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WalletManager batch send script.
|
|
5
|
+
* Edit the PARAMS object below with your wallet name, asset ID, amount and invoices,
|
|
6
|
+
* then run: node cli/scripts/send-batch-wm.mjs
|
|
7
|
+
* (from project root)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { runWithWalletManager } from '../utils.mjs';
|
|
11
|
+
|
|
12
|
+
// --- Hardcoded params: edit and run ---
|
|
13
|
+
const PARAMS = {
|
|
14
|
+
/** Wallet name (must exist in cli/data/<walletName>.json) */
|
|
15
|
+
walletName: 'bridge-prod',
|
|
16
|
+
|
|
17
|
+
/** Asset ID to send (e.g. rgb:xxx...) */
|
|
18
|
+
assetId: 'rgb:nkHbmy97-R4cjRCe-j~VvT~E-0UQ0OW8-jOCCW6O-EqeCq9M',
|
|
19
|
+
|
|
20
|
+
/** Default amount when invoice is a plain string (ignored when using { invoice, amount } objects) */
|
|
21
|
+
amount: 1000000000,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Array of RGB invoices. Each entry can be:
|
|
25
|
+
* - { invoice: "rgb:...", amount: 123 } — per-invoice amount (in smallest units)
|
|
26
|
+
* - { invoice: "rgb:...", amount: 1.8 } — human amount, parsed with precision
|
|
27
|
+
* - "rgb:..." — use default amount above
|
|
28
|
+
*/
|
|
29
|
+
invoices: [
|
|
30
|
+
//sent
|
|
31
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BRqFjbJz-jtVTZDU-F6MxscB-jgbgO0z-pI6V19A-QLLi9K1-F1NHR_g?expiry=1774040771&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1684000 },
|
|
32
|
+
// { invoice: "rgb:~/~/~/bc:wvout:Bd23pu7n-5axhiHd-HvMsU1a-faUiln1-swvZAhB-KM9LVNa-zvcDAjw?expiry=1774049000&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
33
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BUf8UKGX-SFeukGq-Fz0isFJ-upzNbej-8EYWOMJ-iHu37zl-KIDEx8A?expiry=1774041269&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
34
|
+
// { invoice: "rgb:~/~/~/bc:wvout:Be63eppL-2ROO2j9-biEM9PA-jkYs83U-aUVG0FG-MCtGduc-diKenoQ?expiry=1774041559&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
35
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BTWHuOjf-LXmT7at-Dn3dey5-wZVy2Hh-i5ekqZ5-wnTWpz5-bad3d6g?expiry=1774041685&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BbDObsby-EcO8nul-~651dUz-3yysBS7-aouPVdC-rG97K9i-DVXR0kQ?expiry=1774041826&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
40
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BU4r0jkk-Y~C2NnO-PKDwf1I-rBj8wCj-S_Om9v_-V3MmsD_-eB9TUrw?expiry=1774041950&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
41
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BTVr5XHt-N_EIVJ4-9PhUM2j-7CB~~Th-AjL89r0-3EB72qF-2h6enMw?expiry=1773955116&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1500000 },
|
|
42
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BaYAEFb5-y0klUVK-CrUGmYL-1UTrRIf-8kbmpqA-VcvhMr2-xfUxMZg?expiry=1774041443&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
43
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BTcIuMgm-2YKK_4L-VuGjkae-w3INh0~-UpDA2SQ-idYMYxV-MQxAQmA?expiry=1774042294&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BQLSjHgA-5Za6Pl3-bsyNU1v-cabjgzG-kKCEtjP-z0Imh3u-juA8P_Q?expiry=1773956380&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
47
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BZieAtdT-HYqgaa~-B9ZdtiV-A2ayKGf-mmUDfFS-uMk2WT3-RTNHRcQ?expiry=1773957088&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
48
|
+
// { invoice: "rgb:~/~/~/bc:wvout:Bf3cXcnK-asXhD8w-4ng6U~y-raM7tz5-uezkOv1-kXfZrW8-_bYODyw?expiry=1774043511&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
49
|
+
// { invoice: "rgb:~/~/~/bc:wvout:Bc5FSYEY-iHJMUgk-xtMGITV-11Ogn01-ffcQQQE-03h5sQF-o_jk5AQ?expiry=1774041325&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
50
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BVNRbhwn-MFNWKx_-VgcZjYi-fTB3Eub-wF0cvbn-0jgkCZ0-1MxISLQ?expiry=1774043501&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
51
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BUFgKipJ-H5qEVkI-tCaamqp-UzpEhjN-TqwzRbM-1VciJox-OEJWVXA?expiry=1774042976&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1500000 },
|
|
52
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BVboEhnB-5EZZX6Z-~Stn7Oj-SjNsXid-vKP4ebY-nCHRZ9H-_ZsXF4w?expiry=1774044186&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
53
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BaLQOQBZ-V0zaq4k-zdk3232-Yg3STay-1QhqiRU-cDwDjLT-kNuHhXQ?expiry=1774044475&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
54
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BdFEtDgA-SyOcosM-5teQkMe-XOi6LC4-5GFcPpG-xlT3QM7-s56SkAw?expiry=1774044598&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
55
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BcYs1XZw-3k1npRl-LOuR7AL-7njOobZ-Pw7h5Ms-It~JyFM-aDH9~sQ?expiry=1774044955&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
56
|
+
|
|
57
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BWmi_duQ-OB8NSin-40zNCz9-QH3ik0m-KayA6am-3G9ARr6-STTAwyQ?expiry=1774044763&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
58
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BcUgqFmz-dm_hABr-VtcLwfv-umcngp5-lfrYq7P-TxAuJlc-Kb0NDVg?expiry=1773958815&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
59
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BZHAWbcE-WVMPFTE-hAYOHy_-b1LySlj-FoubMVU-AokhYpt-zxKSkzw?expiry=1773960390&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
60
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BdQijlwh-JQ8GDJ9-lLhvHwe-spSG1c4-Xoti413-QtaFEhP-7XVJSbw?expiry=1774046022&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1500000 },
|
|
61
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BYbLeUAd-3Evg7Kr-Yy87PTw-GUjM3l5-mEHr126-cuo5UiU-NGvLyYg?expiry=1773959726&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
62
|
+
|
|
63
|
+
// { invoice: "rgb:~/~/~/bc:wvout:Ba_xscjz-pzsVp~1-TYM1ero-xzsrGF7-BR5yFew-qgc0JV4-GFTY2WQ?expiry=1774046168&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
64
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BbxCeUlC-C4k78i0-6cEeW2_-Gpt272~-hfaWWqU-b_nJ_dX-YRqioPw?expiry=1774046252&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
65
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BazfbeL5-jpH9baw-PlmhvnO-S96~MTQ-FOckE3F-5bJk_Ho-SqE1NMA?expiry=1773959820&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
66
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BQI_P4fA-xAij~xF-VK2Cy2v-jMqlnfL-g~I85T2-I1d3AGb-8yKmp3A?expiry=1774045921&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
67
|
+
// { invoice: "rgb:~/~/~/bc:wvout:BVHUPiv7-ZIqd79X-t9PN0np-o1zhaGM-btBu4bc-oL76v38-66qWlrA?expiry=1774046567&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BQK_nc41-t~Bqn46-zoCbgD2-q~i4OHk-dKD9sNH-kllfD7B-vmyEh7Q?expiry=1774046748&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
72
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BT0R1QLY-BpzDJZl-3~Uk~7a-kTl2yRr-6yvwxG4-hUmt8o9-TM8~P8g?expiry=1774046888&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
73
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BWR7J6aD-jh4zG_f-sgLm7fj-~ihJa~3-znec81U-KrxgeMK-b_VRUjQ?expiry=1774046982&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
74
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BRXU7pBK-uip6Ppn-d6_AUJ9-yoVb~Sm-jLzm9Fy-67jL0Or-lVjk5_Q?expiry=1774047756&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
75
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BcAuIYeR-oB4L6qx-PaZHNvh-1wmKld0-Bj7oLsp-EoZNw9F-raUhI_w?expiry=1774155358&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
76
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BXkCuYPS-M8blG4~-pvhOXUs-B08PVMY-R9HiBCS-_zKJYta-Py5WV0w?expiry=1774048005&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
77
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BU89T3X_-CBAGQCO-irKZCNM-wWSQ2QN-iAAhouv-WxwuOON-vdycnBw?expiry=1774048393&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
78
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BRdeIbcR-a4knXxy-ib~Z1mJ-HC97OC8-vFTWf9K-NCrO4T9-us6CgJQ?expiry=1773963584&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
79
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BZ8DUYt3-fU4yXLF-y1pjtN9-7d43kNH-mWP2lB1-RM0Asdt-iyf7_zg?expiry=1773962501&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
80
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BUORYO1b-aH4ghKI-4qO7U4W-AYraOEr-88n95q8-4dZmMOP-reJ6ejA?expiry=1774049679&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
81
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BfxFmu6_-mh5MGqB-0LKFXCu-tIle7Si-wo7kvnT-Qq5UaHb-f1YKCnw?expiry=1773963260&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
82
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BSkqeteZ-de6mgJV-cmZbGY7-pNXvz_p-P_Mt7tn-EYvwxiQ-pz0tL1A?expiry=1774156480&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
83
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BQv9sP0X-6bBVKdM-n9OkcJE-GBjKK7I-bVtB9u~-5Zk3G6t-mGuDgww?expiry=1773881505&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1000000 },
|
|
84
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BaxlePWa-_Gw2tTg-cAFT9_n-7~MvPbc-6uzqeMw-2rmGLUZ-BmggIlg?expiry=1774050768&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
85
|
+
{ invoice: "rgb:~/~/~/bc:wvout:BaquNi0m-7wksyDF-s_nRUQU-YDZjYha-6VPSuTq-Mmq__JR-q9oaGbg?expiry=1774146520&endpoints=rpcs://proxy.iriswallet.com/0.2/json-rpc", amount: 1800000 },
|
|
86
|
+
],
|
|
87
|
+
|
|
88
|
+
/** Optional */
|
|
89
|
+
feeRate: 1,
|
|
90
|
+
minConfirmations: 1,
|
|
91
|
+
donation: true,
|
|
92
|
+
|
|
93
|
+
/** For witness invoices: BTC amount (sats) for receiver UTXO. Ignored for blind invoices. */
|
|
94
|
+
witnessDataAmountSat: 1000,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** Default transport when invoice has no endpoints */
|
|
98
|
+
const DEFAULT_TRANSPORT = 'rpcs://proxy.iriswallet.com/0.2/json-rpc';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Example of a built recipientMap:
|
|
102
|
+
*
|
|
103
|
+
* const exampleRecipientMap = {
|
|
104
|
+
* 'rgb:WPRv95Nj-icdrgPp-zpQhIp_-2TyJ~Ge-k~FvuMZ-~vVnkA0': [
|
|
105
|
+
* {
|
|
106
|
+
* recipientId: 'rgb:~/~/adfmMDR/tb3:utxob:UFfBdres-rfXJVYz-IwBv7n6-M6XfhvK-bb5BjbF-TgPdOsV-9tbXO',
|
|
107
|
+
* witnessData: null,
|
|
108
|
+
* assignment: { Fungible: 1000000000 },
|
|
109
|
+
* transportEndpoints: ['rpcs://proxy.iriswallet.com/0.2/json-rpc'],
|
|
110
|
+
* },
|
|
111
|
+
* // ... one entry per recipient
|
|
112
|
+
* ],
|
|
113
|
+
* };
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
function isWitnessInvoice(recipientId) {
|
|
117
|
+
return recipientId && recipientId.includes('wvout:');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function normalizeInvoices(invoices, defaultAmount) {
|
|
121
|
+
return invoices.map((entry) => {
|
|
122
|
+
if (typeof entry === 'string') {
|
|
123
|
+
return { invoice: entry, amount: defaultAmount };
|
|
124
|
+
}
|
|
125
|
+
return { invoice: entry.invoice, amount: entry.amount };
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function buildRecipientMap(wallet, assetId, invoices, witnessDataAmountSat = 1000) {
|
|
130
|
+
const recipients = [];
|
|
131
|
+
for (const { invoice: invoiceStr, amount } of invoices) {
|
|
132
|
+
const invoiceData = await wallet.decodeRGBInvoice({ invoice: invoiceStr });
|
|
133
|
+
const transportEndpoints =[DEFAULT_TRANSPORT];
|
|
134
|
+
const witnessData = isWitnessInvoice(invoiceData.recipientId)
|
|
135
|
+
? { amountSat: witnessDataAmountSat, blinding: 0}
|
|
136
|
+
: null;
|
|
137
|
+
recipients.push({
|
|
138
|
+
recipientId: invoiceData.recipientId,
|
|
139
|
+
witnessData,
|
|
140
|
+
assignment: { Fungible: amount },
|
|
141
|
+
transportEndpoints:[DEFAULT_TRANSPORT],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return { [assetId]: recipients };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function main() {
|
|
148
|
+
if (!PARAMS.invoices?.length) {
|
|
149
|
+
console.error('PARAMS.invoices must be a non-empty array. Edit cli/scripts/send-batch-wm.mjs');
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
await runWithWalletManager(PARAMS.walletName, async (wallet) => {
|
|
154
|
+
const invoices = normalizeInvoices(PARAMS.invoices, PARAMS.amount);
|
|
155
|
+
const recipientMap = await buildRecipientMap(
|
|
156
|
+
wallet,
|
|
157
|
+
PARAMS.assetId,
|
|
158
|
+
invoices,
|
|
159
|
+
PARAMS.witnessDataAmountSat ?? 1000
|
|
160
|
+
);
|
|
161
|
+
console.log("recipientMap", JSON.stringify(recipientMap,null, 2));
|
|
162
|
+
const result = await wallet.sendBatch({
|
|
163
|
+
recipientMap,
|
|
164
|
+
feeRate: PARAMS.feeRate,
|
|
165
|
+
minConfirmations: PARAMS.minConfirmations,
|
|
166
|
+
donation: PARAMS.donation ?? true,
|
|
167
|
+
});
|
|
168
|
+
console.log(JSON.stringify(result, null, 2));
|
|
169
|
+
console.log('✅ Batch send completed');
|
|
170
|
+
}, { quiet: false });
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
main().catch((err) => {
|
|
174
|
+
console.error(err);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
});
|