@lavarage/sdk 8.0.13 → 8.0.15

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "8AD6AnnkdD3MMqQE2v3V7HLaxocSr8kZb1uHNX19PnwF",
2
+ "address": "1avaAUcjccXCjSZzwUvB2gS3DzkkieV2Mw8CjdN65uu",
3
3
  "metadata": {
4
4
  "name": "lavarage",
5
5
  "version": "0.1.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "F7L3T5fjHbD13SH8UhNuYxCdabHX9CRg2zxbPjmiwU7R",
2
+ "address": "FFe8xWs9iBdWB6vsxg8yBLirZHsbACFNbXqAM4K3fPPB",
3
3
  "metadata": {
4
4
  "name": "user_vault",
5
5
  "version": "0.1.0",
package/idl/userVault.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/user_vault.json`.
6
6
  */
7
7
  export type UserVault = {
8
- "address": "F7L3T5fjHbD13SH8UhNuYxCdabHX9CRg2zxbPjmiwU7R",
8
+ "address": "FFe8xWs9iBdWB6vsxg8yBLirZHsbACFNbXqAM4K3fPPB",
9
9
  "metadata": {
10
10
  "name": "userVault",
11
11
  "version": "0.1.0",
package/index.ts CHANGED
@@ -57,7 +57,6 @@ type OptionalRPCResults = {
57
57
  tokenAccountConfirmCreatedAddresses?: PublicKey[];
58
58
  quoteMintAccountInfo?: AccountInfo<Buffer>;
59
59
  }
60
- const REFFERAL_VAULT_PROGRAM_ID = new PublicKey("FFe8xWs9iBdWB6vsxg8yBLirZHsbACFNbXqAM4K3fPPB");
61
60
 
62
61
  const LAVARAGE_LOOKUP_TABLE = "CDPmKb5VggsHABwDCTaxiw5XXLjcgkqSJMNKRTzHWXwK";
63
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lavarage/sdk",
3
- "version": "8.0.13",
3
+ "version": "8.0.15",
4
4
  "description": "Lavarage SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/utils.ts CHANGED
@@ -43,18 +43,12 @@ export function stringToU8Array(input: string): number[] {
43
43
  }
44
44
 
45
45
  export function u8ArrayToString(input: number[]): string {
46
- // Strip trailing zero-padding and decode
47
- const end = input.indexOf(0);
48
- const bytes = new Uint8Array(end === -1 ? input : input.slice(0, end));
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("");
46
+ // validate that input has no more than 32 bytes
47
+ if (input.length > 32) {
48
+ throw new Error('Input has more than 32 bytes');
57
49
  }
50
+
51
+ return '0x' + Buffer.from(input).toString('hex');
58
52
  }
59
53
 
60
54
  export function isSolProgram(program: Program<any>): boolean {