From 08cd673327249ab18021ae01a3bd76ffae303245 Mon Sep 17 00:00:00 2001 From: Iamsohungrynow <261225237+Iamsohungrynow@users.noreply.github.com> Date: Sun, 22 Nov 2026 02:32:44 +0800 Subject: [PATCH 1/2] js-legacy: Import Buffer explicitly instead of relying on the global --- clients/js-legacy/package.json | 3 ++- clients/js-legacy/src/instruction.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/js-legacy/package.json b/clients/js-legacy/package.json index a925065..e08a555 100644 --- a/clients/js-legacy/package.json +++ b/clients/js-legacy/package.json @@ -49,7 +49,8 @@ "@solana/web3.js": "^1.95.5" }, "dependencies": { - "@solana/codecs": "8.6.0" + "@solana/codecs": "8.6.0", + "buffer": "^6.0.3" }, "devDependencies": { "@solana/spl-type-length-value": "0.2.0", diff --git a/clients/js-legacy/src/instruction.ts b/clients/js-legacy/src/instruction.ts index b51dd03..14a9dfb 100644 --- a/clients/js-legacy/src/instruction.ts +++ b/clients/js-legacy/src/instruction.ts @@ -1,3 +1,4 @@ +import { Buffer } from 'buffer'; import type { Encoder } from '@solana/codecs'; import type { PublicKey } from '@solana/web3.js'; import { From 5d3e315fedebc793392708564027782e963ea46f Mon Sep 17 00:00:00 2001 From: Iamsohungrynow <261225237+Iamsohungrynow@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:51:24 +0800 Subject: [PATCH 2/2] js-legacy: Import the Buffer type in the state files --- clients/js-legacy/src/state/tokenGroup.ts | 1 + clients/js-legacy/src/state/tokenGroupMember.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/clients/js-legacy/src/state/tokenGroup.ts b/clients/js-legacy/src/state/tokenGroup.ts index c0895e2..19e9713 100644 --- a/clients/js-legacy/src/state/tokenGroup.ts +++ b/clients/js-legacy/src/state/tokenGroup.ts @@ -1,3 +1,4 @@ +import type { Buffer } from 'buffer'; import { PublicKey } from '@solana/web3.js'; import type { ReadonlyUint8Array } from '@solana/codecs'; import { fixCodecSize, getBytesCodec, getStructCodec, getU64Codec } from '@solana/codecs'; diff --git a/clients/js-legacy/src/state/tokenGroupMember.ts b/clients/js-legacy/src/state/tokenGroupMember.ts index c952c4f..399a9b9 100644 --- a/clients/js-legacy/src/state/tokenGroupMember.ts +++ b/clients/js-legacy/src/state/tokenGroupMember.ts @@ -1,3 +1,4 @@ +import type { Buffer } from 'buffer'; import { PublicKey } from '@solana/web3.js'; import type { ReadonlyUint8Array } from '@solana/codecs'; import { fixCodecSize, getBytesCodec, getStructCodec, getU64Codec } from '@solana/codecs';