diff --git a/.gitignore b/.gitignore index 62b7fd67..a023c4e4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dist .amman .crates .bin +.idea diff --git a/clients/js/package.json b/clients/js/package.json index 0b252ced..b8f55fa1 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -28,7 +28,7 @@ "@metaplex-foundation/umi": ">= 0.8.2 < 1" }, "dependencies": { - "@metaplex-foundation/mpl-toolbox": "^0.9.0" + "@metaplex-foundation/mpl-toolbox": "^0.9.4" }, "devDependencies": { "@ava/typescript": "^3.0.1", diff --git a/clients/js/pnpm-lock.yaml b/clients/js/pnpm-lock.yaml index ab033b14..aedec663 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/mpl-toolbox': - specifier: ^0.9.0 - version: 0.9.0(@metaplex-foundation/umi@0.8.2) + specifier: ^0.9.4 + version: 0.9.4(@metaplex-foundation/umi@0.8.2) devDependencies: '@ava/typescript': @@ -1619,10 +1623,10 @@ packages: - supports-color dev: true - /@metaplex-foundation/mpl-toolbox@0.9.0(@metaplex-foundation/umi@0.8.2): - resolution: {integrity: sha512-FnzwA3rKLcwm/6DztDGSVfmabVMJDsEWOOpUMKtQG7iXNwtA1z5wICIzD13+P/uaEJX5tCSC4kHstJ7rDW5/7Q==} + /@metaplex-foundation/mpl-toolbox@0.9.4(@metaplex-foundation/umi@0.8.2): + resolution: {integrity: sha512-fd6JxfoLbj/MM8FG2x91KYVy1U6AjBQw4qjt7+Da3trzQaWnSaYHDcYRG/53xqfvZ9qofY1T2t53GXPlD87lnQ==} peerDependencies: - '@metaplex-foundation/umi': ^0.8.2 + '@metaplex-foundation/umi': '>= 0.8.2 < 1' dependencies: '@metaplex-foundation/umi': 0.8.2 dev: false @@ -2986,8 +2990,8 @@ packages: ieee754: 1.2.1 dev: true - /bufferutil@4.0.7: - resolution: {integrity: sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==} + /bufferutil@4.0.8: + resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} requiresBuild: true dependencies: @@ -3125,7 +3129,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /chownr@1.1.4: @@ -3384,8 +3388,8 @@ packages: time-zone: 1.0.0 dev: true - /deasync@0.1.28: - resolution: {integrity: sha512-QqLF6inIDwiATrfROIyQtwOQxjZuek13WRYZ7donU5wJPLoP67MnYxA6QtqdvdBy2mMqv5m3UefBVdJjvevOYg==} + /deasync@0.1.29: + resolution: {integrity: sha512-EBtfUhVX23CE9GR6m+F8WPeImEE4hR/FW9RkK0PMl9V1t283s0elqsTD8EZjaKX28SY1BW2rYfCgNsAYdpamUw==} engines: {node: '>=0.11.0'} requiresBuild: true dependencies: @@ -4592,8 +4596,8 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -6248,6 +6252,7 @@ packages: /node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} + requiresBuild: true dev: true optional: true @@ -7160,9 +7165,9 @@ packages: '@babel/runtime': 7.20.13 eventemitter3: 4.0.7 uuid: 8.3.2 - ws: 8.12.1(bufferutil@4.0.7)(utf-8-validate@5.0.10) + ws: 8.12.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: - bufferutil: 4.0.7 + bufferutil: 4.0.8 utf-8-validate: 5.0.10 dev: true @@ -8179,7 +8184,7 @@ packages: optional: true dev: true - /ws@8.12.1(bufferutil@4.0.7)(utf-8-validate@5.0.10): + /ws@8.12.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==} engines: {node: '>=10.0.0'} peerDependencies: @@ -8191,7 +8196,7 @@ packages: utf-8-validate: optional: true dependencies: - bufferutil: 4.0.7 + bufferutil: 4.0.8 utf-8-validate: 5.0.10 dev: true @@ -8220,7 +8225,7 @@ packages: unist-util-visit: 4.1.2 vfile: 5.3.7 optionalDependencies: - deasync: 0.1.28 + deasync: 0.1.29 transitivePeerDependencies: - supports-color dev: true diff --git a/clients/js/test/mintV1.test.ts b/clients/js/test/mintV1.test.ts index 01f487cb..710c450d 100644 --- a/clients/js/test/mintV1.test.ts +++ b/clients/js/test/mintV1.test.ts @@ -1,6 +1,5 @@ import { Mint, - SPL_ASSOCIATED_TOKEN_PROGRAM_ID, Token, fetchMint, fetchToken, @@ -11,7 +10,6 @@ import { percentAmount, publicKey, } from '@metaplex-foundation/umi'; -import { publicKey as publicKeySerializer } from '@metaplex-foundation/umi/serializers'; import test from 'ava'; import { TokenStandard, createV1, mintV1 } from '../src'; import { SPL_TOKEN_2022_PROGRAM_ID, createUmi } from './_setup'; @@ -177,11 +175,11 @@ test('it can mint a new ProgrammableNonFungible with Token-2022', async (t) => { }).sendAndConfirm(umi); // And we derive the associated token account from SPL Token 2022. - const [token] = umi.eddsa.findPda(SPL_ASSOCIATED_TOKEN_PROGRAM_ID, [ - publicKeySerializer().serialize(umi.identity.publicKey), - publicKeySerializer().serialize(SPL_TOKEN_2022_PROGRAM_ID), - publicKeySerializer().serialize(mint.publicKey), - ]); + const token = findAssociatedTokenPda(umi, { + mint: mint.publicKey, + owner: umi.identity.publicKey, + tokenProgramId: SPL_TOKEN_2022_PROGRAM_ID, + }); // When we mint one token. await mintV1(umi, {