Skip to content
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

feat(sui): request tokens from faucet only if recipient balance is below a specific amount #385

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

jcs47
Copy link
Contributor

@jcs47 jcs47 commented Sep 23, 2024

No description provided.

@jcs47 jcs47 requested a review from a team as a code owner September 23, 2024 23:29
sui/deploy-contract.js Outdated Show resolved Hide resolved
sui/faucet.js Show resolved Hide resolved
sui/faucet.js Outdated Show resolved Hide resolved
@jcs47 jcs47 merged commit 8254ec7 into main Sep 24, 2024
6 checks passed
@jcs47 jcs47 deleted the sui/faucet_min_balance branch September 24, 2024 00:33

if (balance >= Number(options.minBalance)) {
printWarn('Wallet balance above minimum, skipping faucet request');
process.exit(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return from this method and not exit the whole process


const coins = await client.getBalance({ owner: keypair.toSuiAddress() });
async function printWalletInfo(wallet, client, chain, options) {
const owner =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

walletAddress perhaps instead of owner

const coins = await client.getBalance({ owner: keypair.toSuiAddress() });
async function printWalletInfo(wallet, client, chain, options) {
const owner =
wallet instanceof Ed25519Keypair || wallet instanceof Secp256k1Keypair || wallet instanceof Secp256r1Keypair
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a base KeyPair class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants