Skip to content

Commit

Permalink
updated deps + use address-encoder cbor
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Nov 9, 2023
1 parent 00e267d commit dbe091d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 33 deletions.
6 changes: 3 additions & 3 deletions packages/ensjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@
"dependencies": {
"@adraffy/ens-normalize": "1.9.0",
"@ensdomains/address-encoder": "1.0.0-rc.2",
"@ensdomains/content-hash": "^3.0.0-beta.5",
"@ensdomains/dnsprovejs": "^0.4.1",
"@ensdomains/content-hash": "3.1.0-rc.0",
"@ensdomains/dnsprovejs": "^0.5.0",
"abitype": "^0.8.0",
"cbor": "^8.1.0",
"dns-packet": "^5.3.1",
"graphql": "^16.3.0",
"graphql-request": "6.1.0",
Expand All @@ -123,6 +122,7 @@
"@types/jest": "^27.4.1",
"@types/node": "^20.3.3",
"@types/pako": "^2.0.0",
"cbor": "^8.1.0",
"@types/traverse": "^0.6.32",
"dotenv": "^16.0.0",
"esbuild": "^0.15.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/ensjs/src/functions/public/_getAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ const decode = async (
}
// CBOR
case 4: {
const { decodeFirst } = await import('cbor')
abiData = await decodeFirst(hexToBytes(encodedAbiData))
const { cborDecode } = await import('@ensdomains/address-encoder/utils')
abiData = await cborDecode(hexToBytes(encodedAbiData).buffer)
decoded = true
break
}
Expand Down
4 changes: 2 additions & 2 deletions packages/ensjs/src/utils/encoders/encodeAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const encodeAbi = async <
}
case 'cbor': {
contentType = 4
const { encode } = await import('cbor')
encodedData = bytesToHex(encode(data))
const { cborEncode } = await import('@ensdomains/address-encoder/utils')
encodedData = bytesToHex(new Uint8Array(cborEncode(data)))
break
}
default: {
Expand Down
75 changes: 49 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbe091d

Please sign in to comment.