bet-test-sdk 1.2.1 → 1.2.2

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 CHANGED
@@ -37,6 +37,96 @@ resolve: {
37
37
  },
38
38
  ```
39
39
 
40
+ ### BetSDK transaction
41
+ Get BetSDK transaction-related command methods.
42
+
43
+ #### getCreateAndBuyInstructions
44
+
45
+ ```typescript
46
+ async getCreateAndBuyInstructions(
47
+ creator: PublicKey,
48
+ createTokenMetadata: CreateTokenMetadata,
49
+ buyAmountSol: bigint,
50
+ slippageBasisPoints: bigint = 500n,
51
+ commitment: Commitment = DEFAULT_COMMITMENT
52
+ ): Promise<{
53
+ newTx: Transaction;
54
+ mintKeyPair: Keypair;
55
+ }>
56
+ ```
57
+
58
+ - Creates a new token and buys it.
59
+ - **Parameters**:
60
+ - `creator`: The public key of the token creator.
61
+ - `createTokenMetadata`: Metadata for the token.
62
+ - `buyAmountSol`: Amount of SOL to buy.
63
+ - `slippageBasisPoints`: Slippage in basis points (default: 500).
64
+ - `commitment`: Commitment level (default: DEFAULT_COMMITMENT).
65
+ - **Returns**: A promise that resolves to a `Transaction`.
66
+
67
+ #### getCreateInstructions
68
+
69
+ ```typescript
70
+ async getCreateInstructions(
71
+ creator: PublicKey,
72
+ name: string,
73
+ symbol: string,
74
+ uri: string,
75
+ migrateType: MigrateType,
76
+ mintKeyPair: Keypair,
77
+ ): Promise<Transaction>
78
+ ```
79
+
80
+ - Creates a new token and buys it.
81
+ - **Parameters**:
82
+ - `creator`: The public key of the token creator.
83
+ - `name`: Token name.
84
+ - `symbol`: Token symbol.
85
+ - `uri`: Token uri(metadata).
86
+ - `migrateType`: After completing the bet curve, the dex you want to migrate to currently only provides Raydium and Meteora. MigrateType can be imported from the SDK.
87
+ - `mintKeyPair`: A Keypair to create a mint. This keypair needs to be used as a signer to sign the transaction.
88
+ - **Returns**: A promise that resolves to a `Transaction`.
89
+
90
+ #### getBuyInstructionsBySolAmount
91
+
92
+ ```typescript
93
+ async getBuyInstructionsBySolAmount(
94
+ buyer: PublicKey,
95
+ mint: PublicKey,
96
+ buyAmountSol: bigint,
97
+ slippageBasisPoints: bigint = 500n,
98
+ commitment: Commitment = DEFAULT_COMMITMENT
99
+ ): Promise<Transaction>
100
+ ```
101
+
102
+ - Buys a specified amount of tokens by sol input.
103
+ - **Parameters**:
104
+ - `buyer`: The public key of the buyer.
105
+ - `mint`: The public key of the mint account.
106
+ - `buyAmountSol`: Amount of SOL to buy.
107
+ - `slippageBasisPoints`: Slippage in basis points (default: 500).
108
+ - `commitment`: Commitment level (default: DEFAULT_COMMITMENT).
109
+ - **Returns**: A promise that resolves to a `Transaction`.
110
+
111
+ #### getSellInstructionsByTokenAmount
112
+
113
+ ```typescript
114
+ async getSellInstructionsByTokenAmount(
115
+ seller: PublicKey,
116
+ mint: PublicKey,
117
+ sellTokenAmount: bigint,
118
+ slippageBasisPoints: bigint = 500n,
119
+ ): Promise<Transaction>
120
+ ```
121
+
122
+ - Sells a specified amount of tokens.
123
+ - **Parameters**:
124
+ - `seller`: The public key of the seller.
125
+ - `mint`: The public key of the mint account.
126
+ - `sellTokenAmount`: Amount of tokens to sell.
127
+ - `slippageBasisPoints`: Slippage in basis points (default: 500)
128
+ - **Returns**: A promise that resolves to a `Transaction`.
129
+
40
130
  ## Usage Example
41
131
 
42
132
  First you need to create a `.env` file and set your RPC URL like in the `.env.example`