Skip to content

Commit

Permalink
Merge pull request #419 from permaweb/NickJ202/feat-relay-topup
Browse files Browse the repository at this point in the history
chore: query relay operator for address
  • Loading branch information
twilson63 authored Feb 12, 2025
2 parents 63e4554 + 8f67e1a commit 5abd0af
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/services/relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,23 @@ function fromDenominatedAmount(num) {
}

export async function handleRelayTopup(jwk) {
const RELAY = {
url: `${process.env.RELAY_URL}/[email protected]/balance`
};

const PAYMENT = {
address: '0syT13r0s0tgPmIed95bJnuSqaD29HQNN8D3ElLSrsc',
ticker: 'AO'
};
const RELAY = {
address: 'yTVz5K0XU52lD9O0iHh42wgBGSXgsPcu7wEY8GqWnFY',
url: `${process.env.RELAY_URL}/[email protected]/balance`
};

try {
const relayAddressResponse = await fetch(`${process.env.RELAY_URL}/[email protected]/info/address`);
RELAY.address = await relayAddressResponse.text();
}
catch (e) {
console.log(chalk.red('Error getting relay information'));
process.exit(1);
}

const { dryrun, message, createDataItemSigner } = connect();

Expand Down

0 comments on commit 5abd0af

Please sign in to comment.