Skip to content

Commit

Permalink
change payment
Browse files Browse the repository at this point in the history
  • Loading branch information
borispoehland committed Sep 17, 2024
1 parent f31fcd5 commit 3c387a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/interactions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,11 @@ export class SCInteraction {
if (!payment.amount) {
throw new Error('Payment amount is required')
}
if (payment.collection == 'EGLD' && payment.amount) {
interaction.withValue(TokenTransfer.egldFromAmount(payment.amount))
if (payment.collection == 'EGLD') {
interaction.withValue(payment.amount)
} else {
interaction.withSingleESDTTransfer(
TokenTransfer.fungibleFromAmount(
TokenTransfer.fungibleFromBigInteger(
payment.collection,
payment.amount,
payment.decimals ?? 18
Expand Down
3 changes: 2 additions & 1 deletion src/types/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export interface WithSenderAndNonce {
nonce?: number
}

export interface Payment extends NFTBody {
export interface Payment extends Omit<NFTBody, 'amount'> {
decimals?: number
amount: string
}

export interface SendGlobalOffer {
Expand Down

0 comments on commit 3c387a9

Please sign in to comment.