-
Notifications
You must be signed in to change notification settings - Fork 293
add omni express sweeping script #5841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
*/ | ||
async function fundAddressesIfEmpty(addresses: string[], feeRateSatPerKB: number, fundAmount = 2000) { | ||
const addressesToFund = addresses.filter(async (address) => { | ||
const res = await superagent.get(`https://mempool.space/${MEMPOOL_PREFIX}api/address/${address}/utxo`); |
Check warning
Code scanning / CodeQL
File data in outbound network request Medium
file data
); | ||
} | ||
|
||
const res = await superagent.get(`https://mempool.space/${MEMPOOL_PREFIX}api/address/${sender}/utxo`); |
Check warning
Code scanning / CodeQL
File data in outbound network request Medium
file data
.send({ | ||
recipients: [ | ||
// this signals the receiver of the omni asset | ||
// we are not actually trying to send BTC to the receiver | ||
// so we send the minimum amount above the dust limit | ||
{ | ||
amount: '546', | ||
address: receiver, | ||
}, | ||
// this is the actual script that the omni layer reads for the send | ||
{ | ||
amount: '0', | ||
address: `scriptPubkey:${omniScript}`, | ||
}, | ||
], | ||
isReplaceableByFee: true, | ||
feeRate: feeRateSatPerKB, | ||
// we must send change to our input address to ensure that omni won't | ||
// accidentally send our asset to the change address instead of the recipient | ||
changeAddress: sender, | ||
unspents: [unspent_id], | ||
...(usingRemoteSigner ? {} : { walletPassphrase }), // only include walletPassphrase if not using remote signer | ||
}); |
Check warning
Code scanning / CodeQL
File data in outbound network request Medium
file data
*/ | ||
async function fundAddressesIfEmpty(wallet: Wallet, addresses: string[], feeRateSatPerKB: number, fundAmount = 2000) { | ||
const addressesToFund = addresses.filter(async (address) => { | ||
const res = await superagent.get(`https://mempool.space/${omniConfig.MEMPOOL_PREFIX}api/address/${address}/utxo`); |
Check warning
Code scanning / CodeQL
File data in outbound network request Medium
No description provided.