bet-test-sdk 1.2.3 → 1.2.4
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 +33 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -38,7 +38,7 @@ resolve: {
|
|
38
38
|
```
|
39
39
|
|
40
40
|
### BetSDK transaction
|
41
|
-
Get BetSDK transaction-related
|
41
|
+
Get BetSDK transaction-related methods.
|
42
42
|
|
43
43
|
#### getCreateAndBuyInstructions
|
44
44
|
|
@@ -129,6 +129,38 @@ async getSellInstructionsByTokenAmount(
|
|
129
129
|
- `slippageBasisPoints`: Slippage in basis points (default: 500)
|
130
130
|
- **Returns**: A promise that resolves to a `Transaction`.
|
131
131
|
|
132
|
+
### Some preview methods for calculations
|
133
|
+
|
134
|
+
```typescript
|
135
|
+
// Buy: Fixed sol amount in, estimated token amount out
|
136
|
+
async getTokenAmountOut(
|
137
|
+
mint: PublicKey,
|
138
|
+
solAmountIn: bigint,
|
139
|
+
slippageBasisPoints?: bigint
|
140
|
+
): Promise<bigint>
|
141
|
+
|
142
|
+
// Buy: Fixed token amount out, estimated sol amount in
|
143
|
+
async getMinSolAmountIn(
|
144
|
+
mint: PublicKey,
|
145
|
+
tokenAmountOut: bigint,
|
146
|
+
slippageBasisPoints?: bigint
|
147
|
+
): Promise<bigint>
|
148
|
+
|
149
|
+
// Sell: Fixed token amount in, estimated sol amount out
|
150
|
+
async getSolAmountOut(
|
151
|
+
mint: PublicKey,
|
152
|
+
tokenAmountIn: bigint,
|
153
|
+
slippageBasisPoints?: bigint
|
154
|
+
): Promise<bigint>
|
155
|
+
|
156
|
+
// Sell: Fixed sol amount out, estimated token amount in
|
157
|
+
async getMinTokenAmountIn(
|
158
|
+
mint: PublicKey,
|
159
|
+
solAmountOut: bigint,
|
160
|
+
slippageBasisPoints?: bigint
|
161
|
+
): Promise<bigint>
|
162
|
+
```
|
163
|
+
|
132
164
|
## Usage Example
|
133
165
|
|
134
166
|
First you need to create a `.env` file and set your RPC URL like in the `.env.example`
|