bet-test-sdk 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -458,10 +458,10 @@ async createAndBuy(
|
|
458
458
|
- `finality`: Finality level (default: DEFAULT_FINALITY).
|
459
459
|
- **Returns**: A promise that resolves to a `TransactionResult`.
|
460
460
|
|
461
|
-
####
|
461
|
+
#### buyWithSolAmount
|
462
462
|
|
463
463
|
```typescript
|
464
|
-
async
|
464
|
+
async buyWithSolAmount(
|
465
465
|
buyer: Keypair,
|
466
466
|
mint: PublicKey,
|
467
467
|
buyAmountSol: bigint,
|
@@ -483,10 +483,35 @@ async buy(
|
|
483
483
|
- `finality`: Finality level (default: DEFAULT_FINALITY).
|
484
484
|
- **Returns**: A promise that resolves to a `TransactionResult`.
|
485
485
|
|
486
|
-
####
|
486
|
+
#### buyWithTokenAmount
|
487
487
|
|
488
488
|
```typescript
|
489
|
-
async
|
489
|
+
async buyWithTokenAmount(
|
490
|
+
buyer: Keypair,
|
491
|
+
mint: PublicKey,
|
492
|
+
buyAmountToken: bigint,
|
493
|
+
slippageBasisPoints: bigint = 500n,
|
494
|
+
priorityFees?: PriorityFee,
|
495
|
+
commitment: Commitment = DEFAULT_COMMITMENT,
|
496
|
+
finality: Finality = DEFAULT_FINALITY
|
497
|
+
): Promise<TransactionResult>
|
498
|
+
```
|
499
|
+
|
500
|
+
- Buys a specified amount of sols.
|
501
|
+
- **Parameters**:
|
502
|
+
- `buyer`: The keypair of the buyer.
|
503
|
+
- `mint`: The public key of the mint account.
|
504
|
+
- `buyAmountToken`: Amount of token to buy.
|
505
|
+
- `slippageBasisPoints`: Slippage in basis points (default: 500).
|
506
|
+
- `priorityFees`: Priority fees (optional).
|
507
|
+
- `commitment`: Commitment level (default: DEFAULT_COMMITMENT).
|
508
|
+
- `finality`: Finality level (default: DEFAULT_FINALITY).
|
509
|
+
- **Returns**: A promise that resolves to a `TransactionResult`.
|
510
|
+
|
511
|
+
#### sellWithTokenAmount
|
512
|
+
|
513
|
+
```typescript
|
514
|
+
async sellWithTokenAmount(
|
490
515
|
seller: Keypair,
|
491
516
|
mint: PublicKey,
|
492
517
|
sellTokenAmount: bigint,
|
@@ -508,6 +533,31 @@ async sell(
|
|
508
533
|
- `finality`: Finality level (default: DEFAULT_FINALITY).
|
509
534
|
- **Returns**: A promise that resolves to a `TransactionResult`.
|
510
535
|
|
536
|
+
#### sellWithSolAmount
|
537
|
+
|
538
|
+
```typescript
|
539
|
+
async sellWithSolAmount(
|
540
|
+
seller: Keypair,
|
541
|
+
mint: PublicKey,
|
542
|
+
sellSolAmount: bigint,
|
543
|
+
slippageBasisPoints: bigint = 500n,
|
544
|
+
priorityFees?: PriorityFee,
|
545
|
+
commitment: Commitment = DEFAULT_COMMITMENT,
|
546
|
+
finality: Finality = DEFAULT_FINALITY
|
547
|
+
): Promise<TransactionResult>
|
548
|
+
```
|
549
|
+
|
550
|
+
- Sells a specified amount of tokens.
|
551
|
+
- **Parameters**:
|
552
|
+
- `seller`: The keypair of the seller.
|
553
|
+
- `mint`: The public key of the mint account.
|
554
|
+
- `sellSolAmount`: Amount of sols to sell.
|
555
|
+
- `slippageBasisPoints`: Slippage in basis points (default: 500).
|
556
|
+
- `priorityFees`: Priority fees (optional).
|
557
|
+
- `commitment`: Commitment level (default: DEFAULT_COMMITMENT).
|
558
|
+
- `finality`: Finality level (default: DEFAULT_FINALITY).
|
559
|
+
- **Returns**: A promise that resolves to a `TransactionResult`.
|
560
|
+
|
511
561
|
#### addEventListener
|
512
562
|
|
513
563
|
```typescript
|