@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/index.ts
CHANGED
|
@@ -1369,6 +1369,8 @@ export const openTradeV2 = async (
|
|
|
1369
1369
|
randomSeed.publicKey
|
|
1370
1370
|
);
|
|
1371
1371
|
|
|
1372
|
+
console.log("SDK: positionAccount", positionAccount.toBase58());
|
|
1373
|
+
|
|
1372
1374
|
const quoteMintAccount = optionalRPCResults?.quoteMintAccountInfo ??
|
|
1373
1375
|
await lavarageProgram.provider.connection.getAccountInfo(quoteToken);
|
|
1374
1376
|
const quoteTokenProgram = quoteMintAccount?.owner;
|
package/package.json
CHANGED
package/utils.ts
CHANGED
|
@@ -46,7 +46,15 @@ export function u8ArrayToString(input: number[]): string {
|
|
|
46
46
|
// Strip trailing zero-padding and decode
|
|
47
47
|
const end = input.indexOf(0);
|
|
48
48
|
const bytes = new Uint8Array(end === -1 ? input : input.slice(0, end));
|
|
49
|
-
|
|
49
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
50
|
+
try {
|
|
51
|
+
return decoder.decode(bytes);
|
|
52
|
+
} catch {
|
|
53
|
+
// Not valid UTF-8 (e.g. raw binary/hash); return hex
|
|
54
|
+
return '0x' + Array.from(bytes)
|
|
55
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
56
|
+
.join("");
|
|
57
|
+
}
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
export function isSolProgram(program: Program<any>): boolean {
|