diff --git a/clients/js/package.json b/clients/js/package.json index 7f5b55d..4df3e4c 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -25,25 +25,25 @@ "author": "Metaplex Maintainers ", "license": "Apache-2.0", "dependencies": { - "@solana/addresses": "2.0.0-experimental.445121c", - "@solana/codecs-core": "2.0.0-experimental.445121c", - "@solana/codecs-data-structures": "2.0.0-experimental.445121c", - "@solana/codecs-numbers": "2.0.0-experimental.445121c", - "@solana/codecs-strings": "2.0.0-experimental.445121c", - "@solana/instructions": "2.0.0-experimental.445121c", - "@solana/keys": "2.0.0-experimental.445121c", - "@solana/options": "2.0.0-experimental.445121c", - "@solana/signers": "2.0.0-experimental.445121c", - "@solana/transactions": "2.0.0-experimental.445121c" + "@solana/addresses": "2.0.0-experimental.9741939", + "@solana/codecs-core": "2.0.0-experimental.9741939", + "@solana/codecs-data-structures": "2.0.0-experimental.9741939", + "@solana/codecs-numbers": "2.0.0-experimental.9741939", + "@solana/codecs-strings": "2.0.0-experimental.9741939", + "@solana/instructions": "2.0.0-experimental.9741939", + "@solana/keys": "2.0.0-experimental.9741939", + "@solana/options": "2.0.0-experimental.9741939", + "@solana/signers": "2.0.0-experimental.9741939", + "@solana/transactions": "2.0.0-experimental.9741939" }, "devDependencies": { "@ava/typescript": "^3.0.1", - "@solana/functional": "2.0.0-experimental.445121c", - "@solana/rpc-core": "2.0.0-experimental.445121c", - "@solana/rpc-transport": "2.0.0-experimental.445121c", - "@solana/rpc-types": "2.0.0-experimental.445121c", - "@solana/web3.js": "2.0.0-experimental.445121c", - "@solana/webcrypto-ed25519-polyfill": "2.0.0-experimental.2938d71", + "@solana/functional": "2.0.0-experimental.9741939", + "@solana/rpc-core": "2.0.0-experimental.9741939", + "@solana/rpc-transport": "2.0.0-experimental.9741939", + "@solana/rpc-types": "2.0.0-experimental.9741939", + "@solana/web3.js": "2.0.0-experimental.9741939", + "@solana/webcrypto-ed25519-polyfill": "2.0.0-experimental.9741939", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.46.1", "ava": "^5.1.0", diff --git a/clients/js/pnpm-lock.yaml b/clients/js/pnpm-lock.yaml index e78e233..6af33eb 100644 --- a/clients/js/pnpm-lock.yaml +++ b/clients/js/pnpm-lock.yaml @@ -2,58 +2,58 @@ lockfileVersion: '6.0' dependencies: '@solana/addresses': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) '@solana/codecs-core': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/codecs-data-structures': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/codecs-numbers': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/codecs-strings': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) '@solana/instructions': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/keys': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) '@solana/options': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/signers': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) '@solana/transactions': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) devDependencies: '@ava/typescript': specifier: ^3.0.1 version: 3.0.1 '@solana/functional': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/rpc-core': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/rpc-transport': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(ws@8.14.2) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(ws@8.14.2) '@solana/rpc-types': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@solana/web3.js': - specifier: 2.0.0-experimental.445121c - version: 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.14.2) + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.14.2) '@solana/webcrypto-ed25519-polyfill': - specifier: 2.0.0-experimental.2938d71 - version: 2.0.0-experimental.2938d71 + specifier: 2.0.0-experimental.9741939 + version: 2.0.0-experimental.9741939 '@typescript-eslint/eslint-plugin': specifier: ^5.0.0 version: 5.47.0(@typescript-eslint/parser@5.47.0)(eslint@8.30.0)(typescript@4.9.4) @@ -1654,15 +1654,8 @@ packages: - supports-color dev: true - /@noble/curves@1.2.0: - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - dependencies: - '@noble/hashes': 1.3.2 - dev: true - - /@noble/hashes@1.3.2: - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} + /@noble/ed25519@2.0.0: + resolution: {integrity: sha512-/extjhkwFupyopDrt80OMWKdLgP429qLZj+z6sYJz90rF2Iz0gjZh2ArMKPImUl13Kx+0EXI2hN9T/KJV0/Zng==} dev: true /@nodelib/fs.scandir@2.1.5: @@ -1808,125 +1801,125 @@ packages: engines: {node: '>=10'} dev: true - /@solana/addresses@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-WTqL0cCXA/oVvzjKAjthrwHyJj9aq0OjK7wqhiaHxhBmYW/B5zt1zA8XYVTEYhLUFM0Eb2RbqZH29W0BViakGg==} + /@solana/addresses@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-5yGih/laPMZe97b8vFuknLHBNqW495L79CrsLPVz6F1F0FVq/Af1GbG9IB+CqYofNJJV5Z0x79E3BfaRV0HmUw==} dependencies: - '@solana/assertions': 2.0.0-experimental.445121c - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-strings': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/assertions': 2.0.0-experimental.9741939 + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-strings': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - /@solana/assertions@2.0.0-experimental.445121c: - resolution: {integrity: sha512-4fYYXR8Y2GAjxizCs6BftybZkYG5HWx9CRLM0MNot3ife5sQa8y4TWrOG7Ob02oRPINiR7n/U4wtZVYiPgOR4w==} + /@solana/assertions@2.0.0-experimental.9741939: + resolution: {integrity: sha512-uEFlWPGevwxScaImQIdkESLCVmrDLy9khQ3XwDl84ou18hmnP60yVGMkN99DrDynjY0sO+t7bNtj0KdqYcKOEw==} - /@solana/codecs-core@2.0.0-experimental.445121c: - resolution: {integrity: sha512-chRDBDmA26gvvsHbFloFhJv5ZjWhPXXqFTmKoyoAOUE7Ac8HYqeWL7P3GvVIAtiCIcTKAX+iJIa/EDhLwNncIQ==} + /@solana/codecs-core@2.0.0-experimental.9741939: + resolution: {integrity: sha512-7E51aEwLW+1ta6VWbEq0CbvwSUOcIwmaQCLpkOKsF6cwSNqE5GDv/jw9zKuiYOynlBFQO1Ws59a/hlb2wwwWKg==} - /@solana/codecs-data-structures@2.0.0-experimental.445121c: - resolution: {integrity: sha512-BtEfm3Fx6eCSt7jEutj255AnL4tutSUmdbVMG8QllqZ30Xx93dHLRp4vayW7cdliQajntaW1xv9V+H73nuX+sw==} + /@solana/codecs-data-structures@2.0.0-experimental.9741939: + resolution: {integrity: sha512-Ghjx0pFEA22T/cpqg3zXHYlnxqKytjTr1QjgfhWvBrlVFkqr3ZQL4av9/V6sHKvpoi+JNkEwM1wE+tlpt/54CA==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-numbers': 2.0.0-experimental.445121c + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-numbers': 2.0.0-experimental.9741939 - /@solana/codecs-numbers@2.0.0-experimental.445121c: - resolution: {integrity: sha512-yuzARD4fNRvmHvN6GxsNoSjze4T4VjFfdU0KKPMtUXeQrL8aZz8u7fNgoZ1JHIlE/38hhE6mtlH0oqT/J2SIIg==} + /@solana/codecs-numbers@2.0.0-experimental.9741939: + resolution: {integrity: sha512-VXBvw8LZdGUJGuC33EFzvaUxCvgNtr9y9Td8zjK9wJDqKSzR0+G53CJv5K4AF25LUu8du8XHBK3VEz3YHl44nQ==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.445121c + '@solana/codecs-core': 2.0.0-experimental.9741939 - /@solana/codecs-strings@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-jrqxsBniKTpKThfSFrm6kH4mmHloEUkNzPlom63McM04gZyICs9QbmW6RtzB3dP57LWsoWud2gE9vW4wxsm+Dg==} + /@solana/codecs-strings@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-J1DCTJsAMhFcIIvys/yNWM2Vr4HEWi+LzFB9xxdH+FHTynApjTMd4vI7frgnckuWH7ynp8EZFPnBTje1BphQrw==} peerDependencies: fastestsmallesttextencoderdecoder: ^1.0.22 dependencies: - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-numbers': 2.0.0-experimental.445121c + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-numbers': 2.0.0-experimental.9741939 fastestsmallesttextencoderdecoder: 1.0.22 - /@solana/functional@2.0.0-experimental.445121c: - resolution: {integrity: sha512-MvAglKkWXH54ulqhMzQUE7O5vtgcNhgsEZw6Dt/bvYS0DfEpfnw1GdwYdjTAB4b8k8qmM5aKEUTk3UiiaaFnHw==} + /@solana/functional@2.0.0-experimental.9741939: + resolution: {integrity: sha512-MTvGftTJaZY8sJ8TCnNch/7ROndYo/SRqHzdiCP5J3YBkd5IWlRmPhDQYmuUOpR30p7B6vb/yb3Q20QroZ85WQ==} - /@solana/instructions@2.0.0-experimental.445121c: - resolution: {integrity: sha512-MN1Cyl2Z3Eqn33BypteXwAdeRaCx4tiABJsHIJYQh6ZCuydW5qq5TD8sPAfdJAIw9z59nwWPR9wUo1AsiTGbbw==} + /@solana/instructions@2.0.0-experimental.9741939: + resolution: {integrity: sha512-Bycup54GNfRv7LLDD8eWihmiARJJiq1DV7ru8Uu3VQgzikuvlAZ3g572yl5OrhUvG3mTUMrMQZ38rHLk0qrpMQ==} - /@solana/keys@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-QIWQx2oqXeNEgcVTw8A3TXcIa8eDPeuRn5UO7KtJiDXVXY3k0upN/1JMuN70K0QzFLsibPvhcqyPBfSOXxqzMw==} + /@solana/keys@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-fjtXb7zYBNIVcO79yDXgq7S+7tuEmu6nryemJLnzwy6U9GURnE9UTGiWjwgXaroGgr6fTqXz1/0AXSwbd7jONg==} dependencies: - '@solana/assertions': 2.0.0-experimental.445121c - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-strings': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/assertions': 2.0.0-experimental.9741939 + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-strings': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - /@solana/options@2.0.0-experimental.445121c: - resolution: {integrity: sha512-QbNXh5y4A+9z0+kttJSb9TQZbcEUZhShdaqWeY6BDKOMdUEX6hp5uisl2UT+z3393+vLqs0NklQjr07VgqJbhA==} + /@solana/options@2.0.0-experimental.9741939: + resolution: {integrity: sha512-Fj76WDb+SWEEN3i0gEVQHGPHR2v54ECHILluQ5r18deLHjtZpD48a0dZepf0YcyAG7OHofkRdPxInZ3YYDuZeQ==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-numbers': 2.0.0-experimental.445121c + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-numbers': 2.0.0-experimental.9741939 dev: false - /@solana/rpc-core@2.0.0-experimental.445121c: - resolution: {integrity: sha512-zEkHe55D1eVMilPHkdte4pCu/rl4p3yIG3i90x7ixv5+xUgrAHdlTfyBZ+mX3CRxydmOljFykloxOBuVPG9lJg==} + /@solana/rpc-core@2.0.0-experimental.9741939: + resolution: {integrity: sha512-LsrAkyIJ9jODWEGi0wRy1wCpjCFBUxEmnAQ4lwoRB8kxviQJ5DkUk8tje/7ZS6pPZbO71w48utk+zi8TIQzAQg==} dev: true - /@solana/rpc-transport@2.0.0-experimental.445121c(ws@8.14.2): - resolution: {integrity: sha512-7a+lqx8Od1VFWF56E8d0XveCCZn9b1Ga38rrHwH6VrOmEbEuhb7z4k5pTlGtcPtX0p05qVI6j2CsH4K4oW9mWA==} + /@solana/rpc-transport@2.0.0-experimental.9741939(ws@8.14.2): + resolution: {integrity: sha512-w3PeLlo1kMdsW9p1SgV7lZtYd39uSb2X/fkqThsDnq29pUqU5HeRr09bfx/76xsiApvR1usGBrGA2iVHHO79Ow==} peerDependencies: ws: ^8.14.0 dependencies: ws: 8.14.2 dev: true - /@solana/rpc-types@2.0.0-experimental.445121c: - resolution: {integrity: sha512-zTGgF8aNwW7WA99lCEbnP7EMR+vMN+FHPK1mdptwJdAjZALqDijmjFdWw5Y6aABVwAvfmtXD69LJtCSz0kp4ZQ==} + /@solana/rpc-types@2.0.0-experimental.9741939: + resolution: {integrity: sha512-iyf0R03lheGear1Lu9ibX6jzSd67hTWptcfSakdKRvZ0q8NRocMM7upEvbddPsAhnF16pc0T9OpiDDSMHnayPQ==} dev: true - /@solana/signers@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-cbTX/OO5yBV34BpfPwIeAgxXzcE0oZ+jC0bqP1fH8bNq8NHmVJpSigOkJIW+NP/y1p7J2arBuurPL0D1UFdiHA==} + /@solana/signers@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-dSSLfKR9dcFJe8GTuPmCd4x/nDsAAFZq9vYLd02FkOSX6b/OwCe2AHe8gunneKrY3Y+qf9wBe0XE+wWb/KTQ/A==} dependencies: - '@solana/addresses': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/instructions': 2.0.0-experimental.445121c - '@solana/keys': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/transactions': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/addresses': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/instructions': 2.0.0-experimental.9741939 + '@solana/keys': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/transactions': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder dev: false - /@solana/transactions@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-qDcq8/3ByyGZxdaSdbKHuPf8ij9TLr1Cjxo+imE82DLZ1NlXdEFmGKKJJTLSu80MJFjYKnp9gkc2kzGLAwPmSg==} + /@solana/transactions@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-R9Z0RczZcLFbeQ+9/6eJJe7uO1oZUsNWhXrpS51WuvV+c7pZL4k+JXjexd/v4E4lU1Vj66UyMPaE1SWNpnfYCg==} dependencies: - '@solana/addresses': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/codecs-core': 2.0.0-experimental.445121c - '@solana/codecs-data-structures': 2.0.0-experimental.445121c - '@solana/codecs-numbers': 2.0.0-experimental.445121c - '@solana/codecs-strings': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/functional': 2.0.0-experimental.445121c - '@solana/keys': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/addresses': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/codecs-core': 2.0.0-experimental.9741939 + '@solana/codecs-data-structures': 2.0.0-experimental.9741939 + '@solana/codecs-numbers': 2.0.0-experimental.9741939 + '@solana/codecs-strings': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/functional': 2.0.0-experimental.9741939 + '@solana/keys': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - /@solana/web3.js@2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.14.2): - resolution: {integrity: sha512-n3tDfE7ukCtbBTpxH/YYiTYcHqaayb2TkX/PeyWyxp+xbYp9B6iIkCed3375v9OrC8k2G/ze/4nt4d7kGT7vUw==} - dependencies: - '@solana/addresses': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/codecs-strings': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/functional': 2.0.0-experimental.445121c - '@solana/instructions': 2.0.0-experimental.445121c - '@solana/keys': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/rpc-core': 2.0.0-experimental.445121c - '@solana/rpc-transport': 2.0.0-experimental.445121c(ws@8.14.2) - '@solana/rpc-types': 2.0.0-experimental.445121c - '@solana/transactions': 2.0.0-experimental.445121c(fastestsmallesttextencoderdecoder@1.0.22) + /@solana/web3.js@2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.14.2): + resolution: {integrity: sha512-WtFRMFKVzz4m2WRwJQDYU1PDhPt2CIXP53T0jUh/Nq2V98cYB4uamjxK5kQ84FgKds9qmKXfHKEoo22XgYxtkQ==} + dependencies: + '@solana/addresses': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/codecs-strings': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/functional': 2.0.0-experimental.9741939 + '@solana/instructions': 2.0.0-experimental.9741939 + '@solana/keys': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/rpc-core': 2.0.0-experimental.9741939 + '@solana/rpc-transport': 2.0.0-experimental.9741939(ws@8.14.2) + '@solana/rpc-types': 2.0.0-experimental.9741939 + '@solana/transactions': 2.0.0-experimental.9741939(fastestsmallesttextencoderdecoder@1.0.22) fast-stable-stringify: 1.0.0 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - ws dev: true - /@solana/webcrypto-ed25519-polyfill@2.0.0-experimental.2938d71: - resolution: {integrity: sha512-DrpBQdrxHyWfuFUEkyyt50YwJXqzYeK/c9nkLWok/BuwccDU/IVBkyaTNBQwdpOtc3NAsjSkuGxLDzX1OFmx+g==} + /@solana/webcrypto-ed25519-polyfill@2.0.0-experimental.9741939: + resolution: {integrity: sha512-WH5vrfoBfsL6Tqyd4Oe8SCN7nGUBccUj0KUbZERFNiogIl336mNn+z1ia2ueGpn03glbkyN4nCYRNnpskRTYWg==} dependencies: - '@noble/curves': 1.2.0 + '@noble/ed25519': 2.0.0 dev: true /@szmarczak/http-timer@4.0.6: diff --git a/clients/js/test/_setup.ts b/clients/js/test/_setup.ts index 198c2aa..67399e2 100644 --- a/clients/js/test/_setup.ts +++ b/clients/js/test/_setup.ts @@ -1,17 +1,33 @@ /* eslint-disable import/no-extraneous-dependencies */ import '@solana/webcrypto-ed25519-polyfill'; +import { pipe } from '@solana/functional'; import { + generateKeyPairSigner, + signTransactionWithSigners, +} from '@solana/signers'; +import { + Address, + CompilableTransaction, + ITransactionWithBlockhashLifetime, + createDefaultAirdropRequester, createDefaultRpcSubscriptionsTransport, createDefaultRpcTransport, + createDefaultTransactionSender, createSolanaRpc, createSolanaRpcSubscriptions, + createTransaction, + lamports, + setTransactionFeePayer, + setTransactionLifetimeUsingBlockhash, } from '@solana/web3.js'; -export const createClient = (): { +type Client = { rpc: ReturnType; rpcSubscriptions: ReturnType; -} => { +}; + +export const createClient = (): Client => { const rpc = createSolanaRpc({ transport: createDefaultRpcTransport({ url: 'http://127.0.0.1:8899' }), }); @@ -23,3 +39,45 @@ export const createClient = (): { return { rpc, rpcSubscriptions }; }; + +export const generateKeyPairSignerWithSol = async ( + client: Client, + putativeLamports: bigint = 1_000_000_000n +) => { + const airdropRequester = createDefaultAirdropRequester(client); + const signer = await generateKeyPairSigner(); + await airdropRequester({ + recipientAddress: signer.address, + lamports: lamports(putativeLamports), + commitment: 'confirmed', + }); + return signer; +}; + +export const createDefaultTransaction = async ( + client: Client, + feePayer: Address +) => { + const { value: latestBlockhash } = await client.rpc + .getLatestBlockhash() + .send(); + return pipe( + createTransaction({ version: 0 }), + (tx) => setTransactionFeePayer(feePayer, tx), + (tx) => setTransactionLifetimeUsingBlockhash(latestBlockhash, tx) + ); +}; + +export const signAndSendTransaction = async ( + client: Client, + transaction: CompilableTransaction & ITransactionWithBlockhashLifetime +) => { + const signedTransaction = await signTransactionWithSigners(transaction); + await createDefaultTransactionSender(client)(signedTransaction, { + commitment: 'confirmed', + }); +}; + +export const getBalance = async (client: Client, address: Address) => + (await client.rpc.getBalance(address, { commitment: 'confirmed' }).send()) + .value; diff --git a/clients/js/test/transferSol.test.ts b/clients/js/test/transferSol.test.ts index b2c50f6..ea6ad54 100644 --- a/clients/js/test/transferSol.test.ts +++ b/clients/js/test/transferSol.test.ts @@ -1,85 +1,38 @@ import { pipe } from '@solana/functional'; import { lamports } from '@solana/rpc-types'; -import { - generateKeyPairSigner, - signTransactionWithSigners, -} from '@solana/signers'; -import { - appendTransactionInstruction, - createDefaultAirdropRequester, - createDefaultTransactionSender, - createTransaction, - setTransactionFeePayer, - setTransactionLifetimeUsingBlockhash, -} from '@solana/web3.js'; +import { generateKeyPairSigner } from '@solana/signers'; +import { appendTransactionInstruction } from '@solana/web3.js'; import test from 'ava'; +import { getTransferSolInstruction } from '../src'; import { - getAddMemoInstruction, - getSetComputeUnitLimitInstruction, - getTransferSolInstruction, -} from '../src'; -import { createClient } from './_setup'; + createClient, + createDefaultTransaction, + generateKeyPairSignerWithSol, + getBalance, + signAndSendTransaction, +} from './_setup'; test('it can transfer SOL from one account to another', async (t) => { - // Given a context object. + // Given a source account with 3 SOL and a destination account with no SOL. const client = createClient(); - const airdropRequester = createDefaultAirdropRequester(client); - - // And a source account with 3 SOL. - const source = await generateKeyPairSigner(); - await airdropRequester({ - recipientAddress: source.address, - lamports: lamports(3_000_000_000n), - commitment: 'confirmed', - }); - - // And a destination account with no SOL. + const source = await generateKeyPairSignerWithSol(client, 3_000_000_000n); const destination = (await generateKeyPairSigner()).address; // When the source account transfers 1 SOL to the destination account. - const { value: latestBlockhash } = await client.rpc - .getLatestBlockhash() - .send(); - const setComputeUnitLimit = getSetComputeUnitLimitInstruction({ - units: 600_000, - }); const transferSol = getTransferSolInstruction({ source, destination, amount: 1_000_000_000, }); - const addMemo = getAddMemoInstruction({ memo: "I'm transferring some SOL!" }); - - const transaction = pipe( - createTransaction({ version: 0 }), - (tx) => setTransactionFeePayer(source.address, tx), - (tx) => setTransactionLifetimeUsingBlockhash(latestBlockhash, tx), - (tx) => appendTransactionInstruction(setComputeUnitLimit, tx), + await pipe( + await createDefaultTransaction(client, source.address), (tx) => appendTransactionInstruction(transferSol, tx), - (tx) => appendTransactionInstruction(addMemo, tx) + (tx) => signAndSendTransaction(client, tx) ); - const signedTransaction = await signTransactionWithSigners(transaction); - await createDefaultTransactionSender(client)(signedTransaction, { - commitment: 'confirmed', - }); - // Then the source account new has less than 2 SOL. - t.true( - ( - await client.rpc - .getBalance(source.address, { commitment: 'confirmed' }) - .send() - ).value < 2_000_000_000n - ); + t.true((await getBalance(client, source.address)) < 2_000_000_000n); // And the destination account has exactly 1 SOL. - t.is( - ( - await client.rpc - .getBalance(destination, { commitment: 'confirmed' }) - .send() - ).value, - lamports(1_000_000_000n) - ); + t.is(await getBalance(client, destination), lamports(1_000_000_000n)); });