Skip to content

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ericli-bitgo
Copy link
Contributor

No description provided.

*/
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

Outbound network request depends on
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

Outbound network request depends on
file data
.
Comment on lines +148 to +170
.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

Outbound network request depends on
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

Outbound network request depends on
file data
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants