Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit c2456fd

Browse files
author
Gabriel Cardona
committed
Util.sweep.
1 parent 4b9adb8 commit c2456fd

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

src/data/docs/bitbox/util.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,51 @@ Return information about the given bitcoin address.
5656
// iscompressed: true,
5757
// account: 'Test' }]
5858

59+
### `sweep`
60+
61+
Sweep utxo for `wif` to `cashAddress`
62+
63+
#### Arguments
64+
65+
- wif `string`
66+
- toAddr `string`
67+
- balanceOnly `boolean` **optional**. Defaults to `false`
68+
69+
#### Result
70+
71+
- result `string | number`
72+
73+
#### Examples
74+
75+
// balance only
76+
(async () => {
77+
try {
78+
const result = await bitbox.Util.sweep(
79+
wif,
80+
"bchtest:qqmd9unmhkpx4pkmr6fkrr8rm6y77vckjvqe8aey35",
81+
true
82+
)
83+
console.log(result);
84+
} catch(error) {
85+
console.error(error)
86+
}
87+
})()
88+
// 0.1
89+
90+
// sweep utxo
91+
(async () => {
92+
try {
93+
const result = await bitbox.Util.sweep(
94+
wif,
95+
"bchtest:qqmd9unmhkpx4pkmr6fkrr8rm6y77vckjvqe8aey35"
96+
)
97+
console.log(result);
98+
} catch(error) {
99+
console.error(error)
100+
}
101+
})()
102+
// 6b647ddfbb6b0edfaf61d2952b9f8e195d2dfede0e63fe12e1beab16e5bcfe5c
103+
59104
## Interfaces
60105

61106
### AddressDetails

0 commit comments

Comments
 (0)