Skip to content

Commit

Permalink
bump version to v0.6.6, fixes memcp filter issues for newer solana ve…
Browse files Browse the repository at this point in the history
…rsions.
  • Loading branch information
crypt0miester committed Sep 10, 2024
1 parent 101a44e commit e6f3be3
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 27 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onsol/tldparser",
"version": "0.6.5",
"version": "0.6.6",
"description": "TLD House (Solana) Javascript API",
"keywords": [
"api",
Expand Down Expand Up @@ -56,7 +56,7 @@
},
"devDependencies": {
"@jest/types": "^29.3.1",
"@solana/web3.js": "^1.67.0",
"@solana/web3.js": "^1.95.3",
"@types/bn.js": "^5.1.0",
"@types/bs58": "^4.0.1",
"@types/jest": "^29.2.3",
Expand All @@ -77,7 +77,7 @@
"typescript": "^4.9.4"
},
"peerDependencies": {
"@solana/web3.js": "^1.67.0",
"@solana/web3.js": "^1.95.3",
"bn.js": "^5.2.1",
"borsh": "^0.7.0",
"buffer": "6.0.1"
Expand Down
7 changes: 6 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export async function findOwnedNameAccountsForUser(
memcmp: {
offset: 40,
bytes: userAccount.toBase58(),
encoding: 'base58',
},
},
];
Expand All @@ -116,13 +117,15 @@ export async function findOwnedNameAccountsForUser(
memcmp: {
offset: 8,
bytes: parentAccount.toBase58(),
encoding: 'base58',
},
});
}

const accounts = await connection.getProgramAccounts(ANS_PROGRAM_ID, {
filters: filters,
filters: filters
});

return accounts.map((a: any) => a.pubkey);
}

