You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`mint.ts`|`buildMintTx` — deposit ADA, mint synth tokens |
177
+
|`burn.ts`|`buildBurnTx` — burn synth tokens, reclaim ADA |
178
+
|`liquidate.ts`|`buildLiquidateTx` — permissionless liquidation of undercollateralised positions |
179
+
180
+
### Important: script CBOR encoding
181
+
182
+
Aiken's `plutus.json` outputs `compiledCode` in **single-CBOR** encoding. MeshSDK's `applyParamsToScript` requires **double-CBOR** encoding. Always wrap with `applyCborEncoding` before passing to `applyParamsToScript`:
// Asset fingerprint: asset1kjr4k3m0xe5c747n6yv2s9dlfhkmzgceqs82jy (verified via CIP-14)
218
+
219
+
PYTH.WITHDRAW_SCRIPT_CBOR="TODO"// Pyth verify script — get from Pyth team
220
+
PYTH.WITHDRAW_ADDRESS="TODO"// reward address of the verify script
221
+
```
222
+
223
+
### Mesh "Data" format for redeemers/datums
224
+
225
+
In MeshSDK's "Mesh" encoding (used with `"Mesh"` flag on builder calls):
226
+
-`ByteArray` → plain hex string
227
+
-`List<T>` → JS array `[...]`
228
+
-`Constr(N, fields)` → `mConStr0([...])` / `mConStr1([...])` / `mConStr2([...])` from `@meshsdk/core`
229
+
230
+
Do **not** use `mBytes` or `mList` — they are not exported by `@meshsdk/core`. Use hex strings and arrays directly.
231
+
232
+
### Redeemer mapping
233
+
234
+
| Action | Spend redeemer | Mint redeemer |
235
+
|---|---|---|
236
+
| Mint |`mConStr0([])`|`mConStr0([])`|
237
+
| Burn |`mConStr1([])`|`mConStr1([])`|
238
+
| Liquidate |`mConStr2([])`|`mConStr2([])`|
239
+
240
+
Pyth withdrawal redeemer: `[pythHex]` — a JS array containing the hex-encoded Solana wire format price message returned by the backend as `solanaPayload`.
0 commit comments