@lavarage/sdk 8.0.2 → 8.0.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/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/index.ts +2 -0
- package/package.json +1 -1
- package/utils.ts +9 -1
package/dist/index.mjs
CHANGED
|
@@ -2204,7 +2204,12 @@ function retryWithBackoff(fn, maxRetries = 5, initialDelay = 1e3) {
|
|
|
2204
2204
|
function u8ArrayToString(input) {
|
|
2205
2205
|
const end = input.indexOf(0);
|
|
2206
2206
|
const bytes = new Uint8Array(end === -1 ? input : input.slice(0, end));
|
|
2207
|
-
|
|
2207
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
2208
|
+
try {
|
|
2209
|
+
return decoder.decode(bytes);
|
|
2210
|
+
} catch (e) {
|
|
2211
|
+
return "0x" + Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
2212
|
+
}
|
|
2208
2213
|
}
|
|
2209
2214
|
function isSolProgram(program) {
|
|
2210
2215
|
return program.programId.toBase58() === lavarageSOL_default.address;
|
|
@@ -4566,6 +4571,7 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
4566
4571
|
offer,
|
|
4567
4572
|
randomSeed.publicKey
|
|
4568
4573
|
);
|
|
4574
|
+
console.log("SDK: positionAccount", positionAccount.toBase58());
|
|
4569
4575
|
const quoteMintAccount = (_a = optionalRPCResults == null ? void 0 : optionalRPCResults.quoteMintAccountInfo) != null ? _a : yield lavarageProgram.provider.connection.getAccountInfo(quoteToken);
|
|
4570
4576
|
const quoteTokenProgram = quoteMintAccount == null ? void 0 : quoteMintAccount.owner;
|
|
4571
4577
|
const fromTokenAccount = yield getTokenAccountOrCreateIfNotExists(
|