Skip to content

Commit

Permalink
fix claim when locked amount is 0 (#150)
Browse files Browse the repository at this point in the history
* fix claim when locked amount is 0

* feat: use bn api with `n` suffix if an arg is number

it is faster

---------

Co-authored-by: Roman <irolgin@gmail.com>
  • Loading branch information
Yolley and RolginRoman committed Mar 28, 2024
1 parent a24dbba commit 7e0296a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/distributor/solana/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export default class SolanaDistributorClient {
ixs.push(newClaim(args, accounts, this.programId));
}

ixs.push(claimLocked(accounts, this.programId));
if (data.amountLocked.gtn(0)) {
ixs.push(claimLocked(accounts, this.programId));
}

const { tx, hash } = await prepareTransaction(this.connection, ixs, invoker.publicKey);
const signature = await wrappedSignAndExecuteTransaction(this.connection, invoker, tx, hash);
Expand Down

0 comments on commit 7e0296a

Please sign in to comment.