diff --git a/js/package-lock.json b/js/package-lock.json index 3aec8ad6..4935ec5d 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bonfida/spl-name-service", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bonfida/spl-name-service", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "dependencies": { "@bonfida/sns-records": "0.0.1", @@ -25,6 +25,7 @@ "@pythnetwork/client": "^2.19.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-json": "^6.0.1", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.5", @@ -3093,6 +3094,28 @@ } } }, + "node_modules/@rollup/plugin-inject": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", + "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-json": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.1.tgz", @@ -14543,6 +14566,17 @@ "magic-string": "^0.30.3" } }, + "@rollup/plugin-inject": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", + "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.3" + } + }, "@rollup/plugin-json": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.1.tgz", diff --git a/js/package.json b/js/package.json index c0f52378..149208f7 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "@bonfida/spl-name-service", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "files": [ "dist" @@ -38,6 +38,7 @@ "@pythnetwork/client": "^2.19.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-json": "^6.0.1", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.5", diff --git a/js/rollup.config.mjs b/js/rollup.config.mjs index 11a04d71..c6199ec9 100644 --- a/js/rollup.config.mjs +++ b/js/rollup.config.mjs @@ -7,6 +7,7 @@ import replace from "@rollup/plugin-replace"; import babel from "@rollup/plugin-babel"; import { visualizer } from "rollup-plugin-visualizer"; import multiInput from "rollup-plugin-multi-input"; +import inject from "@rollup/plugin-inject"; /** * @type {import('rollup').RollupOptions} @@ -43,15 +44,29 @@ export default { preserveModulesRoot: "src", }, ], - external: ["@solana/web3.js"], + external: [ + "@solana/web3.js", + "@solana/buffer-layout-utils", + "@solana/buffer-layout", + ], plugins: [ multiInput.default(), nodeResolve({ browser: true, preferBuiltins: false, - dedupe: ["borsh", "@solana/spl-token", "bn.js", "buffer"], + dedupe: [ + "borsh", + "@solana/spl-token", + "bn.js", + "buffer", + "@solana/buffer-layout-utils", + "@solana/buffer-layout", + ], }), commonjs(), + inject({ + Buffer: ["buffer", "Buffer"], + }), typescript({ tsconfig: "./tsconfig.json", declaration: false, diff --git a/js/src/record_v2/serializeRecordV2Content.ts b/js/src/record_v2/serializeRecordV2Content.ts index 45f9eef8..c731819e 100644 --- a/js/src/record_v2/serializeRecordV2Content.ts +++ b/js/src/record_v2/serializeRecordV2Content.ts @@ -11,7 +11,7 @@ import { InvalidInjectiveAddressError, InvalidRecordInputError, } from "../error"; - +import { Buffer } from "buffer"; import { UTF8_ENCODED, EVM_RECORDS } from "./const"; /**