Expand Down Expand Up @@ -150,6 +153,7 @@ export async function getAllTld(connection: Connection): Promise<
memcmp: {
offset: 0,
bytes: tldHouseDiscriminator,
encoding: 'binary',
},
},
];
Expand Down Expand Up @@ -210,6 +214,7 @@ export async function findAllDomainsForTld(
memcmp: {
offset: 8,
bytes: parentAccount.toBase58(),
encoding: 'base58',
},
},
];
Expand Down
40 changes: 20 additions & 20 deletions tests/tld-parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ const nameAccount = new PublicKey('6iE5btnTaan1eqfnwChLdVAyFERdn5uCVnp5GiXVg1aB'
const parentAccountOwner = new PublicKey('ANgPRMKQHgH5Snx2K3VHCvHqFmrABcjTZUrqZBzDCtfA');

describe('tldParser tests', () => {
it('should perform fetching of a pending expiry domain', async () => {
const parser = new TldParser(connection);
const domanTld = 'canwenot.abc';
const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
expect(ownerRecieved).toStrictEqual(owner);
});

it('should perform fetching of an owner an nft domain', async () => {
const parser = new TldParser(connection);
const domanTld = 'legendary.abc';
const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
expect(ownerRecieved).toStrictEqual(owner);
});

it('should perform fetching of an owner an nft domain', async () => {
const parser = new TldParser(connection);
const domanTld = 'miester.abc';
const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
expect(ownerRecieved).toStrictEqual(owner);
});
// it('should perform fetching of a pending expiry domain', async () => {
// const parser = new TldParser(connection);
// const domanTld = 'canwenot.abc';
// const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
// expect(ownerRecieved).toStrictEqual(owner);
// });

// it('should perform fetching of an owner an nft domain', async () => {
// const parser = new TldParser(connection);
// const domanTld = 'legendary.abc';
// const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
// expect(ownerRecieved).toStrictEqual(owner);
// });

// it('should perform fetching of an owner an nft domain', async () => {
// const parser = new TldParser(connection);
// const domanTld = 'miester.abc';
// const ownerRecieved = await parser.getOwnerFromDomainTld(domanTld);
// expect(ownerRecieved).toStrictEqual(owner);
// });

// it('should perform retrieval of all user domains', async () => {
// const parser = new TldParser(connection);
Expand Down
138 changes: 135 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@
dependencies:
regenerator-runtime "^0.13.11"

"@babel/runtime@^7.25.0":
version "7.25.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2"
integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/template@^7.20.7", "@babel/template@^7.3.3":
version "7.20.7"
resolved "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz"
Expand Down Expand Up @@ -660,11 +667,23 @@
bn.js "^5.2.0"
debug "^4.3.3"

"@noble/curves@^1.4.2":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b"
integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==
dependencies:
"@noble/hashes" "1.5.0"

"@noble/ed25519@^1.7.0":
version "1.7.3"
resolved "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.3.tgz"
integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==

"@noble/[email protected]", "@noble/hashes@^1.4.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0"
integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==

"@noble/hashes@^1.1.2":
version "1.3.0"
resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz"
Expand Down Expand Up @@ -715,14 +734,14 @@
dependencies:
"@sinonjs/commons" "^2.0.0"

"@solana/buffer-layout@^4.0.0":
"@solana/buffer-layout@^4.0.0", "@solana/buffer-layout@^4.0.1":
version "4.0.1"
resolved "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz"
integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==
dependencies:
buffer "~6.0.3"

"@solana/web3.js@^1.56.2", "@solana/web3.js@^1.67.0":
"@solana/web3.js@^1.56.2":
version "1.74.0"
resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.74.0.tgz"
integrity sha512-RKZyPqizPCxmpMGfpu4fuplNZEWCrhRBjjVstv5QnAJvgln1jgOfgui+rjl1ExnqDnWKg9uaZ5jtGROH/cwabg==
Expand All @@ -744,6 +763,34 @@
rpc-websockets "^7.5.1"
superstruct "^0.14.2"

"@solana/web3.js@^1.95.3":
version "1.95.3"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.3.tgz#70b5f4d76823f56b5af6403da51125fffeb65ff3"
integrity sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og==
dependencies:
"@babel/runtime" "^7.25.0"
"@noble/curves" "^1.4.2"
"@noble/hashes" "^1.4.0"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.1"
node-fetch "^2.7.0"
rpc-websockets "^9.0.2"
superstruct "^2.0.2"

"@swc/helpers@^0.5.11":
version "0.5.13"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.13.tgz#33e63ff3cd0cade557672bd7888a39ce7d115a8c"
integrity sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==
dependencies:
tslib "^2.4.0"

"@tsconfig/node10@^1.0.7":
version "1.0.9"
resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz"
Expand Down Expand Up @@ -887,13 +934,25 @@
resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz"
integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==

"@types/uuid@^8.3.4":
version "8.3.4"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==

"@types/ws@^7.4.4":
version "7.4.7"
resolved "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz"
integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==
dependencies:
"@types/node" "*"

"@types/ws@^8.2.2":
version "8.5.12"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e"
integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==
dependencies:
"@types/node" "*"

"@types/yargs-parser@*":
version "21.0.0"
resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz"
Expand Down Expand Up @@ -1022,6 +1081,13 @@ agentkeepalive@^4.2.1:
depd "^2.0.0"
humanize-ms "^1.2.1"

agentkeepalive@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923"
integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==
dependencies:
humanize-ms "^1.2.1"

ajv@^6.10.0, ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
Expand Down Expand Up @@ -1318,7 +1384,7 @@ [email protected]:
base64-js "^1.3.1"
ieee754 "^1.2.1"

buffer@~6.0.3:
buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3:
version "6.0.3"
resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz"
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
Expand Down Expand Up @@ -1836,6 +1902,11 @@ eventemitter3@^4.0.7:
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==

eventemitter3@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4"
integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==

execa@^5.0.0:
version "5.1.1"
resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz"
Expand Down Expand Up @@ -2457,6 +2528,24 @@ jayson@^3.4.4:
uuid "^8.3.2"
ws "^7.4.5"

jayson@^4.1.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.2.tgz#443c26a8658703e0b2e881117b09395d88b6982e"
integrity sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA==
dependencies:
"@types/connect" "^3.4.33"
"@types/node" "^12.12.54"
"@types/ws" "^7.4.4"
JSONStream "^1.3.5"
commander "^2.20.3"
delay "^5.0.0"
es6-promisify "^5.0.0"
eyes "^0.1.8"
isomorphic-ws "^4.0.1"
json-stringify-safe "^5.0.1"
uuid "^8.3.2"
ws "^7.5.10"

jest-changed-files@^29.5.0:
version "29.5.0"
resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz"
Expand Down Expand Up @@ -3055,6 +3144,13 @@ node-fetch@^2.6.7:
dependencies:
whatwg-url "^5.0.0"

node-fetch@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
dependencies:
whatwg-url "^5.0.0"

node-gyp-build@^4.3.0:
version "4.6.0"
resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz"
Expand Down Expand Up @@ -3293,6 +3389,11 @@ regenerator-runtime@^0.13.11:
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==

regexp.prototype.flags@^1.4.3:
version "1.4.3"
resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz"
Expand Down Expand Up @@ -3363,6 +3464,22 @@ rpc-websockets@^7.5.1:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"

rpc-websockets@^9.0.2:
version "9.0.2"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.2.tgz#4c1568d00b8100f997379a363478f41f8f4b242c"
integrity sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw==
dependencies:
"@swc/helpers" "^0.5.11"
"@types/uuid" "^8.3.4"
"@types/ws" "^8.2.2"
buffer "^6.0.3"
eventemitter3 "^5.0.1"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"

run-parallel@^1.1.9:
version "1.2.0"
resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz"
Expand Down Expand Up @@ -3533,6 +3650,11 @@ superstruct@^0.14.2:
resolved "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz"
integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==

superstruct@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-2.0.2.tgz#3f6d32fbdc11c357deff127d591a39b996300c54"
integrity sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==

supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz"
Expand Down Expand Up @@ -3653,6 +3775,11 @@ tslib@^1.8.1:
resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.4.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01"
integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==

tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"
Expand Down Expand Up @@ -3829,6 +3956,11 @@ ws@^7.4.5:
resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==

ws@^7.5.10:
version "7.5.10"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9"
integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==

ws@^8.5.0:
version "8.13.0"
resolved "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz"
Expand Down

0 comments on commit e6f3be3

Please sign in to comment.