diff --git a/.github/workflows/build-programs.yml b/.github/workflows/build-programs.yml index fb0d0d01..d9465914 100644 --- a/.github/workflows/build-programs.yml +++ b/.github/workflows/build-programs.yml @@ -57,7 +57,7 @@ jobs: PROGRAMS: ${{ env.PROGRAMS }} - name: Upload program builds - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: program-builds # First wildcard ensures exported paths are consistently under the programs folder. diff --git a/.github/workflows/build-rust-client.yml b/.github/workflows/build-rust-client.yml index 5fbef042..fa09b171 100644 --- a/.github/workflows/build-rust-client.yml +++ b/.github/workflows/build-rust-client.yml @@ -57,7 +57,7 @@ jobs: run: cargo build --all-features --release - name: Upload Rust client builds - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: rust-client-builds # First wildcard ensures exported paths are consistently under the clients folder. diff --git a/.github/workflows/deploy-program.yml b/.github/workflows/deploy-program.yml index c00b1127..0c065735 100644 --- a/.github/workflows/deploy-program.yml +++ b/.github/workflows/deploy-program.yml @@ -86,15 +86,13 @@ jobs: with: version: ${{ env.ANCHOR_VERSION }} cache: ${{ env.CACHE }} - - + - name: Install cargo-release uses: metaplex-foundation/actions/install-cargo-release@v1 if: github.event.inputs.publish_crate == 'true' with: cache: ${{ env.CACHE }} - - name: Install cargo-release uses: metaplex-foundation/actions/install-cargo-release@v1 if: github.event.inputs.publish_crate == 'true' @@ -124,7 +122,7 @@ jobs: MAJOR=`echo ${VERSION} | cut -d. -f1` MINOR=`echo ${VERSION} | cut -d. -f2` PATCH=`echo ${VERSION} | cut -d. -f3` - + if [ "${{ inputs.bump }}" == "major" ]; then MAJOR=$((MAJOR + 1)) MINOR=0 @@ -135,7 +133,7 @@ jobs: else PATCH=$((PATCH + 1)) fi - + PROGRAM_VERSION="${MAJOR}.${MINOR}.${PATCH}" cp ./idls/${IDL_NAME}.json ./idls/${IDL_NAME}-previous.json @@ -145,7 +143,7 @@ jobs: echo PROGRAM_VERSION="${PROGRAM_VERSION}" >> $GITHUB_ENV - name: Download program builds - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: program-builds @@ -181,13 +179,13 @@ jobs: git stash git config user.name "${{ env.COMMIT_USER_NAME }}" git config user.email "${{ env.COMMIT_USER_EMAIL }}" - + cargo login ${{ secrets.CRATES_TOKEN }} cargo release ${{ inputs.bump }} --no-confirm --no-push --no-tag --no-publish --execute git reset --soft HEAD~1 git stash pop - + - name: Commit and tag new version uses: stefanzweifel/git-auto-commit-action@v4 if: github.event.inputs.publish_crate == 'true' && github.event.inputs.cluster == 'mainnet-beta' diff --git a/.github/workflows/test-rust-client.yml b/.github/workflows/test-rust-client.yml index c8025770..23c5d066 100644 --- a/.github/workflows/test-rust-client.yml +++ b/.github/workflows/test-rust-client.yml @@ -32,7 +32,7 @@ jobs: cache: ${{ env.CACHE }} - name: Download program builds - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: program-builds diff --git a/clients/js/package.json b/clients/js/package.json index de32d121..09133e00 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -26,7 +26,7 @@ "license": "Apache-2.0", "dependencies": { "@metaplex-foundation/mpl-token-metadata": "3.0.0-alpha.27", - "@metaplex-foundation/digital-asset-standard-api": "^1.0.0-alpha.0", + "@metaplex-foundation/digital-asset-standard-api": "^1.0.4", "@metaplex-foundation/mpl-toolbox": "^0.9.0", "@noble/hashes": "^1.3.1", "merkletreejs": "^0.3.9" @@ -69,4 +69,4 @@ ] }, "packageManager": "pnpm@8.2.0" -} +} \ No newline at end of file diff --git a/clients/js/pnpm-lock.yaml b/clients/js/pnpm-lock.yaml index 61565027..7989f4d9 100644 --- a/clients/js/pnpm-lock.yaml +++ b/clients/js/pnpm-lock.yaml @@ -1,9 +1,13 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@metaplex-foundation/digital-asset-standard-api': - specifier: ^1.0.0-alpha.0 - version: 1.0.0-alpha.0(@metaplex-foundation/umi@0.8.2) + specifier: ^1.0.4 + version: 1.0.4(@metaplex-foundation/umi@0.8.2) '@metaplex-foundation/mpl-token-metadata': specifier: 3.0.0-alpha.27 version: 3.0.0-alpha.27(@metaplex-foundation/umi@0.8.2) @@ -2044,12 +2048,13 @@ packages: - supports-color dev: true - /@metaplex-foundation/digital-asset-standard-api@1.0.0-alpha.0(@metaplex-foundation/umi@0.8.2): - resolution: {integrity: sha512-6L+pIt0Dab7Mv/ElduY9HAUqCSL5zzdCUC5dVmt//j4F7j8ZU7T+bxEXcrS4wGDMpmNsvhHUj4JP/qBAHxBJMw==} + /@metaplex-foundation/digital-asset-standard-api@1.0.4(@metaplex-foundation/umi@0.8.2): + resolution: {integrity: sha512-YSYyMnIoKNykDZTXsSCeiIOJ7NT5Ke2pzghXDsinRwHvwIZWv+zY5kJQBvTglAzYlt/GaI+noAhUZXXmSbp07A==} peerDependencies: - '@metaplex-foundation/umi': ^0.8.2 + '@metaplex-foundation/umi': '>= 0.8.2 < 1' dependencies: '@metaplex-foundation/umi': 0.8.2 + package.json: 2.0.1 dev: false /@metaplex-foundation/mpl-token-metadata@3.0.0-alpha.27(@metaplex-foundation/umi@0.8.2): @@ -2549,7 +2554,6 @@ packages: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: '@types/node': 20.5.9 - dev: true /@types/mdast@3.0.12: resolution: {integrity: sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==} @@ -2579,7 +2583,6 @@ packages: /@types/node@20.5.9: resolution: {integrity: sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==} - dev: true /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} @@ -2597,7 +2600,6 @@ packages: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: '@types/node': 20.5.9 - dev: true /@types/scheduler@0.16.3: resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} @@ -2986,6 +2988,12 @@ packages: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: true + /abs@1.3.14: + resolution: {integrity: sha512-PrS26IzwKLWwuURpiKl8wRmJ2KdR/azaVrLEBWG/TALwT20Y7qjtYp1qcMLHA4206hBHY5phv3w4pjf9NPv4Vw==} + dependencies: + ul: 5.2.15 + dev: false + /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -3590,6 +3598,11 @@ packages: resolution: {integrity: sha512-/3z+wB4icFt3r0USMwxujAqRvaD/B7rvGTsKhbhSQErVrJvkZCLhgNLJxU8MevahQVH6hCU9FsHdNUFbiwmE7Q==} dev: true + /capture-stack-trace@1.0.2: + resolution: {integrity: sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==} + engines: {node: '>=0.10.0'} + dev: false + /cbor@8.1.0: resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} engines: {node: '>=12.19'} @@ -3861,7 +3874,13 @@ packages: /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: true + + /create-error-class@3.0.2: + resolution: {integrity: sha512-gYTKKexFO3kh200H1Nit76sRwRtOY32vQd3jpAQKpLtZqyNsSQNfI4N7o3eP2wUjV35pTWKRYqFUDBvUha/Pkw==} + engines: {node: '>=0.10.0'} + dependencies: + capture-stack-trace: 1.0.2 + dev: false /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -3971,6 +3990,11 @@ packages: mimic-response: 3.1.0 dev: true + /deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + dev: false + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true @@ -3995,6 +4019,12 @@ packages: engines: {node: '>=10'} dev: true + /deffy@2.2.4: + resolution: {integrity: sha512-pLc9lsbsWjr6RxmJ2OLyvm+9l4j1yK69h+TML/gUit/t3vTijpkNGh8LioaJYTGO7F25m6HZndADcUOo2PsiUg==} + dependencies: + typpy: 2.3.13 + dev: false + /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} @@ -4102,6 +4132,12 @@ packages: engines: {node: '>=12'} dev: true + /duplexer2@0.1.4: + resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} + dependencies: + readable-stream: 2.3.8 + dev: false + /duplexify@3.7.1: resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==} dependencies: @@ -4175,6 +4211,18 @@ packages: strip-ansi: 6.0.1 dev: true + /err@1.1.1: + resolution: {integrity: sha512-N97Ybd2jJHVQ+Ft3Q5+C2gM3kgygkdeQmEqbN2z15UTVyyEsIwLA1VK39O1DHEJhXbwIFcJLqm6iARNhFANcQA==} + dependencies: + typpy: 2.3.13 + dev: false + + /error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: false + /es-abstract@1.22.1: resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} engines: {node: '>= 0.4'} @@ -4937,6 +4985,13 @@ packages: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: true + /exec-limiter@3.2.13: + resolution: {integrity: sha512-86Ri699bwiHZVBzTzNj8gspqAhCPchg70zPVWIh3qzUOA1pUMcb272Em3LPk8AE0mS95B9yMJhtqF8vFJAn0dA==} + dependencies: + limit-it: 3.2.10 + typpy: 2.3.13 + dev: false + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -5231,7 +5286,12 @@ packages: /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true + + /function.name@1.0.13: + resolution: {integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==} + dependencies: + noop6: 1.0.9 + dev: false /function.prototype.name@1.1.6: resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} @@ -5334,6 +5394,39 @@ packages: resolution: {integrity: sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ==} dev: true + /git-package-json@1.4.10: + resolution: {integrity: sha512-DRAcvbzd2SxGK7w8OgYfvKqhFliT5keX0lmSmVdgScgf1kkl5tbbo7Pam6uYoCa1liOiipKxQZG8quCtGWl/fA==} + dependencies: + deffy: 2.2.4 + err: 1.1.1 + gry: 5.0.8 + normalize-package-data: 2.5.0 + oargv: 3.4.10 + one-by-one: 3.2.8 + r-json: 1.3.0 + r-package-json: 1.0.9 + tmp: 0.0.28 + dev: false + + /git-source@1.1.10: + resolution: {integrity: sha512-XZZ7ZgnLL35oLgM/xjnLYgtlKlxJG0FohC1kWDvGkU7s1VKGXK0pFF/g1itQEwQ3D+uTQzBnzPi8XbqOv7Wc1Q==} + dependencies: + git-url-parse: 5.0.1 + dev: false + + /git-up@1.2.1: + resolution: {integrity: sha512-SRVN3rOLACva8imc7BFrB6ts5iISWKH1/h/1Z+JZYoUI7UVQM7gQqk4M2yxUENbq2jUUT09NEND5xwP1i7Ktlw==} + dependencies: + is-ssh: 1.4.0 + parse-url: 1.3.11 + dev: false + + /git-url-parse@5.0.1: + resolution: {integrity: sha512-4uSiOgrryNEMBX+gTWogenYRUh2j1D+95STTSEF2RCTgLkfJikl8c7BGr0Bn274hwuxTsbS2/FQ5pVS9FoXegQ==} + dependencies: + git-up: 1.2.1 + dev: false + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -5438,10 +5531,42 @@ packages: responselike: 2.0.1 dev: true + /got@5.7.1: + resolution: {integrity: sha512-1qd54GLxvVgzuidFmw9ze9umxS3rzhdBH6Wt6BTYrTQUXTN01vGGYXwzLzYLowNx8HBH3/c7kRyvx90fh13i7Q==} + engines: {node: '>=0.10.0 <7'} + dependencies: + '@types/keyv': 3.1.4 + '@types/responselike': 1.0.0 + create-error-class: 3.0.2 + duplexer2: 0.1.4 + is-redirect: 1.0.0 + is-retry-allowed: 1.2.0 + is-stream: 1.1.0 + lowercase-keys: 1.0.1 + node-status-codes: 1.0.0 + object-assign: 4.1.1 + parse-json: 2.2.0 + pinkie-promise: 2.0.1 + read-all-stream: 3.1.0 + readable-stream: 2.3.8 + timed-out: 3.1.3 + unzip-response: 1.0.2 + url-parse-lax: 1.0.0 + dev: false + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true + /gry@5.0.8: + resolution: {integrity: sha512-meq9ZjYVpLzZh3ojhTg7IMad9grGsx6rUUKHLqPnhLXzJkRQvEL2U3tQpS5/WentYTtHtxkT3Ew/mb10D6F6/g==} + dependencies: + abs: 1.3.14 + exec-limiter: 3.2.13 + one-by-one: 3.2.8 + ul: 5.2.15 + dev: false + /gunzip-maybe@1.4.2: resolution: {integrity: sha512-4haO1M4mLO91PW57BMsDFf75UmwoRX0GkdD+Faw+Lr+r/OZrOCS0pIBwOL1xCKQqnQzbNFGgK2V2CpBUPeFNTw==} hasBin: true @@ -5500,7 +5625,6 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /hast-util-to-estree@2.3.3: resolution: {integrity: sha512-ihhPIUPxN0v0w6M5+IiAZZrn0LH2uZomeWwhn7uP7avZC6TE7lIiEh2yBMPr5+zi1aUCXq6VoYRgs2Bw9xmycQ==} @@ -5528,6 +5652,10 @@ packages: resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} dev: true + /hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: false + /http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: true @@ -5659,7 +5787,10 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true + + /ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: false /inline-style-parser@0.1.1: resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} @@ -5732,6 +5863,10 @@ packages: is-typed-array: 1.1.12 dev: true + /is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: false + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: @@ -5767,7 +5902,6 @@ packages: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: has: 1.0.3 - dev: true /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} @@ -5880,6 +6014,11 @@ packages: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} dev: true + /is-redirect@1.0.0: + resolution: {integrity: sha512-cr/SlUEe5zOGmzvj9bUyC4LVvkNVAXu4GytXLNMr1pny+a65MpQ9IJzFHD5vi7FyJgb4qt27+eS3TuQnqB+RQw==} + engines: {node: '>=0.10.0'} + dev: false + /is-reference@3.0.1: resolution: {integrity: sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==} dependencies: @@ -5894,12 +6033,28 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-retry-allowed@1.2.0: + resolution: {integrity: sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==} + engines: {node: '>=0.10.0'} + dev: false + /is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 dev: true + /is-ssh@1.4.0: + resolution: {integrity: sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==} + dependencies: + protocols: 2.0.1 + dev: false + + /is-stream@1.1.0: + resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} + engines: {node: '>=0.10.0'} + dev: false + /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -5948,7 +6103,6 @@ packages: /isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: true /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} @@ -5966,6 +6120,10 @@ packages: ws: 7.5.9 dev: true + /iterate-object@1.3.4: + resolution: {integrity: sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==} + dev: false + /javascript-stringify@2.1.0: resolution: {integrity: sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==} dev: true @@ -6132,6 +6290,12 @@ packages: type-check: 0.4.0 dev: true + /limit-it@3.2.10: + resolution: {integrity: sha512-T0NK99pHnkimldr1WUqvbGV1oWDku/xC9J/OqzJFsV1jeOS6Bwl8W7vkeQIBqwiON9dTALws+rX/XPMQqWerDQ==} + dependencies: + typpy: 2.3.13 + dev: false + /load-json-file@7.0.1: resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -6193,6 +6357,11 @@ packages: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} dev: true + /lowercase-keys@1.0.1: + resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} + engines: {node: '>=0.10.0'} + dev: false + /lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} @@ -6779,7 +6948,6 @@ packages: /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true /minipass-collect@1.0.2: resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} @@ -6884,6 +7052,7 @@ packages: /node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} + requiresBuild: true dev: true optional: true @@ -6920,11 +7089,20 @@ packages: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true + /node-status-codes@1.0.0: + resolution: {integrity: sha512-1cBMgRxdMWE8KeWCqk2RIOrvUb0XCwYfEsY5/y2NlXyq4Y/RumnOZvTj4Nbr77+Vb2C+kyBoRTdkNOS8L3d/aQ==} + engines: {node: '>=0.10.0'} + dev: false + /nofilter@3.1.0: resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} engines: {node: '>=12.19'} dev: true + /noop6@1.0.9: + resolution: {integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==} + dev: false + /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -6933,6 +7111,15 @@ packages: abbrev: 1.1.1 dev: true + /normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.4 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + dev: false + /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -6967,10 +7154,22 @@ packages: strip-hex-prefix: 1.0.0 dev: false + /oargv@3.4.10: + resolution: {integrity: sha512-SXaMANv9sr7S/dP0vj0+Ybipa47UE1ntTWQ2rpPRhC6Bsvfl+Jg03Xif7jfL0sWKOYWK8oPjcZ5eJ82t8AP/8g==} + dependencies: + iterate-object: 1.3.4 + ul: 5.2.15 + dev: false + + /obj-def@1.0.9: + resolution: {integrity: sha512-bQ4ya3VYD6FAA1+s6mEhaURRHSmw4+sKaXE6UyXZ1XDYc5D+c7look25dFdydmLd18epUegh398gdDkMUZI9xg==} + dependencies: + deffy: 2.2.4 + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - dev: true /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -7022,6 +7221,13 @@ packages: wrappy: 1.0.2 dev: true + /one-by-one@3.2.8: + resolution: {integrity: sha512-HR/pSzZdm46Xqj58K+Bu64kMbSTw8/u77AwWvV+rprO/OsuR++pPlkUJn+SmwqBGRgHKwSKQ974V3uls7crIeQ==} + dependencies: + obj-def: 1.0.9 + sliced: 1.0.1 + dev: false + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -7071,7 +7277,6 @@ packages: /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - dev: true /outdent@0.8.0: resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} @@ -7167,6 +7372,31 @@ packages: netmask: 2.0.2 dev: true + /package-json-path@1.0.9: + resolution: {integrity: sha512-uNu7f6Ef7tQHZRnkyVnCtzdSYVN9uBtge/sG7wzcUaawFWkPYUq67iXxRGrQSg/q0tzxIB8jSyIYUKjG2Jn//A==} + dependencies: + abs: 1.3.14 + dev: false + + /package-json@2.4.0: + resolution: {integrity: sha512-PRg65iXMTt/uK8Rfh5zvzkUbfAPitF17YaCY+IbHsYgksiLvtzWWTUildHth3mVaZ7871OJ7gtP4LBRBlmAdXg==} + engines: {node: '>=0.10.0'} + dependencies: + got: 5.7.1 + registry-auth-token: 3.4.0 + registry-url: 3.1.0 + semver: 5.7.2 + dev: false + + /package.json@2.0.1: + resolution: {integrity: sha512-pSxZ6XR5yEawRN2ekxx9IKgPN5uNAYco7MCPxtBEWMKO3UKWa1X2CtQMzMgloeGj2g2o6cue3Sb5iPkByIJqlw==} + deprecated: Use pkg.json instead. + dependencies: + git-package-json: 1.4.10 + git-source: 1.1.10 + package-json: 2.4.0 + dev: false + /pako@0.2.9: resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==} dev: true @@ -7191,6 +7421,13 @@ packages: is-hexadecimal: 2.0.1 dev: true + /parse-json@2.2.0: + resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} + engines: {node: '>=0.10.0'} + dependencies: + error-ex: 1.3.2 + dev: false + /parse-ms@2.1.0: resolution: {integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==} engines: {node: '>=6'} @@ -7201,6 +7438,13 @@ packages: engines: {node: '>=12'} dev: true + /parse-url@1.3.11: + resolution: {integrity: sha512-1wj9nkgH/5EboDxLwaTMGJh3oH3f+Gue+aGdh631oCqoSBpokzmMmOldvOeBPtB8GJBYJbaF93KPzlkU+Y1ksg==} + dependencies: + is-ssh: 1.4.0 + protocols: 1.4.8 + dev: false + /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -7232,7 +7476,6 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} @@ -7280,6 +7523,18 @@ packages: engines: {node: '>=8.6'} dev: true + /pinkie-promise@2.0.1: + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie: 2.0.4 + dev: false + + /pinkie@2.0.4: + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} + engines: {node: '>=0.10.0'} + dev: false + /pkg-conf@4.0.0: resolution: {integrity: sha512-7dmgi4UY4qk+4mj5Cd8v/GExPo0K+SlY+hulOSdfZ/T6jVH6//y7NtzZo5WrfhDBxuQ0jCa7fLZmNaNh7EWL/w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -7400,6 +7655,11 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prepend-http@1.0.4: + resolution: {integrity: sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==} + engines: {node: '>=0.10.0'} + dev: false + /prettier-linter-helpers@1.0.0: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} @@ -7440,7 +7700,6 @@ packages: /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - dev: true /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} @@ -7460,6 +7719,14 @@ packages: resolution: {integrity: sha512-gVNZ74nqhRMiIUYWGQdosYetaKc83x8oT41a0LlV3AAFCAZwCpg4vmGkq8t34+cUhp3cnM4XDiU/7xlgK7HGrg==} dev: true + /protocols@1.4.8: + resolution: {integrity: sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==} + dev: false + + /protocols@2.0.1: + resolution: {integrity: sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==} + dev: false + /proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} @@ -7531,6 +7798,19 @@ packages: engines: {node: '>=10'} dev: true + /r-json@1.3.0: + resolution: {integrity: sha512-xesd+RHCpymPCYd9DvDvUr1w1IieSChkqYF1EpuAYrvCfLXji9NP36DvyYZJZZB5soVDvZ0WUtBoZaU1g5Yt9A==} + dependencies: + w-json: 1.3.10 + dev: false + + /r-package-json@1.0.9: + resolution: {integrity: sha512-G4Vpf1KImWmmPFGdtWQTU0L9zk0SjqEC4qs/jE7AQ+Ylmr5kizMzGeC4wnHp5+ijPqNN+2ZPpvyjVNdN1CDVcg==} + dependencies: + package-json-path: 1.0.9 + r-json: 1.3.0 + dev: false + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -7562,6 +7842,24 @@ packages: unpipe: 1.0.0 dev: true + /rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + dev: false + + /read-all-stream@3.1.0: + resolution: {integrity: sha512-DI1drPHbmBcUDWrJ7ull/F2Qb8HkwBncVx8/RpKYFSIACYaVRQReISYPdZz/mt1y1+qMCOrfReTopERmaxtP6w==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie-promise: 2.0.1 + readable-stream: 2.3.8 + dev: false + /readable-stream@1.1.14: resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} dependencies: @@ -7581,7 +7879,6 @@ packages: safe-buffer: 5.1.2 string_decoder: 1.1.1 util-deprecate: 1.0.2 - dev: true /readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} @@ -7660,6 +7957,20 @@ packages: unicode-match-property-value-ecmascript: 2.1.0 dev: true + /registry-auth-token@3.4.0: + resolution: {integrity: sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==} + dependencies: + rc: 1.2.8 + safe-buffer: 5.2.1 + dev: false + + /registry-url@3.1.0: + resolution: {integrity: sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==} + engines: {node: '>=0.10.0'} + dependencies: + rc: 1.2.8 + dev: false + /regjsparser@0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -7747,7 +8058,6 @@ packages: is-core-module: 2.13.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} @@ -7852,7 +8162,6 @@ packages: /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -7869,6 +8178,11 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: false + /semver@6.1.1: resolution: {integrity: sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==} hasBin: true @@ -7994,6 +8308,10 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /sliced@1.0.1: + resolution: {integrity: sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==} + dev: false + /smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -8065,6 +8383,28 @@ packages: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} dev: true + /spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.18 + dev: false + + /spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + dev: false + + /spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.18 + dev: false + + /spdx-license-ids@3.0.18: + resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} + dev: false + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true @@ -8147,7 +8487,6 @@ packages: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: safe-buffer: 5.1.2 - dev: true /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -8193,6 +8532,11 @@ packages: is-hex-prefixed: 1.0.0 dev: false + /strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + dev: false + /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -8235,7 +8579,6 @@ packages: /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true /tar-fs@2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} @@ -8305,6 +8648,18 @@ packages: engines: {node: '>=4'} dev: true + /timed-out@3.1.3: + resolution: {integrity: sha512-3RB4qgvPkxF/FGPnrzaWLhW1rxNK2sdH0mFjbhxkfTR6QXvcM3EtYm9L44UrhODZrZ+yhDXeMncLqi8QXn2MJg==} + engines: {node: '>=0.10.0'} + dev: false + + /tmp@0.0.28: + resolution: {integrity: sha512-c2mmfiBmND6SOVxzogm1oda0OJ1HZVIk/5n26N59dDTh80MUeavpiCls4PGAdkX1PFkKokLpcf7prSjCeXLsJg==} + engines: {node: '>=0.4.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: false + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -8541,10 +8896,23 @@ packages: hasBin: true dev: true + /typpy@2.3.13: + resolution: {integrity: sha512-vOxIcQz9sxHi+rT09SJ5aDgVgrPppQjwnnayTrMye1ODaU8gIZTDM19t9TxmEElbMihx2Nq/0/b/MtyKfayRqA==} + dependencies: + function.name: 1.0.13 + dev: false + /ufo@1.3.0: resolution: {integrity: sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==} dev: true + /ul@5.2.15: + resolution: {integrity: sha512-svLEUy8xSCip5IWnsRa0UOg+2zP0Wsj4qlbjTmX6GJSmvKMHADBuHOm1dpNkWqWPIGuVSqzUkV3Cris5JrlTRQ==} + dependencies: + deffy: 2.2.4 + typpy: 2.3.13 + dev: false + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -8672,6 +9040,11 @@ packages: engines: {node: '>= 0.8'} dev: true + /unzip-response@1.0.2: + resolution: {integrity: sha512-pwCcjjhEcpW45JZIySExBHYv5Y9EeL2OIGEfrSKp2dMUFGFv4CpvZkwJbVge8OvGH2BNNtJBx67DuKuJhf+N5Q==} + engines: {node: '>=0.10'} + dev: false + /update-browserslist-db@1.0.11(browserslist@4.21.10): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -8689,6 +9062,13 @@ packages: punycode: 2.3.0 dev: true + /url-parse-lax@1.0.0: + resolution: {integrity: sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA==} + engines: {node: '>=0.10.0'} + dependencies: + prepend-http: 1.0.4 + dev: false + /utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -8703,7 +9083,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true /utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} @@ -8734,6 +9113,13 @@ packages: resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} dev: true + /validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: false + /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -8867,6 +9253,10 @@ packages: resolution: {integrity: sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==} dev: true + /w-json@1.3.10: + resolution: {integrity: sha512-XadVyw0xE+oZ5FGApXsdswv96rOhStzKqL53uSe5UaTadABGkWIg1+DTx8kiZ/VqTZTBneoL0l65RcPe4W3ecw==} + dev: false + /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: diff --git a/clients/js/src/getAssetWithProof.ts b/clients/js/src/getAssetWithProof.ts index e64906e1..cf4fc18b 100644 --- a/clients/js/src/getAssetWithProof.ts +++ b/clients/js/src/getAssetWithProof.ts @@ -12,7 +12,12 @@ import { DasApiInterface, GetAssetProofRpcResponse, } from '@metaplex-foundation/digital-asset-standard-api'; -import { MetadataArgs, TokenProgramVersion, TokenStandard } from './generated'; +import { + fetchMerkleTree, + MetadataArgs, + TokenProgramVersion, + TokenStandard, +} from './generated'; export type AssetWithProof = { leafOwner: PublicKey; @@ -29,15 +34,34 @@ export type AssetWithProof = { rpcAssetProof: GetAssetProofRpcResponse; }; +type GetAssetWithProofOptions = { + /* Define the options properties here */ + truncateCanopy?: boolean; +}; + export const getAssetWithProof = async ( context: Pick & { rpc: DasApiInterface }, - assetId: PublicKey + assetId: PublicKey, + options?: GetAssetWithProofOptions ): Promise => { const [rpcAsset, rpcAssetProof] = await Promise.all([ context.rpc.getAsset(assetId), context.rpc.getAssetProof(assetId), ]); + let { proof } = rpcAssetProof; + if (options?.truncateCanopy) { + const merkleTreeAccount = await fetchMerkleTree( + context, + rpcAssetProof.tree_id + ); + const canopyDepth = Math.log2(merkleTreeAccount.canopy.length + 2) - 1; + proof = rpcAssetProof.proof.slice( + 0, + canopyDepth === 0 ? undefined : -canopyDepth + ); + } + const collectionString = (rpcAsset.grouping ?? []).find( (group) => group.group_key === 'collection' )?.group_value; @@ -70,7 +94,7 @@ export const getAssetWithProof = async ( creatorHash: publicKeyBytes(rpcAsset.compression.creator_hash), nonce: rpcAsset.compression.leaf_id, index: rpcAssetProof.node_index - 2 ** rpcAssetProof.proof.length, - proof: rpcAssetProof.proof, + proof, metadata, rpcAsset, rpcAssetProof, diff --git a/clients/js/test/dasApi.test.ts b/clients/js/test/dasApi.test.ts index 3581c102..bed80023 100644 --- a/clients/js/test/dasApi.test.ts +++ b/clients/js/test/dasApi.test.ts @@ -1,7 +1,13 @@ -import { Umi, createUmi, publicKey } from '@metaplex-foundation/umi'; +import { + Umi, + createUmi, + none, + publicKey, + publicKeyBytes, + some, +} from '@metaplex-foundation/umi'; import { testPlugins } from '@metaplex-foundation/umi-bundle-tests'; import anyTest, { TestFn } from 'ava'; -import { mplBubblegum } from '../src'; import { DasApiAsset, DasApiAssetCreator, @@ -9,6 +15,13 @@ import { GetAssetProofRpcResponse, dasApi, } from '@metaplex-foundation/digital-asset-standard-api'; +import { + AssetWithProof, + getAssetWithProof, + mplBubblegum, + TokenProgramVersion, + TokenStandard, +} from '../src'; const test = anyTest as TestFn<{ umi: Umi }>; const endpoint = process.env.READ_API_RPC_DEVNET; @@ -109,3 +122,548 @@ test('it can fetch the proof of a compressed asset by ID', async (t) => { tree_id: '6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E', }); }); + +test('it can fetch the proof of a compressed asset', async (t) => { + // Given a minted NFT on devnet. + // and a tree with depth 14 and canopy depth 0. + const { umi } = t.context; + const assetId = publicKey('BZHZ4GX7JZ1JxngRVtHJgUAnUZQ76ffBTsNXuqTVXvg5'); + + // When we fetch the proof of the asset using its ID with no truncation. + const asset = await getAssetWithProof(umi, assetId); + + // Then we expect the following data + // with a proof length of 14. + t.like(asset, { + leafOwner: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + leafDelegate: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + merkleTree: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + root: publicKeyBytes('2nbxuRGhqrQ2hmpYhr7AUVagsBWxW2srPfndr83a1Yaf'), + dataHash: publicKeyBytes('HB6sKWxroCdwkChjxckW3CF3fWupZHhPEua62GF46Ljs'), + creatorHash: publicKeyBytes('EKDHSGbrGztomDfuiV4iqiZ6LschDJPsFiXjZ83f92Md'), + nonce: 0, + index: 0, + proof: [ + publicKey('11111111111111111111111111111111'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + metadata: { + name: 'My NFT', + symbol: '', + uri: 'https://example.com/my-nft.json', + sellerFeeBasisPoints: 500, + primarySaleHappened: false, + isMutable: true, + editionNonce: none(), + tokenStandard: some(TokenStandard.NonFungible), + collection: none(), + uses: none(), + tokenProgramVersion: TokenProgramVersion.Original, + creators: [], + }, + rpcAsset: { + interface: 'V1_NFT', + id: assetId, + content: { + json_uri: 'https://example.com/my-nft.json', + metadata: { name: 'My NFT', symbol: '' }, + }, + authorities: [ + { + address: publicKey('GzLmvkKDrrvzQAg85C6LYF4LnkCkiPQw8dYpmPzEPXWV'), + scopes: ['full'], + }, + ], + compression: { + eligible: false, + compressed: true, + data_hash: publicKey('HB6sKWxroCdwkChjxckW3CF3fWupZHhPEua62GF46Ljs'), + creator_hash: publicKey('EKDHSGbrGztomDfuiV4iqiZ6LschDJPsFiXjZ83f92Md'), + asset_hash: publicKey('ATA3LjhmyvsuAVCwsnwyo5FbMFzK41a2mkng9SFy1jcX'), + tree: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + seq: 1, + leaf_id: 0, + }, + grouping: [] as DasApiAssetGrouping[], + royalty: { + royalty_model: 'creators', + target: null, + percent: 0.05, + basis_points: 500, + primary_sale_happened: false, + locked: false, + }, + creators: [] as DasApiAssetCreator[], + ownership: { + frozen: false, + delegated: false, + delegate: null, + ownership_model: 'single', + owner: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + }, + supply: { + print_max_supply: 0, + print_current_supply: 0, + edition_nonce: null, + }, + mutable: true, + burnt: false, + }, + rpcAssetProof: { + root: publicKey('2nbxuRGhqrQ2hmpYhr7AUVagsBWxW2srPfndr83a1Yaf'), + proof: [ + publicKey('11111111111111111111111111111111'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + node_index: 16384, + leaf: publicKey('ATA3LjhmyvsuAVCwsnwyo5FbMFzK41a2mkng9SFy1jcX'), + tree_id: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + }, + }); +}); + +test('it can fetch the truncated proof of a compressed asset with canopy depth 0', async (t) => { + // Given a minted NFT on devnet + // and a tree with depth 14 and canopy depth 0. + const { umi } = t.context; + const assetId = publicKey('BZHZ4GX7JZ1JxngRVtHJgUAnUZQ76ffBTsNXuqTVXvg5'); + + // When we fetch the proof of the asset using its ID with truncation. + const asset = await getAssetWithProof(umi, assetId, { truncateCanopy: true }); + + // Then we expect the following data + // with a proof length of 14. + t.like(asset, { + leafOwner: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + leafDelegate: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + merkleTree: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + root: publicKeyBytes('2nbxuRGhqrQ2hmpYhr7AUVagsBWxW2srPfndr83a1Yaf'), + dataHash: publicKeyBytes('HB6sKWxroCdwkChjxckW3CF3fWupZHhPEua62GF46Ljs'), + creatorHash: publicKeyBytes('EKDHSGbrGztomDfuiV4iqiZ6LschDJPsFiXjZ83f92Md'), + nonce: 0, + index: 0, + proof: [ + publicKey('11111111111111111111111111111111'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + metadata: { + name: 'My NFT', + symbol: '', + uri: 'https://example.com/my-nft.json', + sellerFeeBasisPoints: 500, + primarySaleHappened: false, + isMutable: true, + editionNonce: none(), + tokenStandard: some(TokenStandard.NonFungible), + collection: none(), + uses: none(), + tokenProgramVersion: TokenProgramVersion.Original, + creators: [], + }, + rpcAsset: { + interface: 'V1_NFT', + id: assetId, + content: { + json_uri: 'https://example.com/my-nft.json', + metadata: { name: 'My NFT', symbol: '' }, + }, + authorities: [ + { + address: publicKey('GzLmvkKDrrvzQAg85C6LYF4LnkCkiPQw8dYpmPzEPXWV'), + scopes: ['full'], + }, + ], + compression: { + eligible: false, + compressed: true, + data_hash: publicKey('HB6sKWxroCdwkChjxckW3CF3fWupZHhPEua62GF46Ljs'), + creator_hash: publicKey('EKDHSGbrGztomDfuiV4iqiZ6LschDJPsFiXjZ83f92Md'), + asset_hash: publicKey('ATA3LjhmyvsuAVCwsnwyo5FbMFzK41a2mkng9SFy1jcX'), + tree: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + seq: 1, + leaf_id: 0, + }, + grouping: [] as DasApiAssetGrouping[], + royalty: { + royalty_model: 'creators', + target: null, + percent: 0.05, + basis_points: 500, + primary_sale_happened: false, + locked: false, + }, + creators: [] as DasApiAssetCreator[], + ownership: { + frozen: false, + delegated: false, + delegate: null, + ownership_model: 'single', + owner: publicKey('EczRmPqSEWBXtcMKVK1avV87EXH5JZrRbTVdUJdnYaKo'), + }, + supply: { + print_max_supply: 0, + print_current_supply: 0, + edition_nonce: null, + }, + mutable: true, + burnt: false, + }, + rpcAssetProof: { + root: publicKey('2nbxuRGhqrQ2hmpYhr7AUVagsBWxW2srPfndr83a1Yaf'), + proof: [ + publicKey('11111111111111111111111111111111'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + node_index: 16384, + leaf: publicKey('ATA3LjhmyvsuAVCwsnwyo5FbMFzK41a2mkng9SFy1jcX'), + tree_id: publicKey('6tPxkhcjcfR7rXsnGwzh8rPnkiYt2r6tDGN1TUv4T15E'), + }, + }); +}); + +test('it can fetch the proof of a compressed asset with nonzero canopy depth', async (t) => { + // Given a minted NFT on devnet + // and a tree with depth 14 and canopy depth 9. + const { umi } = t.context; + const assetId = publicKey('3UowCweYWKsZKXmnYvq5jwsyD2eNtshjhjGEwk6yteEP'); + + // When we fetch the proof of the asset using its ID with no truncation. + const asset = await getAssetWithProof(umi, assetId); + + // Then we expect the following data + // with a proof length of 14. + t.like(asset, { + leafOwner: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + leafDelegate: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + merkleTree: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + root: publicKeyBytes('5YBtsaLbRgdhQVnzrVx3x3EACYHbnr1A41W2dEuy6JAB'), + dataHash: publicKeyBytes('4a2qppASrq9T3wPro2U5ZzqQBDHSkbZEhxGkBSBzXmyN'), + creatorHash: publicKeyBytes('Gk76AHtMYsTR4pgtuCQ1Rg8u9Mdc4ko29jVPKgGrrYMK'), + nonce: 0, + index: 0, + proof: [ + publicKey('68QTh52yKHqXWFiEZz7gnwSrBuiiuK43nWF6nGY2KMHK'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + metadata: { + name: 'Welcome to Creator Studio', + symbol: 'CS', + uri: 'https://arweave.net/0h9bJ_dST9JN7jdYgfW5SoTQ5b_6zYkpX7x5nLkeeD0', + sellerFeeBasisPoints: 0, + primarySaleHappened: false, + isMutable: false, + editionNonce: some(0), + tokenStandard: some(TokenStandard.NonFungible), + collection: some({ + verified: true, + key: publicKey('5141VSFjgYFEKTy45aT1tUEeApwQ1eXPEfzRdRVt7xTL'), + }), + uses: none(), + tokenProgramVersion: TokenProgramVersion.Original, + creators: [ + { + address: publicKey('3HxqsUguP6E7CNqjvpEAnJ8v86qbyJgWvN2idAKygLdD'), + share: 100, + verified: false, + }, + { + address: publicKey('792RcrqqmoWUh6LbijAfpAkxR2kVCoBGrmshWzfy7HgD'), + share: 0, + verified: false, + }, + ], + }, + rpcAsset: { + interface: 'V1_NFT', + id: assetId, + content: { + json_uri: + 'https://arweave.net/0h9bJ_dST9JN7jdYgfW5SoTQ5b_6zYkpX7x5nLkeeD0', + metadata: { name: 'Welcome to Creator Studio', symbol: 'CS' }, + }, + authorities: [ + { + address: publicKey('EMNC5LShRmEBaPbG9xSnALaFjkMtuFbQ8ehZLEzkWPfW'), + scopes: ['full'], + }, + ], + compression: { + eligible: false, + compressed: true, + data_hash: publicKey('4a2qppASrq9T3wPro2U5ZzqQBDHSkbZEhxGkBSBzXmyN'), + creator_hash: publicKey('Gk76AHtMYsTR4pgtuCQ1Rg8u9Mdc4ko29jVPKgGrrYMK'), + asset_hash: publicKey('GBfJEitNVPm8mADUCP67c2RG1FGmyFteBZqTeMCQL2xR'), + tree: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + seq: 3, + leaf_id: 0, + }, + grouping: [ + { + group_key: 'collection', + group_value: '5141VSFjgYFEKTy45aT1tUEeApwQ1eXPEfzRdRVt7xTL', + }, + ] as DasApiAssetGrouping[], + royalty: { + royalty_model: 'creators', + target: null, + percent: 0, + basis_points: 0, + primary_sale_happened: false, + locked: false, + }, + creators: [ + { + address: publicKey('3HxqsUguP6E7CNqjvpEAnJ8v86qbyJgWvN2idAKygLdD'), + share: 100, + verified: false, + }, + { + address: publicKey('792RcrqqmoWUh6LbijAfpAkxR2kVCoBGrmshWzfy7HgD'), + share: 0, + verified: false, + }, + ] as DasApiAssetCreator[], + ownership: { + frozen: false, + delegated: false, + delegate: null, + ownership_model: 'single', + owner: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + }, + supply: { + print_max_supply: 0, + print_current_supply: 0, + edition_nonce: 0, + }, + mutable: false, + burnt: false, + }, + rpcAssetProof: { + root: publicKey('5YBtsaLbRgdhQVnzrVx3x3EACYHbnr1A41W2dEuy6JAB'), + proof: [ + publicKey('68QTh52yKHqXWFiEZz7gnwSrBuiiuK43nWF6nGY2KMHK'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + node_index: 16384, + leaf: publicKey('GBfJEitNVPm8mADUCP67c2RG1FGmyFteBZqTeMCQL2xR'), + tree_id: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + }, + }); +}); + +test('it can fetch the truncated proof of a compressed asset with nonzero canopy depth', async (t) => { + // Given a minted NFT on devnet + // and a tree with depth 14 and canopy depth 9. + const { umi } = t.context; + const assetId = publicKey('3UowCweYWKsZKXmnYvq5jwsyD2eNtshjhjGEwk6yteEP'); + + // When we fetch the proof of the asset using its ID with truncation. + const asset = await getAssetWithProof(umi, assetId, { truncateCanopy: true }); + + // Then we expect the following data + // with a proof length of 5. + t.like(asset, { + leafOwner: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + leafDelegate: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + merkleTree: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + root: publicKeyBytes('5YBtsaLbRgdhQVnzrVx3x3EACYHbnr1A41W2dEuy6JAB'), + dataHash: publicKeyBytes('4a2qppASrq9T3wPro2U5ZzqQBDHSkbZEhxGkBSBzXmyN'), + creatorHash: publicKeyBytes('Gk76AHtMYsTR4pgtuCQ1Rg8u9Mdc4ko29jVPKgGrrYMK'), + nonce: 0, + index: 0, + proof: [ + publicKey('68QTh52yKHqXWFiEZz7gnwSrBuiiuK43nWF6nGY2KMHK'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + ], + metadata: { + name: 'Welcome to Creator Studio', + symbol: 'CS', + uri: 'https://arweave.net/0h9bJ_dST9JN7jdYgfW5SoTQ5b_6zYkpX7x5nLkeeD0', + sellerFeeBasisPoints: 0, + primarySaleHappened: false, + isMutable: false, + editionNonce: some(0), + tokenStandard: some(TokenStandard.NonFungible), + collection: some({ + verified: true, + key: publicKey('5141VSFjgYFEKTy45aT1tUEeApwQ1eXPEfzRdRVt7xTL'), + }), + uses: none(), + tokenProgramVersion: TokenProgramVersion.Original, + creators: [ + { + address: publicKey('3HxqsUguP6E7CNqjvpEAnJ8v86qbyJgWvN2idAKygLdD'), + share: 100, + verified: false, + }, + { + address: publicKey('792RcrqqmoWUh6LbijAfpAkxR2kVCoBGrmshWzfy7HgD'), + share: 0, + verified: false, + }, + ], + }, + rpcAsset: { + interface: 'V1_NFT', + id: assetId, + content: { + json_uri: + 'https://arweave.net/0h9bJ_dST9JN7jdYgfW5SoTQ5b_6zYkpX7x5nLkeeD0', + metadata: { name: 'Welcome to Creator Studio', symbol: 'CS' }, + }, + authorities: [ + { + address: publicKey('EMNC5LShRmEBaPbG9xSnALaFjkMtuFbQ8ehZLEzkWPfW'), + scopes: ['full'], + }, + ], + compression: { + eligible: false, + compressed: true, + data_hash: publicKey('4a2qppASrq9T3wPro2U5ZzqQBDHSkbZEhxGkBSBzXmyN'), + creator_hash: publicKey('Gk76AHtMYsTR4pgtuCQ1Rg8u9Mdc4ko29jVPKgGrrYMK'), + asset_hash: publicKey('GBfJEitNVPm8mADUCP67c2RG1FGmyFteBZqTeMCQL2xR'), + tree: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + seq: 3, + leaf_id: 0, + }, + grouping: [ + { + group_key: 'collection', + group_value: '5141VSFjgYFEKTy45aT1tUEeApwQ1eXPEfzRdRVt7xTL', + }, + ] as DasApiAssetGrouping[], + royalty: { + royalty_model: 'creators', + target: null, + percent: 0, + basis_points: 0, + primary_sale_happened: false, + locked: false, + }, + creators: [ + { + address: publicKey('3HxqsUguP6E7CNqjvpEAnJ8v86qbyJgWvN2idAKygLdD'), + share: 100, + verified: false, + }, + { + address: publicKey('792RcrqqmoWUh6LbijAfpAkxR2kVCoBGrmshWzfy7HgD'), + share: 0, + verified: false, + }, + ] as DasApiAssetCreator[], + ownership: { + frozen: false, + delegated: false, + delegate: null, + ownership_model: 'single', + owner: publicKey('BJjUoux3xacYcRZV31Ytsi4haJb3HgyzmweVDHutiLWU'), + }, + supply: { + print_max_supply: 0, + print_current_supply: 0, + edition_nonce: 0, + }, + mutable: false, + burnt: false, + }, + rpcAssetProof: { + root: publicKey('5YBtsaLbRgdhQVnzrVx3x3EACYHbnr1A41W2dEuy6JAB'), + proof: [ + publicKey('68QTh52yKHqXWFiEZz7gnwSrBuiiuK43nWF6nGY2KMHK'), + publicKey('Cf5tmmFZ4D31tviuJezHdFLf5WF7yFvzfxNyftKsqTwr'), + publicKey('DAbAU9srHpEUogXWuhy5VZ7g8UX9STymELtndcx1xgP1'), + publicKey('3HCYqQRcQSChEuAw1ybNYHibrTNNjzbYzm56cmEmivB6'), + publicKey('GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh'), + publicKey('zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C'), + publicKey('ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91'), + publicKey('JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta'), + publicKey('BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc'), + publicKey('EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR'), + publicKey('HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL'), + publicKey('HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7'), + publicKey('4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq'), + publicKey('E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2'), + ], + node_index: 16384, + leaf: publicKey('GBfJEitNVPm8mADUCP67c2RG1FGmyFteBZqTeMCQL2xR'), + tree_id: publicKey('B6RTei821Mi4ZAFqXGCCeHMJbixnweFJMY49UZBs4LWN'), + }, + }); +});