@hodlmarkets/sdk 0.1.1 → 0.1.3
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 +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ const minTokensOut = applySlippage(expectedTokens, 100) // 1% slippage
|
|
|
34
34
|
|
|
35
35
|
const tx = await client.buy({ buyer: wallet.publicKey, mint, solAmount, minTokensOut })
|
|
36
36
|
tx.sign([wallet])
|
|
37
|
-
const
|
|
37
|
+
const sig = await connection.sendRawTransaction(tx.serialize())
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Sell
|
|
@@ -55,7 +55,7 @@ const tx = await client.sell({
|
|
|
55
55
|
minSolOut: applySlippage(expectedSol, 100),
|
|
56
56
|
})
|
|
57
57
|
tx.sign([wallet])
|
|
58
|
-
await
|
|
58
|
+
await connection.sendRawTransaction(tx.serialize())
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## Create Token
|
|
@@ -73,10 +73,10 @@ const tx = await client.createToken({
|
|
|
73
73
|
symbol: 'MTK',
|
|
74
74
|
uri: 'https://arweave.net/metadata.json',
|
|
75
75
|
poolDescription: 'A community token',
|
|
76
|
-
vestDuration: new BN(60), // 1 minute (only 60 or
|
|
76
|
+
vestDuration: new BN(60), // 1 minute (only 60 or 1800 allowed)
|
|
77
77
|
})
|
|
78
78
|
tx.sign([wallet, mint]) // both creator and mint must sign
|
|
79
|
-
await
|
|
79
|
+
await connection.sendRawTransaction(tx.serialize())
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
## Claim Accrued Tokens
|
|
@@ -85,7 +85,7 @@ await client.send(tx)
|
|
|
85
85
|
const [poolState] = getPoolStatePDA(mint, PROGRAM_ID)
|
|
86
86
|
const tx = await client.claimAccrued({ owner: wallet.publicKey, poolState })
|
|
87
87
|
tx.sign([wallet])
|
|
88
|
-
await
|
|
88
|
+
await connection.sendRawTransaction(tx.serialize())
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
## Events
|
|
@@ -109,7 +109,7 @@ const events = await client.fetchAndParseTransaction(signature)
|
|
|
109
109
|
import { parseHodlError } from '@hodlmarkets/sdk'
|
|
110
110
|
|
|
111
111
|
try {
|
|
112
|
-
await
|
|
112
|
+
await connection.sendRawTransaction(tx.serialize())
|
|
113
113
|
} catch (err) {
|
|
114
114
|
const hodlErr = parseHodlError(err)
|
|
115
115
|
if (hodlErr) console.error(`HODL error ${hodlErr.code}: ${hodlErr.message}`)
|