diff --git a/.changeset/funny-chicken-look.md b/.changeset/funny-chicken-look.md new file mode 100644 index 000000000..1366f102d --- /dev/null +++ b/.changeset/funny-chicken-look.md @@ -0,0 +1,5 @@ +--- +'@metaplex-foundation/kinobi': patch +--- + +Update web3.js and use new codec type inferrences diff --git a/src/renderers/js-experimental/fragments/typeDecoder.njk b/src/renderers/js-experimental/fragments/typeDecoder.njk index d36431957..8a70801aa 100644 --- a/src/renderers/js-experimental/fragments/typeDecoder.njk +++ b/src/renderers/js-experimental/fragments/typeDecoder.njk @@ -1,6 +1,6 @@ {% import "templates/macros.njk" as macros %} {{ macros.docblock(docs) }} -export function {{ decoderFunction }}() { - return {{ manifest.decoder.render }} satisfies Decoder<{{ strictName }}>; +export function {{ decoderFunction }}(): Decoder<{{ strictName }}> { + return {{ manifest.decoder.render }}; } diff --git a/src/renderers/js-experimental/fragments/typeEncoder.njk b/src/renderers/js-experimental/fragments/typeEncoder.njk index c81c33df8..b0031345c 100644 --- a/src/renderers/js-experimental/fragments/typeEncoder.njk +++ b/src/renderers/js-experimental/fragments/typeEncoder.njk @@ -1,6 +1,6 @@ {% import "templates/macros.njk" as macros %} {{ macros.docblock(docs) }} -export function {{ encoderFunction }}() { - return {{ manifest.encoder.render }} satisfies Encoder<{{ looseName }}>; +export function {{ encoderFunction }}(): Encoder<{{ looseName }}> { + return {{ manifest.encoder.render }}; } \ No newline at end of file diff --git a/src/renderers/js-experimental/getTypeManifestVisitor.ts b/src/renderers/js-experimental/getTypeManifestVisitor.ts index ef7faa0e2..f99332082 100644 --- a/src/renderers/js-experimental/getTypeManifestVisitor.ts +++ b/src/renderers/js-experimental/getTypeManifestVisitor.ts @@ -198,46 +198,21 @@ export function getTypeManifestVisitor(input: { }; } - const variants = enumType.variants.map((variant): TypeManifest => { - const variantName = nameApi.dataEnumVariant(variant.name); - parentName = currentParentName - ? { - strict: `GetDataEnumKindContent<${currentParentName.strict}, '${variantName}'>`, - loose: `GetDataEnumKindContent<${currentParentName.loose}, '${variantName}'>`, - } - : null; - const variantManifest = visit(variant, self); - parentName = null; - return variantManifest; - }); - const mergedManifest = mergeManifests( - variants, + enumType.variants.map((variant) => visit(variant, self)), (renders) => renders.join(' | '), (renders) => renders.join(', ') ); mergedManifest.encoder .mapRender( - (r) => - `getDataEnumEncoder<${ - currentParentName ? currentParentName.loose : 'any' - }>([${r}]${encoderOptionsAsString})` + (r) => `getDataEnumEncoder([${r}]${encoderOptionsAsString})` ) - .addImports('solanaCodecsDataStructures', [ - 'GetDataEnumKindContent', - 'getDataEnumEncoder', - ]); + .addImports('solanaCodecsDataStructures', ['getDataEnumEncoder']); mergedManifest.decoder .mapRender( - (r) => - `getDataEnumDecoder<${ - currentParentName ? currentParentName.strict : 'any' - }>([${r}]${decoderOptionsAsString})` + (r) => `getDataEnumDecoder([${r}]${decoderOptionsAsString})` ) - .addImports('solanaCodecsDataStructures', [ - 'GetDataEnumKind', - 'getDataEnumDecoder', - ]); + .addImports('solanaCodecsDataStructures', ['getDataEnumDecoder']); return mergedManifest; }, @@ -399,7 +374,7 @@ export function getTypeManifestVisitor(input: { }, visitStructType(structType, { self }) { - const currentParentName = parentName; + // const currentParentName = parentName; parentName = null; const optionalFields = structType.fields.filter( (f) => !!f.defaultValue @@ -411,32 +386,11 @@ export function getTypeManifestVisitor(input: { (renders) => `([${renders.join(', ')}])` ); - let decoderType = currentParentName?.strict; - if (!decoderType) { - decoderType = mergedManifest.strictType.render; - mergedManifest.decoder.mergeImportsWith(mergedManifest.strictType); - } - - let encoderType = currentParentName?.loose; - if (!encoderType || optionalFields.length > 0) { - const nonDefaultsMergedManifest = mergeManifests( - structType.fields.map((field) => - visit({ ...field, defaultValue: undefined }, self) - ), - (renders) => `{ ${renders.join('')} }`, - (renders) => `([${renders.join(', ')}])` - ); - encoderType = nonDefaultsMergedManifest.looseType.render; - mergedManifest.encoder.mergeImportsWith( - nonDefaultsMergedManifest.looseType - ); - } - mergedManifest.encoder - .mapRender((r) => `getStructEncoder<${encoderType}>${r}`) + .mapRender((r) => `getStructEncoder${r}`) .addImports('solanaCodecsDataStructures', 'getStructEncoder'); mergedManifest.decoder - .mapRender((r) => `getStructDecoder<${decoderType}>${r}`) + .mapRender((r) => `getStructDecoder${r}`) .addImports('solanaCodecsDataStructures', 'getStructDecoder'); if (optionalFields.length === 0) { diff --git a/test/packages/js-experimental/package.json b/test/packages/js-experimental/package.json index 9f963097c..b1d3d53a7 100644 --- a/test/packages/js-experimental/package.json +++ b/test/packages/js-experimental/package.json @@ -11,20 +11,20 @@ "author": "", "license": "ISC", "dependencies": { - "@solana/accounts": "2.0.0-experimental.5e737f9", - "@solana/addresses": "2.0.0-experimental.5e737f9", - "@solana/codecs-core": "2.0.0-experimental.5e737f9", - "@solana/codecs-data-structures": "2.0.0-experimental.5e737f9", - "@solana/codecs-numbers": "2.0.0-experimental.5e737f9", - "@solana/codecs-strings": "2.0.0-experimental.5e737f9", - "@solana/instructions": "2.0.0-experimental.5e737f9", - "@solana/keys": "2.0.0-experimental.5e737f9", - "@solana/programs": "2.0.0-experimental.5e737f9", - "@solana/options": "2.0.0-experimental.5e737f9", - "@solana/signers": "2.0.0-experimental.5e737f9", - "@solana/transactions": "2.0.0-experimental.5e737f9" + "@solana/accounts": "2.0.0-experimental.a7a613a", + "@solana/addresses": "2.0.0-experimental.a7a613a", + "@solana/codecs-core": "2.0.0-experimental.a7a613a", + "@solana/codecs-data-structures": "2.0.0-experimental.a7a613a", + "@solana/codecs-numbers": "2.0.0-experimental.a7a613a", + "@solana/codecs-strings": "2.0.0-experimental.a7a613a", + "@solana/instructions": "2.0.0-experimental.a7a613a", + "@solana/keys": "2.0.0-experimental.a7a613a", + "@solana/programs": "2.0.0-experimental.a7a613a", + "@solana/options": "2.0.0-experimental.a7a613a", + "@solana/signers": "2.0.0-experimental.a7a613a", + "@solana/transactions": "2.0.0-experimental.a7a613a" }, "devDependencies": { - "typescript": "^4.9.4" + "typescript": "^5.3.3" } } diff --git a/test/packages/js-experimental/pnpm-lock.yaml b/test/packages/js-experimental/pnpm-lock.yaml index c4d77f306..ebd0716d6 100644 --- a/test/packages/js-experimental/pnpm-lock.yaml +++ b/test/packages/js-experimental/pnpm-lock.yaml @@ -6,193 +6,202 @@ settings: dependencies: '@solana/accounts': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.15.0) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) '@solana/addresses': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) '@solana/codecs-core': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/codecs-data-structures': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/codecs-numbers': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/codecs-strings': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) '@solana/instructions': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/keys': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) '@solana/options': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/programs': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9 + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a '@solana/signers': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) '@solana/transactions': - specifier: 2.0.0-experimental.5e737f9 - version: 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + specifier: 2.0.0-experimental.a7a613a + version: 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) devDependencies: typescript: - specifier: ^4.9.4 - version: 4.9.5 + specifier: ^5.3.3 + version: 5.3.3 packages: - /@solana/accounts@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22)(ws@8.15.0): - resolution: {integrity: sha512-Pgi2LD7R+zj6TCHCRbqMR9sK4YKfDi1OAzrDuOAxmztw6nvplN2Kn1uwrDcFx5KV7YoS034G3WXo1bQTuPM1Nw==} + /@solana/accounts@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-fifvhOC49UmCqooNI5inAnkkVfLc2diQ/R3WDQSocJ8u9E3chDFg+SPmwXRNNk3Prp1MnbJhsNpRPbO+7A/ypA==} dependencies: - '@solana/addresses': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-strings': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/rpc-core': 2.0.0-experimental.5e737f9 - '@solana/rpc-transport': 2.0.0-experimental.5e737f9(ws@8.15.0) - '@solana/rpc-types': 2.0.0-experimental.5e737f9 + '@solana/addresses': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-strings': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/rpc-spec': 2.0.0-experimental.a7a613a + '@solana/rpc-types': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - - ws dev: false - /@solana/addresses@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-mb/CfAiU/IuTcr5zwQl9tUck6mO3vsd6KmTszuL7rKuVI1pC3m5/zNeyclaGvNfR0XGFLUCds/7Ro6S86ACZ1w==} + /@solana/addresses@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-W5lc7y9CQYwooshmZ6qr2T6Ymj6aVVEM0hlaQA6GVZ20PYCJOGSXg0mloNalG0Fp50J2ouE3Xhy5OoFjoYQgvQ==} dependencies: - '@solana/assertions': 2.0.0-experimental.5e737f9 - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-strings': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/assertions': 2.0.0-experimental.a7a613a + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-strings': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder dev: false - /@solana/assertions@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-zxtGw+CSbgMVyKZwbgfX/ZuHGEkxpQGT/MKe2dUO/PXAsKihLm+KdfbWXWjfxm7GMi/Onn4L1oGgIkPHg+v3Pw==} + /@solana/assertions@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-V3/Q4hkdRkaSiJE3FG7ELhgFnKC1WfnrkIm+6gUfhrzh5Vihg494HXV+x7xEOJFw5m3EYmTDiYEevIr9d5qvMg==} dev: false - /@solana/codecs-core@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-rAkgDNVhz85u9JBpzfSWNemogK/wv0wACyN9gvjkkxiiZOdAwEMJJJN1ktBfktbgKrIUPBdT+yJxuDxMmi6Xkw==} + /@solana/codecs-core@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-4C0GCWoIP8zvUd4kIs4QQnNupjh+GEXcoO+RAYRJ8nDlDW4DdEhb/W4weC+hoFaEjr0STEhCeH4yMWaKF3L6WQ==} dev: false - /@solana/codecs-data-structures@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-IWgZNNYVDiYGVtuIA7Du+ynUGqeMETUkvzwn/w0JqTkkcYtHj96LeBlM7Wcouw6uq0fLlmCs2eEtTBIfA7JXDA==} + /@solana/codecs-data-structures@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-K22h6+YA8hVZ5Nq+49nFUIUJgOMxYP9zEt69oQxh/OnETZF538uIOrsCFU7MzLCLCwUnoJynkBY4Oycm+4m7OQ==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-numbers': 2.0.0-experimental.5e737f9 + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-numbers': 2.0.0-experimental.a7a613a dev: false - /@solana/codecs-numbers@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-CKwmZDQuu0qpeM7VrB9RKQkmEMPoy8YtWgqKsUVJXarVZyCrYL58OIden+5gJusGEEctN5xuQQzx6yCPTjRJIA==} + /@solana/codecs-numbers@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-B1aNhPkoSRqMskHcgB/u0/tnAWfrp6dYHf9o36q+ppAoOZdbS9xz4rwzkt2FMUHaoSWPPa6/tHFQ0Vbge3VMRA==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.5e737f9 + '@solana/codecs-core': 2.0.0-experimental.a7a613a dev: false - /@solana/codecs-strings@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-ufs/JCAhykDZL+KrsPVW33MVRVxmMOhf6dg21d6WNq6RojC2fMcgQHd/6FzUvqvEjA5l84CI+zNZ8mWxet+GGw==} + /@solana/codecs-strings@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-Tw9fqT8UzScpuP4bsDCiKb7DGXQ9BmsqvLJY7b1sjga9Vr0M3mA8BGHemz4WusHXb9AXJEN1Pc1NVYxd4rsH0w==} peerDependencies: fastestsmallesttextencoderdecoder: ^1.0.22 dependencies: - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-numbers': 2.0.0-experimental.5e737f9 + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-numbers': 2.0.0-experimental.a7a613a fastestsmallesttextencoderdecoder: 1.0.22 dev: false - /@solana/functional@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-riNvo1ri86wiH5kmc1dSpbe1fnZIaiot5Lxb2LwB03yc8w8+6/YK4oKXWcfnSqDgQpp7OQ4R61iahT5i6Zuc5w==} + /@solana/errors@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-B7rkUWtAqXgsQwgOAH2qRyy/SOZ1T/3ThC4YezmWwbjxNHqx7+kekoCRhyshkw5AdhV7U4kQJSACQq/j3Cy1WA==} + hasBin: true + dependencies: + chalk: 5.3.0 + commander: 11.1.0 + dev: false + + /@solana/functional@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-OkaYVw6O5vNzOjEut0E44mxF1yS6BMXCnUcZuKy9nvuHNeUFZ6BjFJhMQXOGhhs5qNzI9m+JHnrb7z3J0ZPrBw==} dev: false - /@solana/instructions@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-AZMIsGGfJf2GqCOY3THexTXyl+tWd4NtO0hQvY2nivVFCT5uqQiWmZK+vU13fGt2UYdRveHNMI3Rystttk6m4g==} + /@solana/instructions@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-UJSlElg/w+pTYySxmane6RNP5Ghe52SJDy0gsEC40SkusdGtJbwlusNfGVZVFFGf14n+urWKyR+2gcdaj11qJw==} dev: false - /@solana/keys@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-wN1Rrq+uU6r6HFEY8fMxq5da9F5O+IbxOfLVuyyEELa3TpCVAR8QjVwpWyqb/GyIE3/DQQw/3tSi+NQ/Fd2yMg==} + /@solana/keys@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-A2Hf4IL7EH85yaadZMwu8dVMDzKLVRpIug8QjgKKiJRhu9FIezzbUDMT8l4ILBOpsRdcwgcK3/YFVRdVoMcWmA==} dependencies: - '@solana/assertions': 2.0.0-experimental.5e737f9 - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-strings': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/assertions': 2.0.0-experimental.a7a613a + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-strings': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/errors': 2.0.0-experimental.a7a613a transitivePeerDependencies: - fastestsmallesttextencoderdecoder dev: false - /@solana/options@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-kVZIyrul8y+bpDp2jm+r9Osvzm0EFgUlB2BxyMk82N9zPGPNxutVAgZ8YkhZKiCKBYtd8UHdtk/CIqNjHy1Zlg==} + /@solana/options@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-gUV7uSOfHrOBLt3+Wv3LJDYkVQN1PTmNu511/zkkKdE3AwUMUfG7x+jMg85h3Tiw7xPs+HOgHBEyGdiYHk0W1g==} dependencies: - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-numbers': 2.0.0-experimental.5e737f9 + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-numbers': 2.0.0-experimental.a7a613a dev: false - /@solana/programs@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-Pk1KYPgJm7LYAGFuUC8NOQ12vSpMTr6yLi9PYcZDM0Y2FQaMxRJeEyXFY0qgqBwvBVmPS8p82jQ/nyvy6xODuQ==} + /@solana/programs@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-1A6iwvlKmuJKZrL4+bTZUV1fh4aIHDqtCuQofRdenK46TJ0QqyTewEG3i6G1UuDQx2F6eKoFL3kC0QDK+7HUyw==} dev: false - /@solana/rpc-core@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-19lljbJTBWDVltVTyUdNewS1IAXpCI4QemeP0Aea01tL26KwCGDmm2rN/FLkr67yOqOjnEN5IfNQaBeYPjUD+g==} + /@solana/rpc-spec-types@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-lyZmEHac9WEL0Uf02X6sM7/vqGW6NAGV1fW3JRaLI9KOjMtN5OmRMiJiPhDKFHM/mBHGs0ddDwABBR0M1rNbzw==} dev: false - /@solana/rpc-transport@2.0.0-experimental.5e737f9(ws@8.15.0): - resolution: {integrity: sha512-lF6qPJUvjI+HP469qjUSKVflL2rkdwQvHCnAv3HzInONTT6NAAEhLdZBN0/GvkChpn13q/j2f9PsWUWSbi6NAg==} - peerDependencies: - ws: ^8.14.0 + /@solana/rpc-spec@2.0.0-experimental.a7a613a: + resolution: {integrity: sha512-YfCbUxtSP/uVD+EPnM709JFF/LDBAUiLcosXLQZF62qSEDGWc15MelfXDHHqcSdUaPbxy6cCCqbVUhWaZt4ifQ==} dependencies: - ws: 8.15.0 + '@solana/rpc-spec-types': 2.0.0-experimental.a7a613a dev: false - /@solana/rpc-types@2.0.0-experimental.5e737f9: - resolution: {integrity: sha512-IdfD8j2uQOAeCCjiyRT5/rc1U01jdZ0BWsM4Hyeyl1utURKzU9aRTxF3YfmX4En/v/cYzd31k7qQMSMrOondcA==} + /@solana/rpc-types@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-oICRh5Q4/5N/QRxea+xnUxLGFEp7jgRmJHqsR1eDhCUoSntwBL9ME3bdvsQh65gZ9DjKMUIU6FAPUzgmz/upWg==} + dependencies: + '@solana/addresses': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/codecs-strings': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder dev: false - /@solana/signers@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-+/4nnt7Hd2nW+A1EuoFbS16pLwjgp5M29Ms3aSQSqB+8MF50RPIADsyWf9u+mADKpsyvyD8cybbr4Zz8+NkFXg==} + /@solana/signers@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-2gnsMbDDnzcj63YiqkuNfcRIcWJEbuW2gwYfuypbby86g4etMhnYlsYwbRptb2BBd79ho0vBQfJco22D2UiCKw==} dependencies: - '@solana/addresses': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/instructions': 2.0.0-experimental.5e737f9 - '@solana/keys': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/transactions': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/addresses': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/errors': 2.0.0-experimental.a7a613a + '@solana/instructions': 2.0.0-experimental.a7a613a + '@solana/keys': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/transactions': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder dev: false - /@solana/transactions@2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22): - resolution: {integrity: sha512-PA7P1YVSr9AXjnD7ERgQVF4DR+/bTDrr/mAm3T7tCjSJu6gxNJ4PDYCSqrL3sbDMIQJ4s7UMhPDk4WCbFh8v0Q==} + /@solana/transactions@2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-DxxMzGEPGw0s3+AQGaqJqqFkcGWFJFuMB/z3U3cYMA5AmDZ3y51lGRsUonvdYw/ksQOGXawS6hrTeQ5VPu1yig==} dependencies: - '@solana/addresses': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/codecs-core': 2.0.0-experimental.5e737f9 - '@solana/codecs-data-structures': 2.0.0-experimental.5e737f9 - '@solana/codecs-numbers': 2.0.0-experimental.5e737f9 - '@solana/codecs-strings': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/functional': 2.0.0-experimental.5e737f9 - '@solana/keys': 2.0.0-experimental.5e737f9(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/addresses': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/codecs-core': 2.0.0-experimental.a7a613a + '@solana/codecs-data-structures': 2.0.0-experimental.a7a613a + '@solana/codecs-numbers': 2.0.0-experimental.a7a613a + '@solana/codecs-strings': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/errors': 2.0.0-experimental.a7a613a + '@solana/functional': 2.0.0-experimental.a7a613a + '@solana/keys': 2.0.0-experimental.a7a613a(fastestsmallesttextencoderdecoder@1.0.22) transitivePeerDependencies: - fastestsmallesttextencoderdecoder dev: false + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: false + + /commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + dev: false + /fastestsmallesttextencoderdecoder@1.0.22: resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} dev: false - /typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} hasBin: true dev: true - - /ws@8.15.0: - resolution: {integrity: sha512-H/Z3H55mrcrgjFwI+5jKavgXvwQLtfPCUEp6pi35VhoB0pfcHnSoyuTzkBEZpzq49g1193CUEwIvmsjcotenYw==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false diff --git a/test/packages/js-experimental/src/generated/accounts/candyMachine.ts b/test/packages/js-experimental/src/generated/accounts/candyMachine.ts index f19e6776d..1b9d8ba63 100644 --- a/test/packages/js-experimental/src/generated/accounts/candyMachine.ts +++ b/test/packages/js-experimental/src/generated/accounts/candyMachine.ts @@ -91,23 +91,9 @@ export type CandyMachineAccountDataArgs = { data: CandyMachineDataArgs; }; -export function getCandyMachineAccountDataEncoder() { +export function getCandyMachineAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: Array; - /** Features versioning flags. */ - features: number | bigint; - /** Authority address. */ - authority: Address; - /** Authority address allowed to mint from the candy machine. */ - mintAuthority: Address; - /** The collection mint for the candy machine. */ - collectionMint: Address; - /** Number of assets redeemed. */ - itemsRedeemed: number | bigint; - /** Candy machine configuration data. */ - data: CandyMachineDataArgs; - }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ['features', getU64Encoder()], ['authority', getAddressEncoder()], @@ -120,11 +106,11 @@ export function getCandyMachineAccountDataEncoder() { ...value, discriminator: [51, 173, 177, 113, 25, 241, 109, 189], }) - ) satisfies Encoder; + ); } -export function getCandyMachineAccountDataDecoder() { - return getStructDecoder([ +export function getCandyMachineAccountDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], ['features', getU64Decoder()], ['authority', getAddressDecoder()], @@ -132,7 +118,7 @@ export function getCandyMachineAccountDataDecoder() { ['collectionMint', getAddressDecoder()], ['itemsRedeemed', getU64Decoder()], ['data', getCandyMachineDataDecoder()], - ]) satisfies Decoder; + ]); } export function getCandyMachineAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/collectionAuthorityRecord.ts b/test/packages/js-experimental/src/generated/accounts/collectionAuthorityRecord.ts index 2af74493b..851f9b945 100644 --- a/test/packages/js-experimental/src/generated/accounts/collectionAuthorityRecord.ts +++ b/test/packages/js-experimental/src/generated/accounts/collectionAuthorityRecord.ts @@ -42,7 +42,7 @@ import { getOptionDecoder, getOptionEncoder, } from '@solana/options'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type CollectionAuthorityRecord = Account; @@ -61,27 +61,23 @@ export type CollectionAuthorityRecordAccountDataArgs = { updateAuthority: OptionOrNullable
; }; -export function getCollectionAuthorityRecordAccountDataEncoder() { +export function getCollectionAuthorityRecordAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - bump: number; - updateAuthority: OptionOrNullable
; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['bump', getU8Encoder()], ['updateAuthority', getOptionEncoder(getAddressEncoder())], ]), (value) => ({ ...value, key: TmKey.CollectionAuthorityRecord }) - ) satisfies Encoder; + ); } -export function getCollectionAuthorityRecordAccountDataDecoder() { - return getStructDecoder([ +export function getCollectionAuthorityRecordAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['bump', getU8Decoder()], ['updateAuthority', getOptionDecoder(getAddressDecoder())], - ]) satisfies Decoder; + ]); } export function getCollectionAuthorityRecordAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/delegateRecord.ts b/test/packages/js-experimental/src/generated/accounts/delegateRecord.ts index f62600a0c..a1b85e2c3 100644 --- a/test/packages/js-experimental/src/generated/accounts/delegateRecord.ts +++ b/test/packages/js-experimental/src/generated/accounts/delegateRecord.ts @@ -37,7 +37,6 @@ import { DelegateRole, DelegateRoleArgs, TmKey, - TmKeyArgs, getDelegateRoleDecoder, getDelegateRoleEncoder, getTmKeyDecoder, @@ -63,23 +62,23 @@ export type DelegateRecordAccountDataArgs = { bump: number; }; -export function getDelegateRecordAccountDataEncoder() { +export function getDelegateRecordAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ key: TmKeyArgs; role: DelegateRoleArgs; bump: number }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['role', getDelegateRoleEncoder()], ['bump', getU8Encoder()], ]), (value) => ({ ...value, key: TmKey.Delegate }) - ) satisfies Encoder; + ); } -export function getDelegateRecordAccountDataDecoder() { - return getStructDecoder([ +export function getDelegateRecordAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['role', getDelegateRoleDecoder()], ['bump', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getDelegateRecordAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/edition.ts b/test/packages/js-experimental/src/generated/accounts/edition.ts index cb5aad3e1..b475fcd54 100644 --- a/test/packages/js-experimental/src/generated/accounts/edition.ts +++ b/test/packages/js-experimental/src/generated/accounts/edition.ts @@ -36,7 +36,7 @@ import { getStructEncoder, } from '@solana/codecs-data-structures'; import { getU64Decoder, getU64Encoder } from '@solana/codecs-numbers'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type Edition = Account< EditionAccountData, @@ -59,27 +59,23 @@ export type EditionAccountDataArgs = { edition: number | bigint; }; -export function getEditionAccountDataEncoder() { +export function getEditionAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - parent: Address; - edition: number | bigint; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['parent', getAddressEncoder()], ['edition', getU64Encoder()], ]), (value) => ({ ...value, key: TmKey.EditionV1 }) - ) satisfies Encoder; + ); } -export function getEditionAccountDataDecoder() { - return getStructDecoder([ +export function getEditionAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['parent', getAddressDecoder()], ['edition', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getEditionAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/editionMarker.ts b/test/packages/js-experimental/src/generated/accounts/editionMarker.ts index 1b2cce021..8ab76ad03 100644 --- a/test/packages/js-experimental/src/generated/accounts/editionMarker.ts +++ b/test/packages/js-experimental/src/generated/accounts/editionMarker.ts @@ -34,7 +34,7 @@ import { getStructEncoder, } from '@solana/codecs-data-structures'; import { getU8Decoder, getU8Encoder } from '@solana/codecs-numbers'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type EditionMarker = Account< EditionMarkerAccountData, @@ -50,21 +50,21 @@ export type EditionMarkerAccountData = { key: TmKey; ledger: Array }; export type EditionMarkerAccountDataArgs = { ledger: Array }; -export function getEditionMarkerAccountDataEncoder() { +export function getEditionMarkerAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ key: TmKeyArgs; ledger: Array }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['ledger', getArrayEncoder(getU8Encoder(), { size: 200 })], ]), (value) => ({ ...value, key: TmKey.EditionMarker }) - ) satisfies Encoder; + ); } -export function getEditionMarkerAccountDataDecoder() { - return getStructDecoder([ +export function getEditionMarkerAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['ledger', getArrayDecoder(getU8Decoder(), { size: 200 })], - ]) satisfies Decoder; + ]); } export function getEditionMarkerAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/frequencyAccount.ts b/test/packages/js-experimental/src/generated/accounts/frequencyAccount.ts index 17fa32e6a..6ac7deabd 100644 --- a/test/packages/js-experimental/src/generated/accounts/frequencyAccount.ts +++ b/test/packages/js-experimental/src/generated/accounts/frequencyAccount.ts @@ -68,32 +68,23 @@ export type FrequencyAccountAccountDataArgs = { period: number | bigint; }; -export function getFrequencyAccountAccountDataEncoder() { +export function getFrequencyAccountAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - /** Test with only one line. */ - key: number | bigint; - /** - * Test with multiple lines - * and this is the second line. - */ - lastUpdate: number | bigint; - period: number | bigint; - }>([ + getStructEncoder([ ['key', getU64Encoder()], ['lastUpdate', getI64Encoder()], ['period', getI64Encoder()], ]), (value) => ({ ...value, key: TaKey.Frequency }) - ) satisfies Encoder; + ); } -export function getFrequencyAccountAccountDataDecoder() { - return getStructDecoder([ +export function getFrequencyAccountAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getU64Decoder()], ['lastUpdate', getI64Decoder()], ['period', getI64Decoder()], - ]) satisfies Decoder; + ]); } export function getFrequencyAccountAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/masterEditionV1.ts b/test/packages/js-experimental/src/generated/accounts/masterEditionV1.ts index bf7863f1f..4a754b429 100644 --- a/test/packages/js-experimental/src/generated/accounts/masterEditionV1.ts +++ b/test/packages/js-experimental/src/generated/accounts/masterEditionV1.ts @@ -43,7 +43,7 @@ import { getOptionEncoder, } from '@solana/options'; import { MasterEditionV1Seeds, findMasterEditionV1Pda } from '../pdas'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type MasterEditionV1 = Account< MasterEditionV1AccountData, @@ -68,15 +68,9 @@ export type MasterEditionV1AccountDataArgs = { oneTimePrintingAuthorizationMint: Address; }; -export function getMasterEditionV1AccountDataEncoder() { +export function getMasterEditionV1AccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - supply: number | bigint; - maxSupply: OptionOrNullable; - printingMint: Address; - oneTimePrintingAuthorizationMint: Address; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['supply', getU64Encoder()], ['maxSupply', getOptionEncoder(getU64Encoder())], @@ -84,17 +78,17 @@ export function getMasterEditionV1AccountDataEncoder() { ['oneTimePrintingAuthorizationMint', getAddressEncoder()], ]), (value) => ({ ...value, key: TmKey.MasterEditionV1 }) - ) satisfies Encoder; + ); } -export function getMasterEditionV1AccountDataDecoder() { - return getStructDecoder([ +export function getMasterEditionV1AccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['supply', getU64Decoder()], ['maxSupply', getOptionDecoder(getU64Decoder())], ['printingMint', getAddressDecoder()], ['oneTimePrintingAuthorizationMint', getAddressDecoder()], - ]) satisfies Decoder; + ]); } export function getMasterEditionV1AccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/masterEditionV2.ts b/test/packages/js-experimental/src/generated/accounts/masterEditionV2.ts index 1f37cd54d..369489c68 100644 --- a/test/packages/js-experimental/src/generated/accounts/masterEditionV2.ts +++ b/test/packages/js-experimental/src/generated/accounts/masterEditionV2.ts @@ -39,7 +39,7 @@ import { getOptionEncoder, } from '@solana/options'; import { MasterEditionV2Seeds, findMasterEditionV2Pda } from '../pdas'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type MasterEditionV2 = Account< MasterEditionV2AccountData, @@ -60,27 +60,23 @@ export type MasterEditionV2AccountDataArgs = { maxSupply: OptionOrNullable; }; -export function getMasterEditionV2AccountDataEncoder() { +export function getMasterEditionV2AccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - supply: number | bigint; - maxSupply: OptionOrNullable; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['supply', getU64Encoder()], ['maxSupply', getOptionEncoder(getU64Encoder())], ]), (value) => ({ ...value, key: TmKey.MasterEditionV2 }) - ) satisfies Encoder; + ); } -export function getMasterEditionV2AccountDataDecoder() { - return getStructDecoder([ +export function getMasterEditionV2AccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['supply', getU64Decoder()], ['maxSupply', getOptionDecoder(getU64Decoder())], - ]) satisfies Decoder; + ]); } export function getMasterEditionV2AccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/metadata.ts b/test/packages/js-experimental/src/generated/accounts/metadata.ts index 16552a37d..87b081790 100644 --- a/test/packages/js-experimental/src/generated/accounts/metadata.ts +++ b/test/packages/js-experimental/src/generated/accounts/metadata.ts @@ -65,7 +65,6 @@ import { ProgrammableConfig, ProgrammableConfigArgs, TmKey, - TmKeyArgs, TokenStandard, TokenStandardArgs, Uses, @@ -137,27 +136,9 @@ export type MetadataAccountDataArgs = { delegateState: OptionOrNullable; }; -export function getMetadataAccountDataEncoder() { +export function getMetadataAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - updateAuthority: Address; - mint: Address; - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - primarySaleHappened: boolean; - isMutable: boolean; - editionNonce: OptionOrNullable; - tokenStandard: OptionOrNullable; - collection: OptionOrNullable; - uses: OptionOrNullable; - collectionDetails: OptionOrNullable; - programmableConfig: OptionOrNullable; - delegateState: OptionOrNullable; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['updateAuthority', getAddressEncoder()], ['mint', getAddressEncoder()], @@ -177,11 +158,11 @@ export function getMetadataAccountDataEncoder() { ['delegateState', getOptionEncoder(getDelegateStateEncoder())], ]), (value) => ({ ...value, key: TmKey.MetadataV1 }) - ) satisfies Encoder; + ); } -export function getMetadataAccountDataDecoder() { - return getStructDecoder([ +export function getMetadataAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['updateAuthority', getAddressDecoder()], ['mint', getAddressDecoder()], @@ -199,7 +180,7 @@ export function getMetadataAccountDataDecoder() { ['collectionDetails', getOptionDecoder(getCollectionDetailsDecoder())], ['programmableConfig', getOptionDecoder(getProgrammableConfigDecoder())], ['delegateState', getOptionDecoder(getDelegateStateDecoder())], - ]) satisfies Decoder; + ]); } export function getMetadataAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/reservationListV2.ts b/test/packages/js-experimental/src/generated/accounts/reservationListV2.ts index 80aa377bc..5dbc2f1b8 100644 --- a/test/packages/js-experimental/src/generated/accounts/reservationListV2.ts +++ b/test/packages/js-experimental/src/generated/accounts/reservationListV2.ts @@ -48,7 +48,6 @@ import { Reservation, ReservationArgs, TmKey, - TmKeyArgs, getReservationDecoder, getReservationEncoder, getTmKeyDecoder, @@ -80,16 +79,9 @@ export type ReservationListV2AccountDataArgs = { currentReservationSpots: number | bigint; }; -export function getReservationListV2AccountDataEncoder() { +export function getReservationListV2AccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - masterEdition: Address; - supplySnapshot: OptionOrNullable; - reservations: Array; - totalReservationSpots: number | bigint; - currentReservationSpots: number | bigint; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['masterEdition', getAddressEncoder()], ['supplySnapshot', getOptionEncoder(getU64Encoder())], @@ -98,18 +90,18 @@ export function getReservationListV2AccountDataEncoder() { ['currentReservationSpots', getU64Encoder()], ]), (value) => ({ ...value, key: TmKey.ReservationListV2 }) - ) satisfies Encoder; + ); } -export function getReservationListV2AccountDataDecoder() { - return getStructDecoder([ +export function getReservationListV2AccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['masterEdition', getAddressDecoder()], ['supplySnapshot', getOptionDecoder(getU64Decoder())], ['reservations', getArrayDecoder(getReservationDecoder())], ['totalReservationSpots', getU64Decoder()], ['currentReservationSpots', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getReservationListV2AccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/tokenOwnedEscrow.ts b/test/packages/js-experimental/src/generated/accounts/tokenOwnedEscrow.ts index 5cd2e0455..01fb1282e 100644 --- a/test/packages/js-experimental/src/generated/accounts/tokenOwnedEscrow.ts +++ b/test/packages/js-experimental/src/generated/accounts/tokenOwnedEscrow.ts @@ -40,7 +40,6 @@ import { EscrowAuthority, EscrowAuthorityArgs, TmKey, - TmKeyArgs, getEscrowAuthorityDecoder, getEscrowAuthorityEncoder, getTmKeyDecoder, @@ -68,30 +67,25 @@ export type TokenOwnedEscrowAccountDataArgs = { bump: number; }; -export function getTokenOwnedEscrowAccountDataEncoder() { +export function getTokenOwnedEscrowAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - baseToken: Address; - authority: EscrowAuthorityArgs; - bump: number; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['baseToken', getAddressEncoder()], ['authority', getEscrowAuthorityEncoder()], ['bump', getU8Encoder()], ]), (value) => ({ ...value, key: TmKey.TokenOwnedEscrow }) - ) satisfies Encoder; + ); } -export function getTokenOwnedEscrowAccountDataDecoder() { - return getStructDecoder([ +export function getTokenOwnedEscrowAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['baseToken', getAddressDecoder()], ['authority', getEscrowAuthorityDecoder()], ['bump', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getTokenOwnedEscrowAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/accounts/useAuthorityRecord.ts b/test/packages/js-experimental/src/generated/accounts/useAuthorityRecord.ts index 2173f8f75..ce2fe2ff4 100644 --- a/test/packages/js-experimental/src/generated/accounts/useAuthorityRecord.ts +++ b/test/packages/js-experimental/src/generated/accounts/useAuthorityRecord.ts @@ -37,7 +37,7 @@ import { getU8Decoder, getU8Encoder, } from '@solana/codecs-numbers'; -import { TmKey, TmKeyArgs, getTmKeyDecoder, getTmKeyEncoder } from '../types'; +import { TmKey, getTmKeyDecoder, getTmKeyEncoder } from '../types'; export type UseAuthorityRecord = Account< UseAuthorityRecordAccountData, @@ -58,27 +58,23 @@ export type UseAuthorityRecordAccountDataArgs = { bump: number; }; -export function getUseAuthorityRecordAccountDataEncoder() { +export function getUseAuthorityRecordAccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - allowedUses: number | bigint; - bump: number; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['allowedUses', getU64Encoder()], ['bump', getU8Encoder()], ]), (value) => ({ ...value, key: TmKey.UseAuthorityRecord }) - ) satisfies Encoder; + ); } -export function getUseAuthorityRecordAccountDataDecoder() { - return getStructDecoder([ +export function getUseAuthorityRecordAccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['allowedUses', getU64Decoder()], ['bump', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getUseAuthorityRecordAccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/addConfigLines.ts b/test/packages/js-experimental/src/generated/instructions/addConfigLines.ts index 0ff1ffc11..0cf4c851e 100644 --- a/test/packages/js-experimental/src/generated/instructions/addConfigLines.ts +++ b/test/packages/js-experimental/src/generated/instructions/addConfigLines.ts @@ -104,15 +104,9 @@ export type AddConfigLinesInstructionDataArgs = { moreLines: Array; }; -export function getAddConfigLinesInstructionDataEncoder() { +export function getAddConfigLinesInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: Array; - index: number; - configLines: Array; - /** More dummy lines. */ - moreLines: Array; - }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ['index', getU32Encoder()], ['configLines', getArrayEncoder(getConfigLineEncoder())], @@ -125,11 +119,11 @@ export function getAddConfigLinesInstructionDataEncoder() { ...value, discriminator: [223, 50, 224, 227, 151, 8, 115, 106], }) - ) satisfies Encoder; + ); } -export function getAddConfigLinesInstructionDataDecoder() { - return getStructDecoder([ +export function getAddConfigLinesInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], ['index', getU32Decoder()], ['configLines', getArrayDecoder(getConfigLineDecoder())], @@ -137,7 +131,7 @@ export function getAddConfigLinesInstructionDataDecoder() { 'moreLines', getArrayDecoder(getConfigLineDecoder(), { size: getU64Decoder() }), ], - ]) satisfies Decoder; + ]); } export function getAddConfigLinesInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/approveCollectionAuthority.ts b/test/packages/js-experimental/src/generated/instructions/approveCollectionAuthority.ts index d99833eeb..fe223740d 100644 --- a/test/packages/js-experimental/src/generated/instructions/approveCollectionAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/approveCollectionAuthority.ts @@ -138,19 +138,15 @@ export type ApproveCollectionAuthorityInstructionData = { export type ApproveCollectionAuthorityInstructionDataArgs = {}; -export function getApproveCollectionAuthorityInstructionDataEncoder() { +export function getApproveCollectionAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 23 }) - ) satisfies Encoder; + ); } -export function getApproveCollectionAuthorityInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getApproveCollectionAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getApproveCollectionAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/approveUseAuthority.ts b/test/packages/js-experimental/src/generated/instructions/approveUseAuthority.ts index b37a1c81d..386beb881 100644 --- a/test/packages/js-experimental/src/generated/instructions/approveUseAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/approveUseAuthority.ts @@ -170,21 +170,21 @@ export type ApproveUseAuthorityInstructionDataArgs = { numberOfUses: number | bigint; }; -export function getApproveUseAuthorityInstructionDataEncoder() { +export function getApproveUseAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; numberOfUses: number | bigint }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['numberOfUses', getU64Encoder()], ]), (value) => ({ ...value, discriminator: 20 }) - ) satisfies Encoder; + ); } -export function getApproveUseAuthorityInstructionDataDecoder() { - return getStructDecoder([ +export function getApproveUseAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['numberOfUses', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getApproveUseAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/bubblegumSetCollectionSize.ts b/test/packages/js-experimental/src/generated/instructions/bubblegumSetCollectionSize.ts index 69183a4dc..2059d1f52 100644 --- a/test/packages/js-experimental/src/generated/instructions/bubblegumSetCollectionSize.ts +++ b/test/packages/js-experimental/src/generated/instructions/bubblegumSetCollectionSize.ts @@ -120,24 +120,21 @@ export type BubblegumSetCollectionSizeInstructionDataArgs = { setCollectionSizeArgs: SetCollectionSizeArgsArgs; }; -export function getBubblegumSetCollectionSizeInstructionDataEncoder() { +export function getBubblegumSetCollectionSizeInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - setCollectionSizeArgs: SetCollectionSizeArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['setCollectionSizeArgs', getSetCollectionSizeArgsEncoder()], ]), (value) => ({ ...value, discriminator: 36 }) - ) satisfies Encoder; + ); } -export function getBubblegumSetCollectionSizeInstructionDataDecoder() { - return getStructDecoder([ +export function getBubblegumSetCollectionSizeInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['setCollectionSizeArgs', getSetCollectionSizeArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getBubblegumSetCollectionSizeInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/burn.ts b/test/packages/js-experimental/src/generated/instructions/burn.ts index 396888b29..ecceb4d4b 100644 --- a/test/packages/js-experimental/src/generated/instructions/burn.ts +++ b/test/packages/js-experimental/src/generated/instructions/burn.ts @@ -149,21 +149,21 @@ export type BurnInstructionData = { discriminator: number; burnArgs: BurnArgs }; export type BurnInstructionDataArgs = { burnArgs: BurnArgsArgs }; -export function getBurnInstructionDataEncoder() { +export function getBurnInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; burnArgs: BurnArgsArgs }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['burnArgs', getBurnArgsEncoder()], ]), (value) => ({ ...value, discriminator: 44 }) - ) satisfies Encoder; + ); } -export function getBurnInstructionDataDecoder() { - return getStructDecoder([ +export function getBurnInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['burnArgs', getBurnArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getBurnInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/burnEditionNft.ts b/test/packages/js-experimental/src/generated/instructions/burnEditionNft.ts index a725317b5..6c3ccf8ac 100644 --- a/test/packages/js-experimental/src/generated/instructions/burnEditionNft.ts +++ b/test/packages/js-experimental/src/generated/instructions/burnEditionNft.ts @@ -155,19 +155,15 @@ export type BurnEditionNftInstructionData = { discriminator: number }; export type BurnEditionNftInstructionDataArgs = {}; -export function getBurnEditionNftInstructionDataEncoder() { +export function getBurnEditionNftInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 37 }) - ) satisfies Encoder; + ); } -export function getBurnEditionNftInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getBurnEditionNftInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getBurnEditionNftInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/burnNft.ts b/test/packages/js-experimental/src/generated/instructions/burnNft.ts index 22c5abab2..4d1418389 100644 --- a/test/packages/js-experimental/src/generated/instructions/burnNft.ts +++ b/test/packages/js-experimental/src/generated/instructions/burnNft.ts @@ -123,19 +123,15 @@ export type BurnNftInstructionData = { discriminator: number }; export type BurnNftInstructionDataArgs = {}; -export function getBurnNftInstructionDataEncoder() { +export function getBurnNftInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 29 }) - ) satisfies Encoder; + ); } -export function getBurnNftInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getBurnNftInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getBurnNftInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/closeEscrowAccount.ts b/test/packages/js-experimental/src/generated/instructions/closeEscrowAccount.ts index 981354655..107bcce0c 100644 --- a/test/packages/js-experimental/src/generated/instructions/closeEscrowAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/closeEscrowAccount.ts @@ -135,19 +135,15 @@ export type CloseEscrowAccountInstructionData = { discriminator: number }; export type CloseEscrowAccountInstructionDataArgs = {}; -export function getCloseEscrowAccountInstructionDataEncoder() { +export function getCloseEscrowAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 39 }) - ) satisfies Encoder; + ); } -export function getCloseEscrowAccountInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getCloseEscrowAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getCloseEscrowAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/convertMasterEditionV1ToV2.ts b/test/packages/js-experimental/src/generated/instructions/convertMasterEditionV1ToV2.ts index 7ece27d71..6849fab76 100644 --- a/test/packages/js-experimental/src/generated/instructions/convertMasterEditionV1ToV2.ts +++ b/test/packages/js-experimental/src/generated/instructions/convertMasterEditionV1ToV2.ts @@ -85,19 +85,15 @@ export type ConvertMasterEditionV1ToV2InstructionData = { export type ConvertMasterEditionV1ToV2InstructionDataArgs = {}; -export function getConvertMasterEditionV1ToV2InstructionDataEncoder() { +export function getConvertMasterEditionV1ToV2InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 12 }) - ) satisfies Encoder; + ); } -export function getConvertMasterEditionV1ToV2InstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getConvertMasterEditionV1ToV2InstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getConvertMasterEditionV1ToV2InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createAccount.ts b/test/packages/js-experimental/src/generated/instructions/createAccount.ts index 78b588aec..60a9a98f4 100644 --- a/test/packages/js-experimental/src/generated/instructions/createAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/createAccount.ts @@ -96,30 +96,25 @@ export type CreateAccountInstructionDataArgs = { programId: Address; }; -export function getCreateAccountInstructionDataEncoder() { +export function getCreateAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - lamports: number | bigint; - space: number | bigint; - programId: Address; - }>([ + getStructEncoder([ ['discriminator', getU32Encoder()], ['lamports', getU64Encoder()], ['space', getU64Encoder()], ['programId', getAddressEncoder()], ]), (value) => ({ ...value, discriminator: 0 }) - ) satisfies Encoder; + ); } -export function getCreateAccountInstructionDataDecoder() { - return getStructDecoder([ +export function getCreateAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU32Decoder()], ['lamports', getU64Decoder()], ['space', getU64Decoder()], ['programId', getAddressDecoder()], - ]) satisfies Decoder; + ]); } export function getCreateAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createEscrowAccount.ts b/test/packages/js-experimental/src/generated/instructions/createEscrowAccount.ts index 213d1fddb..7488f4b3c 100644 --- a/test/packages/js-experimental/src/generated/instructions/createEscrowAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/createEscrowAccount.ts @@ -145,19 +145,15 @@ export type CreateEscrowAccountInstructionData = { discriminator: number }; export type CreateEscrowAccountInstructionDataArgs = {}; -export function getCreateEscrowAccountInstructionDataEncoder() { +export function getCreateEscrowAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 38 }) - ) satisfies Encoder; + ); } -export function getCreateEscrowAccountInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getCreateEscrowAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getCreateEscrowAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createFrequencyRule.ts b/test/packages/js-experimental/src/generated/instructions/createFrequencyRule.ts index c33021681..3c780d2a0 100644 --- a/test/packages/js-experimental/src/generated/instructions/createFrequencyRule.ts +++ b/test/packages/js-experimental/src/generated/instructions/createFrequencyRule.ts @@ -108,15 +108,9 @@ export type CreateFrequencyRuleInstructionDataArgs = { period: number | bigint; }; -export function getCreateFrequencyRuleInstructionDataEncoder() { +export function getCreateFrequencyRuleInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - ruleSetName: string; - freqRuleName: string; - lastUpdate: number | bigint; - period: number | bigint; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['ruleSetName', getStringEncoder()], ['freqRuleName', getStringEncoder()], @@ -124,17 +118,17 @@ export function getCreateFrequencyRuleInstructionDataEncoder() { ['period', getI64Encoder()], ]), (value) => ({ ...value, discriminator: 2 }) - ) satisfies Encoder; + ); } -export function getCreateFrequencyRuleInstructionDataDecoder() { - return getStructDecoder([ +export function getCreateFrequencyRuleInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['ruleSetName', getStringDecoder()], ['freqRuleName', getStringDecoder()], ['lastUpdate', getI64Decoder()], ['period', getI64Decoder()], - ]) satisfies Decoder; + ]); } export function getCreateFrequencyRuleInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createMasterEdition.ts b/test/packages/js-experimental/src/generated/instructions/createMasterEdition.ts index d31617d00..08b4d5880 100644 --- a/test/packages/js-experimental/src/generated/instructions/createMasterEdition.ts +++ b/test/packages/js-experimental/src/generated/instructions/createMasterEdition.ts @@ -161,24 +161,21 @@ export type CreateMasterEditionInstructionDataArgs = { createMasterEditionArgs: CreateMasterEditionArgsArgs; }; -export function getCreateMasterEditionInstructionDataEncoder() { +export function getCreateMasterEditionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createMasterEditionArgs: CreateMasterEditionArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsEncoder()], ]), (value) => ({ ...value, discriminator: 10 }) - ) satisfies Encoder; + ); } -export function getCreateMasterEditionInstructionDataDecoder() { - return getStructDecoder([ +export function getCreateMasterEditionInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getCreateMasterEditionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createMasterEditionV3.ts b/test/packages/js-experimental/src/generated/instructions/createMasterEditionV3.ts index a79fa752f..56cb99cb4 100644 --- a/test/packages/js-experimental/src/generated/instructions/createMasterEditionV3.ts +++ b/test/packages/js-experimental/src/generated/instructions/createMasterEditionV3.ts @@ -160,24 +160,21 @@ export type CreateMasterEditionV3InstructionDataArgs = { createMasterEditionArgs: CreateMasterEditionArgsArgs; }; -export function getCreateMasterEditionV3InstructionDataEncoder() { +export function getCreateMasterEditionV3InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createMasterEditionArgs: CreateMasterEditionArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsEncoder()], ]), (value) => ({ ...value, discriminator: 17 }) - ) satisfies Encoder; + ); } -export function getCreateMasterEditionV3InstructionDataDecoder() { - return getStructDecoder([ +export function getCreateMasterEditionV3InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getCreateMasterEditionV3InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createMetadataAccount.ts b/test/packages/js-experimental/src/generated/instructions/createMetadataAccount.ts index 7fb3f62be..a5200cc02 100644 --- a/test/packages/js-experimental/src/generated/instructions/createMetadataAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/createMetadataAccount.ts @@ -178,30 +178,13 @@ export type CreateMetadataAccountInstructionDataArgs = { metadataBump: number; }; -export function getCreateMetadataAccountInstructionDataEncoder() { +export function getCreateMetadataAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - data: { - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }; - isMutable: boolean; - metadataBump: number; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'data', - getStructEncoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>([ + getStructEncoder([ ['name', getStringEncoder()], ['symbol', getStringEncoder()], ['uri', getStringEncoder()], @@ -213,21 +196,15 @@ export function getCreateMetadataAccountInstructionDataEncoder() { ['metadataBump', getU8Encoder()], ]), (value) => ({ ...value, discriminator: 0 }) - ) satisfies Encoder; + ); } -export function getCreateMetadataAccountInstructionDataDecoder() { - return getStructDecoder([ +export function getCreateMetadataAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], [ 'data', - getStructDecoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: Option>; - }>([ + getStructDecoder([ ['name', getStringDecoder()], ['symbol', getStringDecoder()], ['uri', getStringDecoder()], @@ -237,7 +214,7 @@ export function getCreateMetadataAccountInstructionDataDecoder() { ], ['isMutable', getBooleanDecoder()], ['metadataBump', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getCreateMetadataAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV2.ts b/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV2.ts index ee9b585bc..fc52cc0b5 100644 --- a/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV2.ts +++ b/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV2.ts @@ -140,27 +140,23 @@ export type CreateMetadataAccountV2InstructionDataArgs = { isMutable: boolean; }; -export function getCreateMetadataAccountV2InstructionDataEncoder() { +export function getCreateMetadataAccountV2InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - data: DataV2Args; - isMutable: boolean; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['data', getDataV2Encoder()], ['isMutable', getBooleanEncoder()], ]), (value) => ({ ...value, discriminator: 16 }) - ) satisfies Encoder; + ); } -export function getCreateMetadataAccountV2InstructionDataDecoder() { - return getStructDecoder([ +export function getCreateMetadataAccountV2InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['data', getDataV2Decoder()], ['isMutable', getBooleanDecoder()], - ]) satisfies Decoder; + ]); } export function getCreateMetadataAccountV2InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV3.ts b/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV3.ts index 3982ba598..ba086327b 100644 --- a/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV3.ts +++ b/test/packages/js-experimental/src/generated/instructions/createMetadataAccountV3.ts @@ -154,30 +154,25 @@ export type CreateMetadataAccountV3InstructionDataArgs = { collectionDetails: OptionOrNullable; }; -export function getCreateMetadataAccountV3InstructionDataEncoder() { +export function getCreateMetadataAccountV3InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - data: DataV2Args; - isMutable: boolean; - collectionDetails: OptionOrNullable; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['data', getDataV2Encoder()], ['isMutable', getBooleanEncoder()], ['collectionDetails', getOptionEncoder(getCollectionDetailsEncoder())], ]), (value) => ({ ...value, discriminator: 33 }) - ) satisfies Encoder; + ); } -export function getCreateMetadataAccountV3InstructionDataDecoder() { - return getStructDecoder([ +export function getCreateMetadataAccountV3InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['data', getDataV2Decoder()], ['isMutable', getBooleanDecoder()], ['collectionDetails', getOptionDecoder(getCollectionDetailsDecoder())], - ]) satisfies Decoder; + ]); } export function getCreateMetadataAccountV3InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createRuleSet.ts b/test/packages/js-experimental/src/generated/instructions/createRuleSet.ts index 0a0e7f95a..4c0c63f8f 100644 --- a/test/packages/js-experimental/src/generated/instructions/createRuleSet.ts +++ b/test/packages/js-experimental/src/generated/instructions/createRuleSet.ts @@ -105,27 +105,23 @@ export type CreateRuleSetInstructionDataArgs = { ruleSetBump: number; }; -export function getCreateRuleSetInstructionDataEncoder() { +export function getCreateRuleSetInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createArgs: TaCreateArgsArgs; - ruleSetBump: number; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createArgs', getTaCreateArgsEncoder()], ['ruleSetBump', getU8Encoder()], ]), (value) => ({ ...value, discriminator: 0 }) - ) satisfies Encoder; + ); } -export function getCreateRuleSetInstructionDataDecoder() { - return getStructDecoder([ +export function getCreateRuleSetInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createArgs', getTaCreateArgsDecoder()], ['ruleSetBump', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getCreateRuleSetInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createV1.ts b/test/packages/js-experimental/src/generated/instructions/createV1.ts index 8773156f0..b9989e7ef 100644 --- a/test/packages/js-experimental/src/generated/instructions/createV1.ts +++ b/test/packages/js-experimental/src/generated/instructions/createV1.ts @@ -176,15 +176,9 @@ export type CreateV1InstructionDataArgs = { maxSupply: OptionOrNullable; }; -export function getCreateV1InstructionDataEncoder() { +export function getCreateV1InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createV1Discriminator: number; - assetData: AssetDataArgs; - decimals: OptionOrNullable; - maxSupply: OptionOrNullable; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createV1Discriminator', getU8Encoder()], ['assetData', getAssetDataEncoder()], @@ -192,17 +186,17 @@ export function getCreateV1InstructionDataEncoder() { ['maxSupply', getOptionEncoder(getU64Encoder())], ]), (value) => ({ ...value, discriminator: 41, createV1Discriminator: 0 }) - ) satisfies Encoder; + ); } -export function getCreateV1InstructionDataDecoder() { - return getStructDecoder([ +export function getCreateV1InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createV1Discriminator', getU8Decoder()], ['assetData', getAssetDataDecoder()], ['decimals', getOptionDecoder(getU8Decoder())], ['maxSupply', getOptionDecoder(getU64Decoder())], - ]) satisfies Decoder; + ]); } export function getCreateV1InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/createV2.ts b/test/packages/js-experimental/src/generated/instructions/createV2.ts index 03200fcc5..305a17838 100644 --- a/test/packages/js-experimental/src/generated/instructions/createV2.ts +++ b/test/packages/js-experimental/src/generated/instructions/createV2.ts @@ -174,30 +174,25 @@ export type CreateV2InstructionDataArgs = { maxSupply: OptionOrNullable; }; -export function getCreateV2InstructionDataEncoder() { +export function getCreateV2InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createV2Discriminator: number; - assetData: AssetDataArgs; - maxSupply: OptionOrNullable; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createV2Discriminator', getU8Encoder()], ['assetData', getAssetDataEncoder()], ['maxSupply', getOptionEncoder(getU64Encoder())], ]), (value) => ({ ...value, discriminator: 41, createV2Discriminator: 1 }) - ) satisfies Encoder; + ); } -export function getCreateV2InstructionDataDecoder() { - return getStructDecoder([ +export function getCreateV2InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createV2Discriminator', getU8Decoder()], ['assetData', getAssetDataDecoder()], ['maxSupply', getOptionDecoder(getU64Decoder())], - ]) satisfies Decoder; + ]); } export function getCreateV2InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/delegate.ts b/test/packages/js-experimental/src/generated/instructions/delegate.ts index bfe1ad9ba..1d7361fd2 100644 --- a/test/packages/js-experimental/src/generated/instructions/delegate.ts +++ b/test/packages/js-experimental/src/generated/instructions/delegate.ts @@ -190,23 +190,21 @@ export type DelegateInstructionData = { export type DelegateInstructionDataArgs = { delegateArgs: DelegateArgsArgs }; -export function getDelegateInstructionDataEncoder() { +export function getDelegateInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; delegateArgs: DelegateArgsArgs }>( - [ - ['discriminator', getU8Encoder()], - ['delegateArgs', getDelegateArgsEncoder()], - ] - ), + getStructEncoder([ + ['discriminator', getU8Encoder()], + ['delegateArgs', getDelegateArgsEncoder()], + ]), (value) => ({ ...value, discriminator: 48 }) - ) satisfies Encoder; + ); } -export function getDelegateInstructionDataDecoder() { - return getStructDecoder([ +export function getDelegateInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['delegateArgs', getDelegateArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getDelegateInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/deprecatedCreateMasterEdition.ts b/test/packages/js-experimental/src/generated/instructions/deprecatedCreateMasterEdition.ts index f0434c230..89f0aae0e 100644 --- a/test/packages/js-experimental/src/generated/instructions/deprecatedCreateMasterEdition.ts +++ b/test/packages/js-experimental/src/generated/instructions/deprecatedCreateMasterEdition.ts @@ -202,24 +202,21 @@ export type DeprecatedCreateMasterEditionInstructionDataArgs = { createMasterEditionArgs: CreateMasterEditionArgsArgs; }; -export function getDeprecatedCreateMasterEditionInstructionDataEncoder() { +export function getDeprecatedCreateMasterEditionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - createMasterEditionArgs: CreateMasterEditionArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsEncoder()], ]), (value) => ({ ...value, discriminator: 2 }) - ) satisfies Encoder; + ); } -export function getDeprecatedCreateMasterEditionInstructionDataDecoder() { - return getStructDecoder([ +export function getDeprecatedCreateMasterEditionInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['createMasterEditionArgs', getCreateMasterEditionArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getDeprecatedCreateMasterEditionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/test/packages/js-experimental/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index d550476d3..0bc56899d 100644 --- a/test/packages/js-experimental/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/test/packages/js-experimental/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -207,19 +207,15 @@ export type DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstruction export type DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataArgs = {}; -export function getDeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataEncoder() { +export function getDeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 3 }) - ) satisfies Encoder; + ); } -export function getDeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataDecoder() { - return getStructDecoder( - [['discriminator', getU8Decoder()]] - ) satisfies Decoder; +export function getDeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getDeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokens.ts b/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokens.ts index 0b8cd1f21..e77f92ba8 100644 --- a/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokens.ts +++ b/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokens.ts @@ -138,12 +138,9 @@ export type DeprecatedMintPrintingTokensInstructionDataArgs = { mintPrintingTokensViaTokenArgs: MintPrintingTokensViaTokenArgsArgs; }; -export function getDeprecatedMintPrintingTokensInstructionDataEncoder() { +export function getDeprecatedMintPrintingTokensInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - mintPrintingTokensViaTokenArgs: MintPrintingTokensViaTokenArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'mintPrintingTokensViaTokenArgs', @@ -151,17 +148,17 @@ export function getDeprecatedMintPrintingTokensInstructionDataEncoder() { ], ]), (value) => ({ ...value, discriminator: 9 }) - ) satisfies Encoder; + ); } -export function getDeprecatedMintPrintingTokensInstructionDataDecoder() { - return getStructDecoder([ +export function getDeprecatedMintPrintingTokensInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], [ 'mintPrintingTokensViaTokenArgs', getMintPrintingTokensViaTokenArgsDecoder(), ], - ]) satisfies Decoder; + ]); } export function getDeprecatedMintPrintingTokensInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts b/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts index aeeb590e1..57516ca27 100644 --- a/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts +++ b/test/packages/js-experimental/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts @@ -158,12 +158,9 @@ export type DeprecatedMintPrintingTokensViaTokenInstructionDataArgs = { mintPrintingTokensViaTokenArgs: MintPrintingTokensViaTokenArgsArgs; }; -export function getDeprecatedMintPrintingTokensViaTokenInstructionDataEncoder() { +export function getDeprecatedMintPrintingTokensViaTokenInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - mintPrintingTokensViaTokenArgs: MintPrintingTokensViaTokenArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'mintPrintingTokensViaTokenArgs', @@ -171,17 +168,17 @@ export function getDeprecatedMintPrintingTokensViaTokenInstructionDataEncoder() ], ]), (value) => ({ ...value, discriminator: 8 }) - ) satisfies Encoder; + ); } -export function getDeprecatedMintPrintingTokensViaTokenInstructionDataDecoder() { - return getStructDecoder([ +export function getDeprecatedMintPrintingTokensViaTokenInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], [ 'mintPrintingTokensViaTokenArgs', getMintPrintingTokensViaTokenArgsDecoder(), ], - ]) satisfies Decoder; + ]); } export function getDeprecatedMintPrintingTokensViaTokenInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/deprecatedSetReservationList.ts b/test/packages/js-experimental/src/generated/instructions/deprecatedSetReservationList.ts index bfb054cf5..1472abcc5 100644 --- a/test/packages/js-experimental/src/generated/instructions/deprecatedSetReservationList.ts +++ b/test/packages/js-experimental/src/generated/instructions/deprecatedSetReservationList.ts @@ -116,15 +116,9 @@ export type DeprecatedSetReservationListInstructionDataArgs = { totalSpotOffset: number | bigint; }; -export function getDeprecatedSetReservationListInstructionDataEncoder() { +export function getDeprecatedSetReservationListInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - reservations: Array; - totalReservationSpots: OptionOrNullable; - offset: number | bigint; - totalSpotOffset: number | bigint; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['reservations', getArrayEncoder(getReservationEncoder())], ['totalReservationSpots', getOptionEncoder(getU64Encoder())], @@ -132,17 +126,17 @@ export function getDeprecatedSetReservationListInstructionDataEncoder() { ['totalSpotOffset', getU64Encoder()], ]), (value) => ({ ...value, discriminator: 5 }) - ) satisfies Encoder; + ); } -export function getDeprecatedSetReservationListInstructionDataDecoder() { - return getStructDecoder([ +export function getDeprecatedSetReservationListInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['reservations', getArrayDecoder(getReservationDecoder())], ['totalReservationSpots', getOptionDecoder(getU64Decoder())], ['offset', getU64Decoder()], ['totalSpotOffset', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getDeprecatedSetReservationListInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/dummy.ts b/test/packages/js-experimental/src/generated/instructions/dummy.ts index 55a92481f..c807990e7 100644 --- a/test/packages/js-experimental/src/generated/instructions/dummy.ts +++ b/test/packages/js-experimental/src/generated/instructions/dummy.ts @@ -155,22 +155,22 @@ export type DummyInstructionData = { discriminator: Array }; export type DummyInstructionDataArgs = {}; -export function getDummyInstructionDataEncoder() { +export function getDummyInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ]), (value) => ({ ...value, discriminator: [167, 117, 211, 79, 251, 254, 47, 135], }) - ) satisfies Encoder; + ); } -export function getDummyInstructionDataDecoder() { - return getStructDecoder([ +export function getDummyInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], - ]) satisfies Decoder; + ]); } export function getDummyInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/freezeDelegatedAccount.ts b/test/packages/js-experimental/src/generated/instructions/freezeDelegatedAccount.ts index 247b6deb5..850ba4a28 100644 --- a/test/packages/js-experimental/src/generated/instructions/freezeDelegatedAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/freezeDelegatedAccount.ts @@ -107,19 +107,15 @@ export type FreezeDelegatedAccountInstructionData = { discriminator: number }; export type FreezeDelegatedAccountInstructionDataArgs = {}; -export function getFreezeDelegatedAccountInstructionDataEncoder() { +export function getFreezeDelegatedAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 26 }) - ) satisfies Encoder; + ); } -export function getFreezeDelegatedAccountInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getFreezeDelegatedAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getFreezeDelegatedAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/initialize.ts b/test/packages/js-experimental/src/generated/instructions/initialize.ts index 26ecab0d8..4a843f830 100644 --- a/test/packages/js-experimental/src/generated/instructions/initialize.ts +++ b/test/packages/js-experimental/src/generated/instructions/initialize.ts @@ -184,12 +184,9 @@ export type InitializeInstructionData = { export type InitializeInstructionDataArgs = { data: CandyMachineDataArgs }; -export function getInitializeInstructionDataEncoder() { +export function getInitializeInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: Array; - data: CandyMachineDataArgs; - }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ['data', getCandyMachineDataEncoder()], ]), @@ -197,14 +194,14 @@ export function getInitializeInstructionDataEncoder() { ...value, discriminator: [175, 175, 109, 31, 13, 152, 155, 237], }) - ) satisfies Encoder; + ); } -export function getInitializeInstructionDataDecoder() { - return getStructDecoder([ +export function getInitializeInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], ['data', getCandyMachineDataDecoder()], - ]) satisfies Decoder; + ]); } export function getInitializeInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/migrate.ts b/test/packages/js-experimental/src/generated/instructions/migrate.ts index 2a2d2a6dc..b5be675c0 100644 --- a/test/packages/js-experimental/src/generated/instructions/migrate.ts +++ b/test/packages/js-experimental/src/generated/instructions/migrate.ts @@ -164,21 +164,21 @@ export type MigrateInstructionData = { export type MigrateInstructionDataArgs = { migrateArgs: MigrateArgsArgs }; -export function getMigrateInstructionDataEncoder() { +export function getMigrateInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; migrateArgs: MigrateArgsArgs }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['migrateArgs', getMigrateArgsEncoder()], ]), (value) => ({ ...value, discriminator: 50 }) - ) satisfies Encoder; + ); } -export function getMigrateInstructionDataDecoder() { - return getStructDecoder([ +export function getMigrateInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['migrateArgs', getMigrateArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getMigrateInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/mint.ts b/test/packages/js-experimental/src/generated/instructions/mint.ts index 34ce5b7e1..cace9a35c 100644 --- a/test/packages/js-experimental/src/generated/instructions/mint.ts +++ b/test/packages/js-experimental/src/generated/instructions/mint.ts @@ -187,21 +187,21 @@ export type MintInstructionData = { discriminator: number; mintArgs: MintArgs }; export type MintInstructionDataArgs = { mintArgs: MintArgsArgs }; -export function getMintInstructionDataEncoder() { +export function getMintInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; mintArgs: MintArgsArgs }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['mintArgs', getMintArgsEncoder()], ]), (value) => ({ ...value, discriminator: 42 }) - ) satisfies Encoder; + ); } -export function getMintInstructionDataDecoder() { - return getStructDecoder([ +export function getMintInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['mintArgs', getMintArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getMintInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/mintFromCandyMachine.ts b/test/packages/js-experimental/src/generated/instructions/mintFromCandyMachine.ts index 42272de8c..06e45d3b0 100644 --- a/test/packages/js-experimental/src/generated/instructions/mintFromCandyMachine.ts +++ b/test/packages/js-experimental/src/generated/instructions/mintFromCandyMachine.ts @@ -230,22 +230,22 @@ export type MintFromCandyMachineInstructionData = { export type MintFromCandyMachineInstructionDataArgs = {}; -export function getMintFromCandyMachineInstructionDataEncoder() { +export function getMintFromCandyMachineInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ]), (value) => ({ ...value, discriminator: [51, 57, 225, 47, 182, 146, 137, 166], }) - ) satisfies Encoder; + ); } -export function getMintFromCandyMachineInstructionDataDecoder() { - return getStructDecoder([ +export function getMintFromCandyMachineInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], - ]) satisfies Decoder; + ]); } export function getMintFromCandyMachineInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index 0da28aa67..20f1fb403 100644 --- a/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -201,12 +201,9 @@ export type MintNewEditionFromMasterEditionViaTokenInstructionDataArgs = { mintNewEditionFromMasterEditionViaTokenArgs: MintNewEditionFromMasterEditionViaTokenArgsArgs; }; -export function getMintNewEditionFromMasterEditionViaTokenInstructionDataEncoder() { +export function getMintNewEditionFromMasterEditionViaTokenInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - mintNewEditionFromMasterEditionViaTokenArgs: MintNewEditionFromMasterEditionViaTokenArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'mintNewEditionFromMasterEditionViaTokenArgs', @@ -214,19 +211,17 @@ export function getMintNewEditionFromMasterEditionViaTokenInstructionDataEncoder ], ]), (value) => ({ ...value, discriminator: 11 }) - ) satisfies Encoder; + ); } -export function getMintNewEditionFromMasterEditionViaTokenInstructionDataDecoder() { - return getStructDecoder( +export function getMintNewEditionFromMasterEditionViaTokenInstructionDataDecoder(): Decoder { + return getStructDecoder([ + ['discriminator', getU8Decoder()], [ - ['discriminator', getU8Decoder()], - [ - 'mintNewEditionFromMasterEditionViaTokenArgs', - getMintNewEditionFromMasterEditionViaTokenArgsDecoder(), - ], - ] - ) satisfies Decoder; + 'mintNewEditionFromMasterEditionViaTokenArgs', + getMintNewEditionFromMasterEditionViaTokenArgsDecoder(), + ], + ]); } export function getMintNewEditionFromMasterEditionViaTokenInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 154d89028..f7e2e843d 100644 --- a/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/test/packages/js-experimental/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -225,12 +225,9 @@ export type MintNewEditionFromMasterEditionViaVaultProxyInstructionDataArgs = { mintNewEditionFromMasterEditionViaTokenArgs: MintNewEditionFromMasterEditionViaTokenArgsArgs; }; -export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataEncoder() { +export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - mintNewEditionFromMasterEditionViaTokenArgs: MintNewEditionFromMasterEditionViaTokenArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'mintNewEditionFromMasterEditionViaTokenArgs', @@ -238,19 +235,17 @@ export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataEn ], ]), (value) => ({ ...value, discriminator: 13 }) - ) satisfies Encoder; + ); } -export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataDecoder() { - return getStructDecoder( +export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataDecoder(): Decoder { + return getStructDecoder([ + ['discriminator', getU8Decoder()], [ - ['discriminator', getU8Decoder()], - [ - 'mintNewEditionFromMasterEditionViaTokenArgs', - getMintNewEditionFromMasterEditionViaTokenArgsDecoder(), - ], - ] - ) satisfies Decoder; + 'mintNewEditionFromMasterEditionViaTokenArgs', + getMintNewEditionFromMasterEditionViaTokenArgsDecoder(), + ], + ]); } export function getMintNewEditionFromMasterEditionViaVaultProxyInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/puffMetadata.ts b/test/packages/js-experimental/src/generated/instructions/puffMetadata.ts index 3f7c8db75..c95dd4faa 100644 --- a/test/packages/js-experimental/src/generated/instructions/puffMetadata.ts +++ b/test/packages/js-experimental/src/generated/instructions/puffMetadata.ts @@ -67,19 +67,15 @@ export type PuffMetadataInstructionData = { discriminator: number }; export type PuffMetadataInstructionDataArgs = {}; -export function getPuffMetadataInstructionDataEncoder() { +export function getPuffMetadataInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 14 }) - ) satisfies Encoder; + ); } -export function getPuffMetadataInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getPuffMetadataInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getPuffMetadataInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/removeCreatorVerification.ts b/test/packages/js-experimental/src/generated/instructions/removeCreatorVerification.ts index 3e66ce91e..7edd35e98 100644 --- a/test/packages/js-experimental/src/generated/instructions/removeCreatorVerification.ts +++ b/test/packages/js-experimental/src/generated/instructions/removeCreatorVerification.ts @@ -80,19 +80,15 @@ export type RemoveCreatorVerificationInstructionData = { export type RemoveCreatorVerificationInstructionDataArgs = {}; -export function getRemoveCreatorVerificationInstructionDataEncoder() { +export function getRemoveCreatorVerificationInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 28 }) - ) satisfies Encoder; + ); } -export function getRemoveCreatorVerificationInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getRemoveCreatorVerificationInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getRemoveCreatorVerificationInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/revoke.ts b/test/packages/js-experimental/src/generated/instructions/revoke.ts index c7df39d67..074f87d4c 100644 --- a/test/packages/js-experimental/src/generated/instructions/revoke.ts +++ b/test/packages/js-experimental/src/generated/instructions/revoke.ts @@ -190,21 +190,21 @@ export type RevokeInstructionData = { export type RevokeInstructionDataArgs = { revokeArgs: RevokeArgsArgs }; -export function getRevokeInstructionDataEncoder() { +export function getRevokeInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; revokeArgs: RevokeArgsArgs }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['revokeArgs', getRevokeArgsEncoder()], ]), (value) => ({ ...value, discriminator: 49 }) - ) satisfies Encoder; + ); } -export function getRevokeInstructionDataDecoder() { - return getStructDecoder([ +export function getRevokeInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['revokeArgs', getRevokeArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getRevokeInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/revokeCollectionAuthority.ts b/test/packages/js-experimental/src/generated/instructions/revokeCollectionAuthority.ts index d6dffdac5..ec2fc955f 100644 --- a/test/packages/js-experimental/src/generated/instructions/revokeCollectionAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/revokeCollectionAuthority.ts @@ -109,19 +109,15 @@ export type RevokeCollectionAuthorityInstructionData = { export type RevokeCollectionAuthorityInstructionDataArgs = {}; -export function getRevokeCollectionAuthorityInstructionDataEncoder() { +export function getRevokeCollectionAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 24 }) - ) satisfies Encoder; + ); } -export function getRevokeCollectionAuthorityInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getRevokeCollectionAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getRevokeCollectionAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/revokeUseAuthority.ts b/test/packages/js-experimental/src/generated/instructions/revokeUseAuthority.ts index 028c738f2..329275b81 100644 --- a/test/packages/js-experimental/src/generated/instructions/revokeUseAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/revokeUseAuthority.ts @@ -143,19 +143,15 @@ export type RevokeUseAuthorityInstructionData = { discriminator: number }; export type RevokeUseAuthorityInstructionDataArgs = {}; -export function getRevokeUseAuthorityInstructionDataEncoder() { +export function getRevokeUseAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 21 }) - ) satisfies Encoder; + ); } -export function getRevokeUseAuthorityInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getRevokeUseAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getRevokeUseAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setAndVerifyCollection.ts b/test/packages/js-experimental/src/generated/instructions/setAndVerifyCollection.ts index 0aac67398..1273e0a9f 100644 --- a/test/packages/js-experimental/src/generated/instructions/setAndVerifyCollection.ts +++ b/test/packages/js-experimental/src/generated/instructions/setAndVerifyCollection.ts @@ -136,19 +136,15 @@ export type SetAndVerifyCollectionInstructionData = { discriminator: number }; export type SetAndVerifyCollectionInstructionDataArgs = {}; -export function getSetAndVerifyCollectionInstructionDataEncoder() { +export function getSetAndVerifyCollectionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 25 }) - ) satisfies Encoder; + ); } -export function getSetAndVerifyCollectionInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getSetAndVerifyCollectionInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getSetAndVerifyCollectionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setAndVerifySizedCollectionItem.ts b/test/packages/js-experimental/src/generated/instructions/setAndVerifySizedCollectionItem.ts index 749e1a154..807d09420 100644 --- a/test/packages/js-experimental/src/generated/instructions/setAndVerifySizedCollectionItem.ts +++ b/test/packages/js-experimental/src/generated/instructions/setAndVerifySizedCollectionItem.ts @@ -139,19 +139,15 @@ export type SetAndVerifySizedCollectionItemInstructionData = { export type SetAndVerifySizedCollectionItemInstructionDataArgs = {}; -export function getSetAndVerifySizedCollectionItemInstructionDataEncoder() { +export function getSetAndVerifySizedCollectionItemInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 32 }) - ) satisfies Encoder; + ); } -export function getSetAndVerifySizedCollectionItemInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getSetAndVerifySizedCollectionItemInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getSetAndVerifySizedCollectionItemInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setAuthority.ts b/test/packages/js-experimental/src/generated/instructions/setAuthority.ts index 1314b33a7..6a194b72f 100644 --- a/test/packages/js-experimental/src/generated/instructions/setAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/setAuthority.ts @@ -87,9 +87,9 @@ export type SetAuthorityInstructionData = { export type SetAuthorityInstructionDataArgs = { newAuthority: Address }; -export function getSetAuthorityInstructionDataEncoder() { +export function getSetAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array; newAuthority: Address }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ['newAuthority', getAddressEncoder()], ]), @@ -97,14 +97,14 @@ export function getSetAuthorityInstructionDataEncoder() { ...value, discriminator: [133, 250, 37, 21, 110, 163, 26, 121], }) - ) satisfies Encoder; + ); } -export function getSetAuthorityInstructionDataDecoder() { - return getStructDecoder([ +export function getSetAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], ['newAuthority', getAddressDecoder()], - ]) satisfies Decoder; + ]); } export function getSetAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setCollection.ts b/test/packages/js-experimental/src/generated/instructions/setCollection.ts index d8f28ab20..7e694b589 100644 --- a/test/packages/js-experimental/src/generated/instructions/setCollection.ts +++ b/test/packages/js-experimental/src/generated/instructions/setCollection.ts @@ -204,22 +204,22 @@ export type SetCollectionInstructionData = { discriminator: Array }; export type SetCollectionInstructionDataArgs = {}; -export function getSetCollectionInstructionDataEncoder() { +export function getSetCollectionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ]), (value) => ({ ...value, discriminator: [192, 254, 206, 76, 168, 182, 59, 223], }) - ) satisfies Encoder; + ); } -export function getSetCollectionInstructionDataDecoder() { - return getStructDecoder([ +export function getSetCollectionInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], - ]) satisfies Decoder; + ]); } export function getSetCollectionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setCollectionSize.ts b/test/packages/js-experimental/src/generated/instructions/setCollectionSize.ts index 187949d3e..e9be0b495 100644 --- a/test/packages/js-experimental/src/generated/instructions/setCollectionSize.ts +++ b/test/packages/js-experimental/src/generated/instructions/setCollectionSize.ts @@ -110,24 +110,21 @@ export type SetCollectionSizeInstructionDataArgs = { setCollectionSizeArgs: SetCollectionSizeArgsArgs; }; -export function getSetCollectionSizeInstructionDataEncoder() { +export function getSetCollectionSizeInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - setCollectionSizeArgs: SetCollectionSizeArgsArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['setCollectionSizeArgs', getSetCollectionSizeArgsEncoder()], ]), (value) => ({ ...value, discriminator: 34 }) - ) satisfies Encoder; + ); } -export function getSetCollectionSizeInstructionDataDecoder() { - return getStructDecoder([ +export function getSetCollectionSizeInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['setCollectionSizeArgs', getSetCollectionSizeArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getSetCollectionSizeInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setMintAuthority.ts b/test/packages/js-experimental/src/generated/instructions/setMintAuthority.ts index 8165f17ec..3c27499b8 100644 --- a/test/packages/js-experimental/src/generated/instructions/setMintAuthority.ts +++ b/test/packages/js-experimental/src/generated/instructions/setMintAuthority.ts @@ -89,22 +89,22 @@ export type SetMintAuthorityInstructionData = { discriminator: Array }; export type SetMintAuthorityInstructionDataArgs = {}; -export function getSetMintAuthorityInstructionDataEncoder() { +export function getSetMintAuthorityInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ]), (value) => ({ ...value, discriminator: [67, 127, 155, 187, 100, 174, 103, 121], }) - ) satisfies Encoder; + ); } -export function getSetMintAuthorityInstructionDataDecoder() { - return getStructDecoder([ +export function getSetMintAuthorityInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], - ]) satisfies Decoder; + ]); } export function getSetMintAuthorityInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/setTokenStandard.ts b/test/packages/js-experimental/src/generated/instructions/setTokenStandard.ts index 28099f0ff..39cd2d957 100644 --- a/test/packages/js-experimental/src/generated/instructions/setTokenStandard.ts +++ b/test/packages/js-experimental/src/generated/instructions/setTokenStandard.ts @@ -95,19 +95,15 @@ export type SetTokenStandardInstructionData = { discriminator: number }; export type SetTokenStandardInstructionDataArgs = {}; -export function getSetTokenStandardInstructionDataEncoder() { +export function getSetTokenStandardInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 35 }) - ) satisfies Encoder; + ); } -export function getSetTokenStandardInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getSetTokenStandardInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getSetTokenStandardInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/signMetadata.ts b/test/packages/js-experimental/src/generated/instructions/signMetadata.ts index f98a1847a..6c55f6fbd 100644 --- a/test/packages/js-experimental/src/generated/instructions/signMetadata.ts +++ b/test/packages/js-experimental/src/generated/instructions/signMetadata.ts @@ -78,19 +78,15 @@ export type SignMetadataInstructionData = { discriminator: number }; export type SignMetadataInstructionDataArgs = {}; -export function getSignMetadataInstructionDataEncoder() { +export function getSignMetadataInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 7 }) - ) satisfies Encoder; + ); } -export function getSignMetadataInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getSignMetadataInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getSignMetadataInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/thawDelegatedAccount.ts b/test/packages/js-experimental/src/generated/instructions/thawDelegatedAccount.ts index 5c8d94814..3e08898f2 100644 --- a/test/packages/js-experimental/src/generated/instructions/thawDelegatedAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/thawDelegatedAccount.ts @@ -107,19 +107,15 @@ export type ThawDelegatedAccountInstructionData = { discriminator: number }; export type ThawDelegatedAccountInstructionDataArgs = {}; -export function getThawDelegatedAccountInstructionDataEncoder() { +export function getThawDelegatedAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 27 }) - ) satisfies Encoder; + ); } -export function getThawDelegatedAccountInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getThawDelegatedAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getThawDelegatedAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/transfer.ts b/test/packages/js-experimental/src/generated/instructions/transfer.ts index 4e82dc4dd..8a136b1c1 100644 --- a/test/packages/js-experimental/src/generated/instructions/transfer.ts +++ b/test/packages/js-experimental/src/generated/instructions/transfer.ts @@ -215,23 +215,21 @@ export type TransferInstructionData = { export type TransferInstructionDataArgs = { transferArgs: TransferArgsArgs }; -export function getTransferInstructionDataEncoder() { +export function getTransferInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; transferArgs: TransferArgsArgs }>( - [ - ['discriminator', getU8Encoder()], - ['transferArgs', getTransferArgsEncoder()], - ] - ), + getStructEncoder([ + ['discriminator', getU8Encoder()], + ['transferArgs', getTransferArgsEncoder()], + ]), (value) => ({ ...value, discriminator: 46 }) - ) satisfies Encoder; + ); } -export function getTransferInstructionDataDecoder() { - return getStructDecoder([ +export function getTransferInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['transferArgs', getTransferArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getTransferInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/transferOutOfEscrow.ts b/test/packages/js-experimental/src/generated/instructions/transferOutOfEscrow.ts index 43876acc1..dd67b2ee5 100644 --- a/test/packages/js-experimental/src/generated/instructions/transferOutOfEscrow.ts +++ b/test/packages/js-experimental/src/generated/instructions/transferOutOfEscrow.ts @@ -195,21 +195,21 @@ export type TransferOutOfEscrowInstructionDataArgs = { amount: number | bigint; }; -export function getTransferOutOfEscrowInstructionDataEncoder() { +export function getTransferOutOfEscrowInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; amount: number | bigint }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['amount', getU64Encoder()], ]), (value) => ({ ...value, discriminator: 40 }) - ) satisfies Encoder; + ); } -export function getTransferOutOfEscrowInstructionDataDecoder() { - return getStructDecoder([ +export function getTransferOutOfEscrowInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['amount', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getTransferOutOfEscrowInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/transferSol.ts b/test/packages/js-experimental/src/generated/instructions/transferSol.ts index ceb5a61c9..afb20e61b 100644 --- a/test/packages/js-experimental/src/generated/instructions/transferSol.ts +++ b/test/packages/js-experimental/src/generated/instructions/transferSol.ts @@ -86,21 +86,21 @@ export type TransferSolInstructionData = { export type TransferSolInstructionDataArgs = { amount: number | bigint }; -export function getTransferSolInstructionDataEncoder() { +export function getTransferSolInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; amount: number | bigint }>([ + getStructEncoder([ ['discriminator', getU32Encoder()], ['amount', getU64Encoder()], ]), (value) => ({ ...value, discriminator: 2 }) - ) satisfies Encoder; + ); } -export function getTransferSolInstructionDataDecoder() { - return getStructDecoder([ +export function getTransferSolInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU32Decoder()], ['amount', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getTransferSolInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/unverifyCollection.ts b/test/packages/js-experimental/src/generated/instructions/unverifyCollection.ts index 52e2b4720..ccdc8f472 100644 --- a/test/packages/js-experimental/src/generated/instructions/unverifyCollection.ts +++ b/test/packages/js-experimental/src/generated/instructions/unverifyCollection.ts @@ -119,19 +119,15 @@ export type UnverifyCollectionInstructionData = { discriminator: number }; export type UnverifyCollectionInstructionDataArgs = {}; -export function getUnverifyCollectionInstructionDataEncoder() { +export function getUnverifyCollectionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 22 }) - ) satisfies Encoder; + ); } -export function getUnverifyCollectionInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getUnverifyCollectionInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getUnverifyCollectionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/unverifySizedCollectionItem.ts b/test/packages/js-experimental/src/generated/instructions/unverifySizedCollectionItem.ts index 8ef008600..0915c0b86 100644 --- a/test/packages/js-experimental/src/generated/instructions/unverifySizedCollectionItem.ts +++ b/test/packages/js-experimental/src/generated/instructions/unverifySizedCollectionItem.ts @@ -131,19 +131,15 @@ export type UnverifySizedCollectionItemInstructionData = { export type UnverifySizedCollectionItemInstructionDataArgs = {}; -export function getUnverifySizedCollectionItemInstructionDataEncoder() { +export function getUnverifySizedCollectionItemInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 31 }) - ) satisfies Encoder; + ); } -export function getUnverifySizedCollectionItemInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getUnverifySizedCollectionItemInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getUnverifySizedCollectionItemInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/updateCandyMachine.ts b/test/packages/js-experimental/src/generated/instructions/updateCandyMachine.ts index 43cc9444c..90bb5444f 100644 --- a/test/packages/js-experimental/src/generated/instructions/updateCandyMachine.ts +++ b/test/packages/js-experimental/src/generated/instructions/updateCandyMachine.ts @@ -91,12 +91,9 @@ export type UpdateCandyMachineInstructionDataArgs = { data: CandyMachineDataArgs; }; -export function getUpdateCandyMachineInstructionDataEncoder() { +export function getUpdateCandyMachineInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: Array; - data: CandyMachineDataArgs; - }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ['data', getCandyMachineDataEncoder()], ]), @@ -104,14 +101,14 @@ export function getUpdateCandyMachineInstructionDataEncoder() { ...value, discriminator: [219, 200, 88, 176, 158, 63, 253, 127], }) - ) satisfies Encoder; + ); } -export function getUpdateCandyMachineInstructionDataDecoder() { - return getStructDecoder([ +export function getUpdateCandyMachineInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], ['data', getCandyMachineDataDecoder()], - ]) satisfies Decoder; + ]); } export function getUpdateCandyMachineInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/updateMetadataAccount.ts b/test/packages/js-experimental/src/generated/instructions/updateMetadataAccount.ts index 50686ce81..a8c0d6cca 100644 --- a/test/packages/js-experimental/src/generated/instructions/updateMetadataAccount.ts +++ b/test/packages/js-experimental/src/generated/instructions/updateMetadataAccount.ts @@ -125,31 +125,14 @@ export type UpdateMetadataAccountInstructionDataArgs = { primarySaleHappened: OptionOrNullable; }; -export function getUpdateMetadataAccountInstructionDataEncoder() { +export function getUpdateMetadataAccountInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - data: OptionOrNullable<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>; - updateAuthority: OptionOrNullable
; - primarySaleHappened: OptionOrNullable; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], [ 'data', getOptionEncoder( - getStructEncoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>([ + getStructEncoder([ ['name', getStringEncoder()], ['symbol', getStringEncoder()], ['uri', getStringEncoder()], @@ -165,22 +148,16 @@ export function getUpdateMetadataAccountInstructionDataEncoder() { ['primarySaleHappened', getOptionEncoder(getBooleanEncoder())], ]), (value) => ({ ...value, discriminator: 1 }) - ) satisfies Encoder; + ); } -export function getUpdateMetadataAccountInstructionDataDecoder() { - return getStructDecoder([ +export function getUpdateMetadataAccountInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], [ 'data', getOptionDecoder( - getStructDecoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: Option>; - }>([ + getStructDecoder([ ['name', getStringDecoder()], ['symbol', getStringDecoder()], ['uri', getStringDecoder()], @@ -191,7 +168,7 @@ export function getUpdateMetadataAccountInstructionDataDecoder() { ], ['updateAuthority', getOptionDecoder(getAddressDecoder())], ['primarySaleHappened', getOptionDecoder(getBooleanDecoder())], - ]) satisfies Decoder; + ]); } export function getUpdateMetadataAccountInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/updateMetadataAccountV2.ts b/test/packages/js-experimental/src/generated/instructions/updateMetadataAccountV2.ts index cf06a0fcf..53b587547 100644 --- a/test/packages/js-experimental/src/generated/instructions/updateMetadataAccountV2.ts +++ b/test/packages/js-experimental/src/generated/instructions/updateMetadataAccountV2.ts @@ -107,15 +107,9 @@ export type UpdateMetadataAccountV2InstructionDataArgs = { isMutable: OptionOrNullable; }; -export function getUpdateMetadataAccountV2InstructionDataEncoder() { +export function getUpdateMetadataAccountV2InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - data: OptionOrNullable; - updateAuthority: OptionOrNullable
; - primarySaleHappened: OptionOrNullable; - isMutable: OptionOrNullable; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['data', getOptionEncoder(getDataV2Encoder())], ['updateAuthority', getOptionEncoder(getAddressEncoder())], @@ -123,17 +117,17 @@ export function getUpdateMetadataAccountV2InstructionDataEncoder() { ['isMutable', getOptionEncoder(getBooleanEncoder())], ]), (value) => ({ ...value, discriminator: 15 }) - ) satisfies Encoder; + ); } -export function getUpdateMetadataAccountV2InstructionDataDecoder() { - return getStructDecoder([ +export function getUpdateMetadataAccountV2InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['data', getOptionDecoder(getDataV2Decoder())], ['updateAuthority', getOptionDecoder(getAddressDecoder())], ['primarySaleHappened', getOptionDecoder(getBooleanDecoder())], ['isMutable', getOptionDecoder(getBooleanDecoder())], - ]) satisfies Decoder; + ]); } export function getUpdateMetadataAccountV2InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts b/test/packages/js-experimental/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts index b1535c6bc..5edcedb13 100644 --- a/test/packages/js-experimental/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts +++ b/test/packages/js-experimental/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts @@ -89,19 +89,15 @@ export type UpdatePrimarySaleHappenedViaTokenInstructionData = { export type UpdatePrimarySaleHappenedViaTokenInstructionDataArgs = {}; -export function getUpdatePrimarySaleHappenedViaTokenInstructionDataEncoder() { +export function getUpdatePrimarySaleHappenedViaTokenInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 4 }) - ) satisfies Encoder; + ); } -export function getUpdatePrimarySaleHappenedViaTokenInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getUpdatePrimarySaleHappenedViaTokenInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getUpdatePrimarySaleHappenedViaTokenInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/updateV1.ts b/test/packages/js-experimental/src/generated/instructions/updateV1.ts index 9d0f6a363..8fd4c11ff 100644 --- a/test/packages/js-experimental/src/generated/instructions/updateV1.ts +++ b/test/packages/js-experimental/src/generated/instructions/updateV1.ts @@ -254,30 +254,9 @@ export type UpdateV1InstructionDataArgs = { authorityType: AuthorityTypeArgs; }; -export function getUpdateV1InstructionDataEncoder() { +export function getUpdateV1InstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - updateV1Discriminator: number; - authorizationData: OptionOrNullable; - newUpdateAuthority: OptionOrNullable
; - data: OptionOrNullable<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>; - primarySaleHappened: OptionOrNullable; - isMutable: OptionOrNullable; - tokenStandard: OptionOrNullable; - collection: OptionOrNullable; - uses: OptionOrNullable; - collectionDetails: OptionOrNullable; - programmableConfig: OptionOrNullable; - delegateState: OptionOrNullable; - authorityType: AuthorityTypeArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['updateV1Discriminator', getU8Encoder()], ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())], @@ -285,13 +264,7 @@ export function getUpdateV1InstructionDataEncoder() { [ 'data', getOptionEncoder( - getStructEncoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>([ + getStructEncoder([ ['name', getStringEncoder()], ['symbol', getStringEncoder()], ['uri', getStringEncoder()], @@ -319,11 +292,11 @@ export function getUpdateV1InstructionDataEncoder() { updateV1Discriminator: 0, tokenStandard: value.tokenStandard ?? some(TokenStandard.NonFungible), }) - ) satisfies Encoder; + ); } -export function getUpdateV1InstructionDataDecoder() { - return getStructDecoder([ +export function getUpdateV1InstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['updateV1Discriminator', getU8Decoder()], ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())], @@ -331,13 +304,7 @@ export function getUpdateV1InstructionDataDecoder() { [ 'data', getOptionDecoder( - getStructDecoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: Option>; - }>([ + getStructDecoder([ ['name', getStringDecoder()], ['symbol', getStringDecoder()], ['uri', getStringDecoder()], @@ -355,7 +322,7 @@ export function getUpdateV1InstructionDataDecoder() { ['programmableConfig', getOptionDecoder(getProgrammableConfigDecoder())], ['delegateState', getOptionDecoder(getDelegateStateDecoder())], ['authorityType', getAuthorityTypeDecoder()], - ]) satisfies Decoder; + ]); } export function getUpdateV1InstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/useAsset.ts b/test/packages/js-experimental/src/generated/instructions/useAsset.ts index a03bc8051..ca0219cbe 100644 --- a/test/packages/js-experimental/src/generated/instructions/useAsset.ts +++ b/test/packages/js-experimental/src/generated/instructions/useAsset.ts @@ -176,23 +176,21 @@ export type UseAssetInstructionData = { export type UseAssetInstructionDataArgs = { useAssetArgs: UseAssetArgsArgs }; -export function getUseAssetInstructionDataEncoder() { +export function getUseAssetInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; useAssetArgs: UseAssetArgsArgs }>( - [ - ['discriminator', getU8Encoder()], - ['useAssetArgs', getUseAssetArgsEncoder()], - ] - ), + getStructEncoder([ + ['discriminator', getU8Encoder()], + ['useAssetArgs', getUseAssetArgsEncoder()], + ]), (value) => ({ ...value, discriminator: 45 }) - ) satisfies Encoder; + ); } -export function getUseAssetInstructionDataDecoder() { - return getStructDecoder([ +export function getUseAssetInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['useAssetArgs', getUseAssetArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getUseAssetInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/utilize.ts b/test/packages/js-experimental/src/generated/instructions/utilize.ts index 4da019493..c5bb3c075 100644 --- a/test/packages/js-experimental/src/generated/instructions/utilize.ts +++ b/test/packages/js-experimental/src/generated/instructions/utilize.ts @@ -175,21 +175,21 @@ export type UtilizeInstructionData = { export type UtilizeInstructionDataArgs = { numberOfUses: number | bigint }; -export function getUtilizeInstructionDataEncoder() { +export function getUtilizeInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; numberOfUses: number | bigint }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['numberOfUses', getU64Encoder()], ]), (value) => ({ ...value, discriminator: 19 }) - ) satisfies Encoder; + ); } -export function getUtilizeInstructionDataDecoder() { - return getStructDecoder([ +export function getUtilizeInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['numberOfUses', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getUtilizeInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/validate.ts b/test/packages/js-experimental/src/generated/instructions/validate.ts index 6c40b1813..03cb6169b 100644 --- a/test/packages/js-experimental/src/generated/instructions/validate.ts +++ b/test/packages/js-experimental/src/generated/instructions/validate.ts @@ -336,30 +336,25 @@ export type ValidateInstructionDataArgs = { payload: PayloadArgs; }; -export function getValidateInstructionDataEncoder() { +export function getValidateInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - discriminator: number; - ruleSetName: string; - operation: OperationArgs; - payload: PayloadArgs; - }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['ruleSetName', getStringEncoder()], ['operation', getOperationEncoder()], ['payload', getPayloadEncoder()], ]), (value) => ({ ...value, discriminator: 1 }) - ) satisfies Encoder; + ); } -export function getValidateInstructionDataDecoder() { - return getStructDecoder([ +export function getValidateInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['ruleSetName', getStringDecoder()], ['operation', getOperationDecoder()], ['payload', getPayloadDecoder()], - ]) satisfies Decoder; + ]); } export function getValidateInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/verify.ts b/test/packages/js-experimental/src/generated/instructions/verify.ts index 4b30502de..36d6d0738 100644 --- a/test/packages/js-experimental/src/generated/instructions/verify.ts +++ b/test/packages/js-experimental/src/generated/instructions/verify.ts @@ -117,21 +117,21 @@ export type VerifyInstructionData = { export type VerifyInstructionDataArgs = { verifyArgs: VerifyArgsArgs }; -export function getVerifyInstructionDataEncoder() { +export function getVerifyInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number; verifyArgs: VerifyArgsArgs }>([ + getStructEncoder([ ['discriminator', getU8Encoder()], ['verifyArgs', getVerifyArgsEncoder()], ]), (value) => ({ ...value, discriminator: 47 }) - ) satisfies Encoder; + ); } -export function getVerifyInstructionDataDecoder() { - return getStructDecoder([ +export function getVerifyInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getU8Decoder()], ['verifyArgs', getVerifyArgsDecoder()], - ]) satisfies Decoder; + ]); } export function getVerifyInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/verifyCollection.ts b/test/packages/js-experimental/src/generated/instructions/verifyCollection.ts index b3004f1b4..53f8a445d 100644 --- a/test/packages/js-experimental/src/generated/instructions/verifyCollection.ts +++ b/test/packages/js-experimental/src/generated/instructions/verifyCollection.ts @@ -116,19 +116,15 @@ export type VerifyCollectionInstructionData = { discriminator: number }; export type VerifyCollectionInstructionDataArgs = {}; -export function getVerifyCollectionInstructionDataEncoder() { +export function getVerifyCollectionInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 18 }) - ) satisfies Encoder; + ); } -export function getVerifyCollectionInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getVerifyCollectionInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getVerifyCollectionInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/verifySizedCollectionItem.ts b/test/packages/js-experimental/src/generated/instructions/verifySizedCollectionItem.ts index d14390222..febdec0da 100644 --- a/test/packages/js-experimental/src/generated/instructions/verifySizedCollectionItem.ts +++ b/test/packages/js-experimental/src/generated/instructions/verifySizedCollectionItem.ts @@ -131,19 +131,15 @@ export type VerifySizedCollectionItemInstructionData = { export type VerifySizedCollectionItemInstructionDataArgs = {}; -export function getVerifySizedCollectionItemInstructionDataEncoder() { +export function getVerifySizedCollectionItemInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 30 }) - ) satisfies Encoder; + ); } -export function getVerifySizedCollectionItemInstructionDataDecoder() { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) satisfies Decoder; +export function getVerifySizedCollectionItemInstructionDataDecoder(): Decoder { + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getVerifySizedCollectionItemInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/instructions/withdraw.ts b/test/packages/js-experimental/src/generated/instructions/withdraw.ts index f70df0ed5..677e019ae 100644 --- a/test/packages/js-experimental/src/generated/instructions/withdraw.ts +++ b/test/packages/js-experimental/src/generated/instructions/withdraw.ts @@ -80,22 +80,22 @@ export type WithdrawInstructionData = { discriminator: Array }; export type WithdrawInstructionDataArgs = {}; -export function getWithdrawInstructionDataEncoder() { +export function getWithdrawInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: Array }>([ + getStructEncoder([ ['discriminator', getArrayEncoder(getU8Encoder(), { size: 8 })], ]), (value) => ({ ...value, discriminator: [183, 18, 70, 156, 148, 109, 161, 34], }) - ) satisfies Encoder; + ); } -export function getWithdrawInstructionDataDecoder() { - return getStructDecoder([ +export function getWithdrawInstructionDataDecoder(): Decoder { + return getStructDecoder([ ['discriminator', getArrayDecoder(getU8Decoder(), { size: 8 })], - ]) satisfies Decoder; + ]); } export function getWithdrawInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/assetData.ts b/test/packages/js-experimental/src/generated/types/assetData.ts index 7f31d2305..f6f787ec7 100644 --- a/test/packages/js-experimental/src/generated/types/assetData.ts +++ b/test/packages/js-experimental/src/generated/types/assetData.ts @@ -100,8 +100,8 @@ export type AssetDataArgs = { delegateState: OptionOrNullable; }; -export function getAssetDataEncoder() { - return getStructEncoder([ +export function getAssetDataEncoder(): Encoder { + return getStructEncoder([ ['updateAuthority', getAddressEncoder()], ['name', getStringEncoder()], ['symbol', getStringEncoder()], @@ -117,11 +117,11 @@ export function getAssetDataEncoder() { ['collectionDetails', getOptionEncoder(getCollectionDetailsEncoder())], ['programmableConfig', getOptionEncoder(getProgrammableConfigEncoder())], ['delegateState', getOptionEncoder(getDelegateStateEncoder())], - ]) satisfies Encoder; + ]); } -export function getAssetDataDecoder() { - return getStructDecoder([ +export function getAssetDataDecoder(): Decoder { + return getStructDecoder([ ['updateAuthority', getAddressDecoder()], ['name', getStringDecoder()], ['symbol', getStringDecoder()], @@ -137,7 +137,7 @@ export function getAssetDataDecoder() { ['collectionDetails', getOptionDecoder(getCollectionDetailsDecoder())], ['programmableConfig', getOptionDecoder(getProgrammableConfigDecoder())], ['delegateState', getOptionDecoder(getDelegateStateDecoder())], - ]) satisfies Decoder; + ]); } export function getAssetDataCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/authorityType.ts b/test/packages/js-experimental/src/generated/types/authorityType.ts index 27085b04f..54b98ee46 100644 --- a/test/packages/js-experimental/src/generated/types/authorityType.ts +++ b/test/packages/js-experimental/src/generated/types/authorityType.ts @@ -21,14 +21,12 @@ export enum AuthorityType { export type AuthorityTypeArgs = AuthorityType; -export function getAuthorityTypeEncoder() { - return getScalarEnumEncoder( - AuthorityType - ) satisfies Encoder; +export function getAuthorityTypeEncoder(): Encoder { + return getScalarEnumEncoder(AuthorityType); } -export function getAuthorityTypeDecoder() { - return getScalarEnumDecoder(AuthorityType) satisfies Decoder; +export function getAuthorityTypeDecoder(): Decoder { + return getScalarEnumDecoder(AuthorityType); } export function getAuthorityTypeCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/authorizationData.ts b/test/packages/js-experimental/src/generated/types/authorizationData.ts index 8528eb10a..6e795582e 100644 --- a/test/packages/js-experimental/src/generated/types/authorizationData.ts +++ b/test/packages/js-experimental/src/generated/types/authorizationData.ts @@ -17,16 +17,12 @@ export type AuthorizationData = { payload: Payload }; export type AuthorizationDataArgs = { payload: PayloadArgs }; -export function getAuthorizationDataEncoder() { - return getStructEncoder([ - ['payload', getPayloadEncoder()], - ]) satisfies Encoder; +export function getAuthorizationDataEncoder(): Encoder { + return getStructEncoder([['payload', getPayloadEncoder()]]); } -export function getAuthorizationDataDecoder() { - return getStructDecoder([ - ['payload', getPayloadDecoder()], - ]) satisfies Decoder; +export function getAuthorizationDataDecoder(): Decoder { + return getStructDecoder([['payload', getPayloadDecoder()]]); } export function getAuthorizationDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/burnArgs.ts b/test/packages/js-experimental/src/generated/types/burnArgs.ts index eb2b51ad2..d71bfdfd3 100644 --- a/test/packages/js-experimental/src/generated/types/burnArgs.ts +++ b/test/packages/js-experimental/src/generated/types/burnArgs.ts @@ -19,16 +19,12 @@ export enum BurnArgs { export type BurnArgsArgs = BurnArgs; -export function getBurnArgsEncoder() { - return getScalarEnumEncoder(BurnArgs, { - size: getU64Encoder(), - }) satisfies Encoder; +export function getBurnArgsEncoder(): Encoder { + return getScalarEnumEncoder(BurnArgs, { size: getU64Encoder() }); } -export function getBurnArgsDecoder() { - return getScalarEnumDecoder(BurnArgs, { - size: getU64Decoder(), - }) satisfies Decoder; +export function getBurnArgsDecoder(): Decoder { + return getScalarEnumDecoder(BurnArgs, { size: getU64Decoder() }); } export function getBurnArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/candyMachineData.ts b/test/packages/js-experimental/src/generated/types/candyMachineData.ts index 2f626b517..b010b05e2 100644 --- a/test/packages/js-experimental/src/generated/types/candyMachineData.ts +++ b/test/packages/js-experimental/src/generated/types/candyMachineData.ts @@ -82,8 +82,8 @@ export type CandyMachineDataArgs = { hiddenSettings: OptionOrNullable; }; -export function getCandyMachineDataEncoder() { - return getStructEncoder([ +export function getCandyMachineDataEncoder(): Encoder { + return getStructEncoder([ ['itemsAvailable', getU64Encoder()], ['symbol', getStringEncoder()], ['sellerFeeBasisPoints', getU16Encoder()], @@ -92,11 +92,11 @@ export function getCandyMachineDataEncoder() { ['creators', getArrayEncoder(getCmCreatorEncoder())], ['configLineSettings', getOptionEncoder(getConfigLineSettingsEncoder())], ['hiddenSettings', getOptionEncoder(getHiddenSettingsEncoder())], - ]) satisfies Encoder; + ]); } -export function getCandyMachineDataDecoder() { - return getStructDecoder([ +export function getCandyMachineDataDecoder(): Decoder { + return getStructDecoder([ ['itemsAvailable', getU64Decoder()], ['symbol', getStringDecoder()], ['sellerFeeBasisPoints', getU16Decoder()], @@ -105,7 +105,7 @@ export function getCandyMachineDataDecoder() { ['creators', getArrayDecoder(getCmCreatorDecoder())], ['configLineSettings', getOptionDecoder(getConfigLineSettingsDecoder())], ['hiddenSettings', getOptionDecoder(getHiddenSettingsDecoder())], - ]) satisfies Decoder; + ]); } export function getCandyMachineDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/cmCreator.ts b/test/packages/js-experimental/src/generated/types/cmCreator.ts index b828fbd6f..bc1376b0b 100644 --- a/test/packages/js-experimental/src/generated/types/cmCreator.ts +++ b/test/packages/js-experimental/src/generated/types/cmCreator.ts @@ -30,20 +30,20 @@ export type CmCreator = { export type CmCreatorArgs = CmCreator; -export function getCmCreatorEncoder() { - return getStructEncoder([ +export function getCmCreatorEncoder(): Encoder { + return getStructEncoder([ ['address', getAddressEncoder()], ['verified', getBooleanEncoder()], ['percentageShare', getU8Encoder()], - ]) satisfies Encoder; + ]); } -export function getCmCreatorDecoder() { - return getStructDecoder([ +export function getCmCreatorDecoder(): Decoder { + return getStructDecoder([ ['address', getAddressDecoder()], ['verified', getBooleanDecoder()], ['percentageShare', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getCmCreatorCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/collection.ts b/test/packages/js-experimental/src/generated/types/collection.ts index 400377395..fd454993c 100644 --- a/test/packages/js-experimental/src/generated/types/collection.ts +++ b/test/packages/js-experimental/src/generated/types/collection.ts @@ -29,21 +29,21 @@ export type Collection = { verified: boolean; key: Address }; export type CollectionArgs = { verified?: boolean; key: Address }; -export function getCollectionEncoder() { +export function getCollectionEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ verified: boolean; key: Address }>([ + getStructEncoder([ ['verified', getBooleanEncoder()], ['key', getAddressEncoder()], ]), (value) => ({ ...value, verified: value.verified ?? false }) - ) satisfies Encoder; + ); } -export function getCollectionDecoder() { - return getStructDecoder([ +export function getCollectionDecoder(): Decoder { + return getStructDecoder([ ['verified', getBooleanDecoder()], ['key', getAddressDecoder()], - ]) satisfies Decoder; + ]); } export function getCollectionCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/collectionDetails.ts b/test/packages/js-experimental/src/generated/types/collectionDetails.ts index f22302bb1..66476e48c 100644 --- a/test/packages/js-experimental/src/generated/types/collectionDetails.ts +++ b/test/packages/js-experimental/src/generated/types/collectionDetails.ts @@ -21,26 +21,16 @@ export type CollectionDetails = { __kind: 'V1'; size: bigint }; export type CollectionDetailsArgs = { __kind: 'V1'; size: number | bigint }; -export function getCollectionDetailsEncoder() { - return getDataEnumEncoder([ - [ - 'V1', - getStructEncoder>([ - ['size', getU64Encoder()], - ]), - ], - ]) satisfies Encoder; +export function getCollectionDetailsEncoder(): Encoder { + return getDataEnumEncoder([ + ['V1', getStructEncoder([['size', getU64Encoder()]])], + ]); } -export function getCollectionDetailsDecoder() { - return getDataEnumDecoder([ - [ - 'V1', - getStructDecoder>([ - ['size', getU64Decoder()], - ]), - ], - ]) satisfies Decoder; +export function getCollectionDetailsDecoder(): Decoder { + return getDataEnumDecoder([ + ['V1', getStructDecoder([['size', getU64Decoder()]])], + ]); } export function getCollectionDetailsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/configLine.ts b/test/packages/js-experimental/src/generated/types/configLine.ts index 59ba10eb2..ae32b07f4 100644 --- a/test/packages/js-experimental/src/generated/types/configLine.ts +++ b/test/packages/js-experimental/src/generated/types/configLine.ts @@ -23,18 +23,18 @@ export type ConfigLine = { export type ConfigLineArgs = ConfigLine; -export function getConfigLineEncoder() { - return getStructEncoder([ +export function getConfigLineEncoder(): Encoder { + return getStructEncoder([ ['name', getStringEncoder()], ['uri', getStringEncoder()], - ]) satisfies Encoder; + ]); } -export function getConfigLineDecoder() { - return getStructDecoder([ +export function getConfigLineDecoder(): Decoder { + return getStructDecoder([ ['name', getStringDecoder()], ['uri', getStringDecoder()], - ]) satisfies Decoder; + ]); } export function getConfigLineCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/configLineSettings.ts b/test/packages/js-experimental/src/generated/types/configLineSettings.ts index ce084249f..a5e51d4d9 100644 --- a/test/packages/js-experimental/src/generated/types/configLineSettings.ts +++ b/test/packages/js-experimental/src/generated/types/configLineSettings.ts @@ -32,24 +32,24 @@ export type ConfigLineSettings = { export type ConfigLineSettingsArgs = ConfigLineSettings; -export function getConfigLineSettingsEncoder() { - return getStructEncoder([ +export function getConfigLineSettingsEncoder(): Encoder { + return getStructEncoder([ ['prefixName', getStringEncoder()], ['nameLength', getU32Encoder()], ['prefixUri', getStringEncoder()], ['uriLength', getU32Encoder()], ['isSequential', getBooleanEncoder()], - ]) satisfies Encoder; + ]); } -export function getConfigLineSettingsDecoder() { - return getStructDecoder([ +export function getConfigLineSettingsDecoder(): Decoder { + return getStructDecoder([ ['prefixName', getStringDecoder()], ['nameLength', getU32Decoder()], ['prefixUri', getStringDecoder()], ['uriLength', getU32Decoder()], ['isSequential', getBooleanDecoder()], - ]) satisfies Decoder; + ]); } export function getConfigLineSettingsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/createMasterEditionArgs.ts b/test/packages/js-experimental/src/generated/types/createMasterEditionArgs.ts index ceee52e29..875cd56d4 100644 --- a/test/packages/js-experimental/src/generated/types/createMasterEditionArgs.ts +++ b/test/packages/js-experimental/src/generated/types/createMasterEditionArgs.ts @@ -25,16 +25,12 @@ export type CreateMasterEditionArgsArgs = { maxSupply: OptionOrNullable; }; -export function getCreateMasterEditionArgsEncoder() { - return getStructEncoder([ - ['maxSupply', getOptionEncoder(getU64Encoder())], - ]) satisfies Encoder; +export function getCreateMasterEditionArgsEncoder(): Encoder { + return getStructEncoder([['maxSupply', getOptionEncoder(getU64Encoder())]]); } -export function getCreateMasterEditionArgsDecoder() { - return getStructDecoder([ - ['maxSupply', getOptionDecoder(getU64Decoder())], - ]) satisfies Decoder; +export function getCreateMasterEditionArgsDecoder(): Decoder { + return getStructDecoder([['maxSupply', getOptionDecoder(getU64Decoder())]]); } export function getCreateMasterEditionArgsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/creator.ts b/test/packages/js-experimental/src/generated/types/creator.ts index ba61c1834..68744a05a 100644 --- a/test/packages/js-experimental/src/generated/types/creator.ts +++ b/test/packages/js-experimental/src/generated/types/creator.ts @@ -24,20 +24,20 @@ export type Creator = { address: Address; verified: boolean; share: number }; export type CreatorArgs = Creator; -export function getCreatorEncoder() { - return getStructEncoder([ +export function getCreatorEncoder(): Encoder { + return getStructEncoder([ ['address', getAddressEncoder()], ['verified', getBooleanEncoder()], ['share', getU8Encoder()], - ]) satisfies Encoder; + ]); } -export function getCreatorDecoder() { - return getStructDecoder([ +export function getCreatorDecoder(): Decoder { + return getStructDecoder([ ['address', getAddressDecoder()], ['verified', getBooleanDecoder()], ['share', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getCreatorCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/dataV2.ts b/test/packages/js-experimental/src/generated/types/dataV2.ts index 798789652..74dbd6d8d 100644 --- a/test/packages/js-experimental/src/generated/types/dataV2.ts +++ b/test/packages/js-experimental/src/generated/types/dataV2.ts @@ -56,8 +56,8 @@ export type DataV2Args = { uses: OptionOrNullable; }; -export function getDataV2Encoder() { - return getStructEncoder([ +export function getDataV2Encoder(): Encoder { + return getStructEncoder([ ['name', getStringEncoder()], ['symbol', getStringEncoder()], ['uri', getStringEncoder()], @@ -65,11 +65,11 @@ export function getDataV2Encoder() { ['creators', getOptionEncoder(getArrayEncoder(getCreatorEncoder()))], ['collection', getOptionEncoder(getCollectionEncoder())], ['uses', getOptionEncoder(getUsesEncoder())], - ]) satisfies Encoder; + ]); } -export function getDataV2Decoder() { - return getStructDecoder([ +export function getDataV2Decoder(): Decoder { + return getStructDecoder([ ['name', getStringDecoder()], ['symbol', getStringDecoder()], ['uri', getStringDecoder()], @@ -77,7 +77,7 @@ export function getDataV2Decoder() { ['creators', getOptionDecoder(getArrayDecoder(getCreatorDecoder()))], ['collection', getOptionDecoder(getCollectionDecoder())], ['uses', getOptionDecoder(getUsesDecoder())], - ]) satisfies Decoder; + ]); } export function getDataV2Codec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/delegateArgs.ts b/test/packages/js-experimental/src/generated/types/delegateArgs.ts index 2d121368a..dc16df171 100644 --- a/test/packages/js-experimental/src/generated/types/delegateArgs.ts +++ b/test/packages/js-experimental/src/generated/types/delegateArgs.ts @@ -29,40 +29,20 @@ export type DelegateArgsArgs = | { __kind: 'SaleV1'; amount: number | bigint } | { __kind: 'TransferV1'; amount: number | bigint }; -export function getDelegateArgsEncoder() { - return getDataEnumEncoder([ +export function getDelegateArgsEncoder(): Encoder { + return getDataEnumEncoder([ ['CollectionV1', getUnitEncoder()], - [ - 'SaleV1', - getStructEncoder>([ - ['amount', getU64Encoder()], - ]), - ], - [ - 'TransferV1', - getStructEncoder>([ - ['amount', getU64Encoder()], - ]), - ], - ]) satisfies Encoder; + ['SaleV1', getStructEncoder([['amount', getU64Encoder()]])], + ['TransferV1', getStructEncoder([['amount', getU64Encoder()]])], + ]); } -export function getDelegateArgsDecoder() { - return getDataEnumDecoder([ +export function getDelegateArgsDecoder(): Decoder { + return getDataEnumDecoder([ ['CollectionV1', getUnitDecoder()], - [ - 'SaleV1', - getStructDecoder>([ - ['amount', getU64Decoder()], - ]), - ], - [ - 'TransferV1', - getStructDecoder>([ - ['amount', getU64Decoder()], - ]), - ], - ]) satisfies Decoder; + ['SaleV1', getStructDecoder([['amount', getU64Decoder()]])], + ['TransferV1', getStructDecoder([['amount', getU64Decoder()]])], + ]); } export function getDelegateArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/delegateRole.ts b/test/packages/js-experimental/src/generated/types/delegateRole.ts index 544b4c246..acd6884cd 100644 --- a/test/packages/js-experimental/src/generated/types/delegateRole.ts +++ b/test/packages/js-experimental/src/generated/types/delegateRole.ts @@ -24,12 +24,12 @@ export enum DelegateRole { export type DelegateRoleArgs = DelegateRole; -export function getDelegateRoleEncoder() { - return getScalarEnumEncoder(DelegateRole) satisfies Encoder; +export function getDelegateRoleEncoder(): Encoder { + return getScalarEnumEncoder(DelegateRole); } -export function getDelegateRoleDecoder() { - return getScalarEnumDecoder(DelegateRole) satisfies Decoder; +export function getDelegateRoleDecoder(): Decoder { + return getScalarEnumDecoder(DelegateRole); } export function getDelegateRoleCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/delegateState.ts b/test/packages/js-experimental/src/generated/types/delegateState.ts index 0fab7bd25..3464b0d45 100644 --- a/test/packages/js-experimental/src/generated/types/delegateState.ts +++ b/test/packages/js-experimental/src/generated/types/delegateState.ts @@ -37,20 +37,20 @@ export type DelegateStateArgs = { hasData: boolean; }; -export function getDelegateStateEncoder() { - return getStructEncoder([ +export function getDelegateStateEncoder(): Encoder { + return getStructEncoder([ ['role', getDelegateRoleEncoder()], ['delegate', getAddressEncoder()], ['hasData', getBooleanEncoder()], - ]) satisfies Encoder; + ]); } -export function getDelegateStateDecoder() { - return getStructDecoder([ +export function getDelegateStateDecoder(): Decoder { + return getStructDecoder([ ['role', getDelegateRoleDecoder()], ['delegate', getAddressDecoder()], ['hasData', getBooleanDecoder()], - ]) satisfies Decoder; + ]); } export function getDelegateStateCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/dummyLines.ts b/test/packages/js-experimental/src/generated/types/dummyLines.ts index f793c90ae..6d31bd348 100644 --- a/test/packages/js-experimental/src/generated/types/dummyLines.ts +++ b/test/packages/js-experimental/src/generated/types/dummyLines.ts @@ -26,16 +26,16 @@ export type DummyLinesArgs = { lines: Array; }; -export function getDummyLinesEncoder() { - return getStructEncoder([ +export function getDummyLinesEncoder(): Encoder { + return getStructEncoder([ ['lines', getArrayEncoder(getU64Encoder(), { size: 'remainder' })], - ]) satisfies Encoder; + ]); } -export function getDummyLinesDecoder() { - return getStructDecoder([ +export function getDummyLinesDecoder(): Decoder { + return getStructDecoder([ ['lines', getArrayDecoder(getU64Decoder(), { size: 'remainder' })], - ]) satisfies Decoder; + ]); } export function getDummyLinesCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/escrowAuthority.ts b/test/packages/js-experimental/src/generated/types/escrowAuthority.ts index ed217e781..a2b126caf 100644 --- a/test/packages/js-experimental/src/generated/types/escrowAuthority.ts +++ b/test/packages/js-experimental/src/generated/types/escrowAuthority.ts @@ -31,28 +31,24 @@ export type EscrowAuthority = export type EscrowAuthorityArgs = EscrowAuthority; -export function getEscrowAuthorityEncoder() { - return getDataEnumEncoder([ +export function getEscrowAuthorityEncoder(): Encoder { + return getDataEnumEncoder([ ['TokenOwner', getUnitEncoder()], [ 'Creator', - getStructEncoder>([ - ['fields', getTupleEncoder([getAddressEncoder()])], - ]), + getStructEncoder([['fields', getTupleEncoder([getAddressEncoder()])]]), ], - ]) satisfies Encoder; + ]); } -export function getEscrowAuthorityDecoder() { - return getDataEnumDecoder([ +export function getEscrowAuthorityDecoder(): Decoder { + return getDataEnumDecoder([ ['TokenOwner', getUnitDecoder()], [ 'Creator', - getStructDecoder>([ - ['fields', getTupleDecoder([getAddressDecoder()])], - ]), + getStructDecoder([['fields', getTupleDecoder([getAddressDecoder()])]]), ], - ]) satisfies Decoder; + ]); } export function getEscrowAuthorityCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/extendedPayload.ts b/test/packages/js-experimental/src/generated/types/extendedPayload.ts index 10cde8700..cb59e76c6 100644 --- a/test/packages/js-experimental/src/generated/types/extendedPayload.ts +++ b/test/packages/js-experimental/src/generated/types/extendedPayload.ts @@ -38,18 +38,18 @@ export type ExtendedPayloadArgs = { args: [number, string]; }; -export function getExtendedPayloadEncoder() { - return getStructEncoder([ +export function getExtendedPayloadEncoder(): Encoder { + return getStructEncoder([ ['map', getMapEncoder(getPayloadKeyEncoder(), getPayloadTypeEncoder())], ['args', getTupleEncoder([getU8Encoder(), getStringEncoder()])], - ]) satisfies Encoder; + ]); } -export function getExtendedPayloadDecoder() { - return getStructDecoder([ +export function getExtendedPayloadDecoder(): Decoder { + return getStructDecoder([ ['map', getMapDecoder(getPayloadKeyDecoder(), getPayloadTypeDecoder())], ['args', getTupleDecoder([getU8Decoder(), getStringDecoder()])], - ]) satisfies Decoder; + ]); } export function getExtendedPayloadCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/hiddenSettings.ts b/test/packages/js-experimental/src/generated/types/hiddenSettings.ts index 4a3f31aff..16f14a7ee 100644 --- a/test/packages/js-experimental/src/generated/types/hiddenSettings.ts +++ b/test/packages/js-experimental/src/generated/types/hiddenSettings.ts @@ -27,20 +27,20 @@ export type HiddenSettings = { export type HiddenSettingsArgs = HiddenSettings; -export function getHiddenSettingsEncoder() { - return getStructEncoder([ +export function getHiddenSettingsEncoder(): Encoder { + return getStructEncoder([ ['name', getStringEncoder()], ['uri', getStringEncoder()], ['hash', getBytesEncoder({ size: 64 })], - ]) satisfies Encoder; + ]); } -export function getHiddenSettingsDecoder() { - return getStructDecoder([ +export function getHiddenSettingsDecoder(): Decoder { + return getStructDecoder([ ['name', getStringDecoder()], ['uri', getStringDecoder()], ['hash', getBytesDecoder({ size: 64 })], - ]) satisfies Decoder; + ]); } export function getHiddenSettingsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/migrateArgs.ts b/test/packages/js-experimental/src/generated/types/migrateArgs.ts index cb91e0580..f30d0f776 100644 --- a/test/packages/js-experimental/src/generated/types/migrateArgs.ts +++ b/test/packages/js-experimental/src/generated/types/migrateArgs.ts @@ -18,12 +18,12 @@ export enum MigrateArgs { export type MigrateArgsArgs = MigrateArgs; -export function getMigrateArgsEncoder() { - return getScalarEnumEncoder(MigrateArgs) satisfies Encoder; +export function getMigrateArgsEncoder(): Encoder { + return getScalarEnumEncoder(MigrateArgs); } -export function getMigrateArgsDecoder() { - return getScalarEnumDecoder(MigrateArgs) satisfies Decoder; +export function getMigrateArgsDecoder(): Decoder { + return getScalarEnumDecoder(MigrateArgs); } export function getMigrateArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/mintArgs.ts b/test/packages/js-experimental/src/generated/types/mintArgs.ts index 0f9d14ea3..4d9bbf444 100644 --- a/test/packages/js-experimental/src/generated/types/mintArgs.ts +++ b/test/packages/js-experimental/src/generated/types/mintArgs.ts @@ -41,28 +41,28 @@ export type MintArgsArgs = { authorizationData: OptionOrNullable; }; -export function getMintArgsEncoder() { - return getDataEnumEncoder([ +export function getMintArgsEncoder(): Encoder { + return getDataEnumEncoder([ [ 'V1', - getStructEncoder>([ + getStructEncoder([ ['amount', getU64Encoder()], ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())], ]), ], - ]) satisfies Encoder; + ]); } -export function getMintArgsDecoder() { - return getDataEnumDecoder([ +export function getMintArgsDecoder(): Decoder { + return getDataEnumDecoder([ [ 'V1', - getStructDecoder>([ + getStructDecoder([ ['amount', getU64Decoder()], ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())], ]), ], - ]) satisfies Decoder; + ]); } export function getMintArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/mintNewEditionFromMasterEditionViaTokenArgs.ts b/test/packages/js-experimental/src/generated/types/mintNewEditionFromMasterEditionViaTokenArgs.ts index 2268bfa0b..2e62bdfc1 100644 --- a/test/packages/js-experimental/src/generated/types/mintNewEditionFromMasterEditionViaTokenArgs.ts +++ b/test/packages/js-experimental/src/generated/types/mintNewEditionFromMasterEditionViaTokenArgs.ts @@ -19,16 +19,12 @@ export type MintNewEditionFromMasterEditionViaTokenArgsArgs = { edition: number | bigint; }; -export function getMintNewEditionFromMasterEditionViaTokenArgsEncoder() { - return getStructEncoder([ - ['edition', getU64Encoder()], - ]) satisfies Encoder; +export function getMintNewEditionFromMasterEditionViaTokenArgsEncoder(): Encoder { + return getStructEncoder([['edition', getU64Encoder()]]); } -export function getMintNewEditionFromMasterEditionViaTokenArgsDecoder() { - return getStructDecoder([ - ['edition', getU64Decoder()], - ]) satisfies Decoder; +export function getMintNewEditionFromMasterEditionViaTokenArgsDecoder(): Decoder { + return getStructDecoder([['edition', getU64Decoder()]]); } export function getMintNewEditionFromMasterEditionViaTokenArgsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/mintPrintingTokensViaTokenArgs.ts b/test/packages/js-experimental/src/generated/types/mintPrintingTokensViaTokenArgs.ts index 6862049e3..f21b691a5 100644 --- a/test/packages/js-experimental/src/generated/types/mintPrintingTokensViaTokenArgs.ts +++ b/test/packages/js-experimental/src/generated/types/mintPrintingTokensViaTokenArgs.ts @@ -17,16 +17,12 @@ export type MintPrintingTokensViaTokenArgs = { supply: bigint }; export type MintPrintingTokensViaTokenArgsArgs = { supply: number | bigint }; -export function getMintPrintingTokensViaTokenArgsEncoder() { - return getStructEncoder([ - ['supply', getU64Encoder()], - ]) satisfies Encoder; +export function getMintPrintingTokensViaTokenArgsEncoder(): Encoder { + return getStructEncoder([['supply', getU64Encoder()]]); } -export function getMintPrintingTokensViaTokenArgsDecoder() { - return getStructDecoder([ - ['supply', getU64Decoder()], - ]) satisfies Decoder; +export function getMintPrintingTokensViaTokenArgsDecoder(): Decoder { + return getStructDecoder([['supply', getU64Decoder()]]); } export function getMintPrintingTokensViaTokenArgsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/operation.ts b/test/packages/js-experimental/src/generated/types/operation.ts index d1065351f..03626061e 100644 --- a/test/packages/js-experimental/src/generated/types/operation.ts +++ b/test/packages/js-experimental/src/generated/types/operation.ts @@ -21,12 +21,12 @@ export enum Operation { export type OperationArgs = Operation; -export function getOperationEncoder() { - return getScalarEnumEncoder(Operation) satisfies Encoder; +export function getOperationEncoder(): Encoder { + return getScalarEnumEncoder(Operation); } -export function getOperationDecoder() { - return getScalarEnumDecoder(Operation) satisfies Decoder; +export function getOperationDecoder(): Decoder { + return getScalarEnumDecoder(Operation); } export function getOperationCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/payload.ts b/test/packages/js-experimental/src/generated/types/payload.ts index 0a6adc3a0..81172336a 100644 --- a/test/packages/js-experimental/src/generated/types/payload.ts +++ b/test/packages/js-experimental/src/generated/types/payload.ts @@ -28,16 +28,16 @@ export type Payload = { map: Map }; export type PayloadArgs = { map: Map }; -export function getPayloadEncoder() { - return getStructEncoder([ +export function getPayloadEncoder(): Encoder { + return getStructEncoder([ ['map', getMapEncoder(getPayloadKeyEncoder(), getPayloadTypeEncoder())], - ]) satisfies Encoder; + ]); } -export function getPayloadDecoder() { - return getStructDecoder([ +export function getPayloadDecoder(): Decoder { + return getStructDecoder([ ['map', getMapDecoder(getPayloadKeyDecoder(), getPayloadTypeDecoder())], - ]) satisfies Decoder; + ]); } export function getPayloadCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/payloadKey.ts b/test/packages/js-experimental/src/generated/types/payloadKey.ts index 6580698c5..a390c2c9b 100644 --- a/test/packages/js-experimental/src/generated/types/payloadKey.ts +++ b/test/packages/js-experimental/src/generated/types/payloadKey.ts @@ -21,12 +21,12 @@ export enum PayloadKey { export type PayloadKeyArgs = PayloadKey; -export function getPayloadKeyEncoder() { - return getScalarEnumEncoder(PayloadKey) satisfies Encoder; +export function getPayloadKeyEncoder(): Encoder { + return getScalarEnumEncoder(PayloadKey); } -export function getPayloadKeyDecoder() { - return getScalarEnumDecoder(PayloadKey) satisfies Decoder; +export function getPayloadKeyDecoder(): Decoder { + return getScalarEnumDecoder(PayloadKey); } export function getPayloadKeyCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/payloadType.ts b/test/packages/js-experimental/src/generated/types/payloadType.ts index 173ed355d..6733b9f34 100644 --- a/test/packages/js-experimental/src/generated/types/payloadType.ts +++ b/test/packages/js-experimental/src/generated/types/payloadType.ts @@ -46,64 +46,56 @@ export type PayloadTypeArgs = | { __kind: 'MerkleProof'; leaf: Uint8Array; proof: Array } | { __kind: 'Number'; fields: [number | bigint] }; -export function getPayloadTypeEncoder() { - return getDataEnumEncoder([ +export function getPayloadTypeEncoder(): Encoder { + return getDataEnumEncoder([ [ 'Pubkey', - getStructEncoder>([ - ['fields', getTupleEncoder([getAddressEncoder()])], - ]), + getStructEncoder([['fields', getTupleEncoder([getAddressEncoder()])]]), ], [ 'Seeds', - getStructEncoder>([ + getStructEncoder([ ['seeds', getArrayEncoder(getBytesEncoder({ size: getU32Encoder() }))], ]), ], [ 'MerkleProof', - getStructEncoder>([ + getStructEncoder([ ['leaf', getBytesEncoder({ size: 32 })], ['proof', getArrayEncoder(getBytesEncoder({ size: 32 }))], ]), ], [ 'Number', - getStructEncoder>([ - ['fields', getTupleEncoder([getU64Encoder()])], - ]), + getStructEncoder([['fields', getTupleEncoder([getU64Encoder()])]]), ], - ]) satisfies Encoder; + ]); } -export function getPayloadTypeDecoder() { - return getDataEnumDecoder([ +export function getPayloadTypeDecoder(): Decoder { + return getDataEnumDecoder([ [ 'Pubkey', - getStructDecoder>([ - ['fields', getTupleDecoder([getAddressDecoder()])], - ]), + getStructDecoder([['fields', getTupleDecoder([getAddressDecoder()])]]), ], [ 'Seeds', - getStructDecoder>([ + getStructDecoder([ ['seeds', getArrayDecoder(getBytesDecoder({ size: getU32Decoder() }))], ]), ], [ 'MerkleProof', - getStructDecoder>([ + getStructDecoder([ ['leaf', getBytesDecoder({ size: 32 })], ['proof', getArrayDecoder(getBytesDecoder({ size: 32 }))], ]), ], [ 'Number', - getStructDecoder>([ - ['fields', getTupleDecoder([getU64Decoder()])], - ]), + getStructDecoder([['fields', getTupleDecoder([getU64Decoder()])]]), ], - ]) satisfies Decoder; + ]); } export function getPayloadTypeCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/programmableConfig.ts b/test/packages/js-experimental/src/generated/types/programmableConfig.ts index 7fa6f9ee0..28b6b80eb 100644 --- a/test/packages/js-experimental/src/generated/types/programmableConfig.ts +++ b/test/packages/js-experimental/src/generated/types/programmableConfig.ts @@ -21,16 +21,12 @@ export type ProgrammableConfig = { ruleSet: Address }; export type ProgrammableConfigArgs = ProgrammableConfig; -export function getProgrammableConfigEncoder() { - return getStructEncoder([ - ['ruleSet', getAddressEncoder()], - ]) satisfies Encoder; +export function getProgrammableConfigEncoder(): Encoder { + return getStructEncoder([['ruleSet', getAddressEncoder()]]); } -export function getProgrammableConfigDecoder() { - return getStructDecoder([ - ['ruleSet', getAddressDecoder()], - ]) satisfies Decoder; +export function getProgrammableConfigDecoder(): Decoder { + return getStructDecoder([['ruleSet', getAddressDecoder()]]); } export function getProgrammableConfigCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/reservation.ts b/test/packages/js-experimental/src/generated/types/reservation.ts index 1b9183bba..f4e7584f2 100644 --- a/test/packages/js-experimental/src/generated/types/reservation.ts +++ b/test/packages/js-experimental/src/generated/types/reservation.ts @@ -30,20 +30,20 @@ export type ReservationArgs = { totalSpots: number | bigint; }; -export function getReservationEncoder() { - return getStructEncoder([ +export function getReservationEncoder(): Encoder { + return getStructEncoder([ ['address', getAddressEncoder()], ['spotsRemaining', getU64Encoder()], ['totalSpots', getU64Encoder()], - ]) satisfies Encoder; + ]); } -export function getReservationDecoder() { - return getStructDecoder([ +export function getReservationDecoder(): Decoder { + return getStructDecoder([ ['address', getAddressDecoder()], ['spotsRemaining', getU64Decoder()], ['totalSpots', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getReservationCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/reservationListV1AccountData.ts b/test/packages/js-experimental/src/generated/types/reservationListV1AccountData.ts index f3d73d4fd..9f0be4552 100644 --- a/test/packages/js-experimental/src/generated/types/reservationListV1AccountData.ts +++ b/test/packages/js-experimental/src/generated/types/reservationListV1AccountData.ts @@ -35,7 +35,6 @@ import { ReservationV1, ReservationV1Args, TmKey, - TmKeyArgs, getReservationV1Decoder, getReservationV1Encoder, getTmKeyDecoder, @@ -55,30 +54,25 @@ export type ReservationListV1AccountDataArgs = { reservations: Array; }; -export function getReservationListV1AccountDataEncoder() { +export function getReservationListV1AccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKeyArgs; - masterEdition: Address; - supplySnapshot: OptionOrNullable; - reservations: Array; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['masterEdition', getAddressEncoder()], ['supplySnapshot', getOptionEncoder(getU64Encoder())], ['reservations', getArrayEncoder(getReservationV1Encoder())], ]), (value) => ({ ...value, key: TmKey.ReservationListV1 }) - ) satisfies Encoder; + ); } -export function getReservationListV1AccountDataDecoder() { - return getStructDecoder([ +export function getReservationListV1AccountDataDecoder(): Decoder { + return getStructDecoder([ ['key', getTmKeyDecoder()], ['masterEdition', getAddressDecoder()], ['supplySnapshot', getOptionDecoder(getU64Decoder())], ['reservations', getArrayDecoder(getReservationV1Decoder())], - ]) satisfies Decoder; + ]); } export function getReservationListV1AccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/reservationV1.ts b/test/packages/js-experimental/src/generated/types/reservationV1.ts index c84782460..951b79e55 100644 --- a/test/packages/js-experimental/src/generated/types/reservationV1.ts +++ b/test/packages/js-experimental/src/generated/types/reservationV1.ts @@ -26,20 +26,20 @@ export type ReservationV1 = { export type ReservationV1Args = ReservationV1; -export function getReservationV1Encoder() { - return getStructEncoder([ +export function getReservationV1Encoder(): Encoder { + return getStructEncoder([ ['address', getAddressEncoder()], ['spotsRemaining', getU8Encoder()], ['totalSpots', getU8Encoder()], - ]) satisfies Encoder; + ]); } -export function getReservationV1Decoder() { - return getStructDecoder([ +export function getReservationV1Decoder(): Decoder { + return getStructDecoder([ ['address', getAddressDecoder()], ['spotsRemaining', getU8Decoder()], ['totalSpots', getU8Decoder()], - ]) satisfies Decoder; + ]); } export function getReservationV1Codec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/revokeArgs.ts b/test/packages/js-experimental/src/generated/types/revokeArgs.ts index f03bd8d69..080c71d81 100644 --- a/test/packages/js-experimental/src/generated/types/revokeArgs.ts +++ b/test/packages/js-experimental/src/generated/types/revokeArgs.ts @@ -20,12 +20,12 @@ export enum RevokeArgs { export type RevokeArgsArgs = RevokeArgs; -export function getRevokeArgsEncoder() { - return getScalarEnumEncoder(RevokeArgs) satisfies Encoder; +export function getRevokeArgsEncoder(): Encoder { + return getScalarEnumEncoder(RevokeArgs); } -export function getRevokeArgsDecoder() { - return getScalarEnumDecoder(RevokeArgs) satisfies Decoder; +export function getRevokeArgsDecoder(): Decoder { + return getScalarEnumDecoder(RevokeArgs); } export function getRevokeArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/setCollectionSizeArgs.ts b/test/packages/js-experimental/src/generated/types/setCollectionSizeArgs.ts index 702266752..71bc26b2f 100644 --- a/test/packages/js-experimental/src/generated/types/setCollectionSizeArgs.ts +++ b/test/packages/js-experimental/src/generated/types/setCollectionSizeArgs.ts @@ -17,16 +17,12 @@ export type SetCollectionSizeArgs = { size: bigint }; export type SetCollectionSizeArgsArgs = { size: number | bigint }; -export function getSetCollectionSizeArgsEncoder() { - return getStructEncoder([ - ['size', getU64Encoder()], - ]) satisfies Encoder; +export function getSetCollectionSizeArgsEncoder(): Encoder { + return getStructEncoder([['size', getU64Encoder()]]); } -export function getSetCollectionSizeArgsDecoder() { - return getStructDecoder([ - ['size', getU64Decoder()], - ]) satisfies Decoder; +export function getSetCollectionSizeArgsDecoder(): Decoder { + return getStructDecoder([['size', getU64Decoder()]]); } export function getSetCollectionSizeArgsCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/taCreateArgs.ts b/test/packages/js-experimental/src/generated/types/taCreateArgs.ts index f51aaee69..d59272115 100644 --- a/test/packages/js-experimental/src/generated/types/taCreateArgs.ts +++ b/test/packages/js-experimental/src/generated/types/taCreateArgs.ts @@ -23,18 +23,18 @@ export type TaCreateArgs = { export type TaCreateArgsArgs = TaCreateArgs; -export function getTaCreateArgsEncoder() { - return getStructEncoder([ +export function getTaCreateArgsEncoder(): Encoder { + return getStructEncoder([ ['ruleSetName', getStringEncoder()], ['serializedRuleSet', getBytesEncoder({ size: getU32Encoder() })], - ]) satisfies Encoder; + ]); } -export function getTaCreateArgsDecoder() { - return getStructDecoder([ +export function getTaCreateArgsDecoder(): Decoder { + return getStructDecoder([ ['ruleSetName', getStringDecoder()], ['serializedRuleSet', getBytesDecoder({ size: getU32Decoder() })], - ]) satisfies Decoder; + ]); } export function getTaCreateArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/taKey.ts b/test/packages/js-experimental/src/generated/types/taKey.ts index f78040d78..a14282f92 100644 --- a/test/packages/js-experimental/src/generated/types/taKey.ts +++ b/test/packages/js-experimental/src/generated/types/taKey.ts @@ -19,12 +19,12 @@ export enum TaKey { export type TaKeyArgs = TaKey; -export function getTaKeyEncoder() { - return getScalarEnumEncoder(TaKey) satisfies Encoder; +export function getTaKeyEncoder(): Encoder { + return getScalarEnumEncoder(TaKey); } -export function getTaKeyDecoder() { - return getScalarEnumDecoder(TaKey) satisfies Decoder; +export function getTaKeyDecoder(): Decoder { + return getScalarEnumDecoder(TaKey); } export function getTaKeyCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/tmCreateArgs.ts b/test/packages/js-experimental/src/generated/types/tmCreateArgs.ts index a00ff3a65..dbe551a3f 100644 --- a/test/packages/js-experimental/src/generated/types/tmCreateArgs.ts +++ b/test/packages/js-experimental/src/generated/types/tmCreateArgs.ts @@ -56,11 +56,11 @@ export type TmCreateArgsArgs = maxSupply: OptionOrNullable; }; -export function getTmCreateArgsEncoder() { - return getDataEnumEncoder([ +export function getTmCreateArgsEncoder(): Encoder { + return getDataEnumEncoder([ [ 'V1', - getStructEncoder>([ + getStructEncoder([ ['assetData', getAssetDataEncoder()], ['decimals', getOptionEncoder(getU8Encoder())], ['maxSupply', getOptionEncoder(getU64Encoder())], @@ -68,19 +68,19 @@ export function getTmCreateArgsEncoder() { ], [ 'V2', - getStructEncoder>([ + getStructEncoder([ ['assetData', getAssetDataEncoder()], ['maxSupply', getOptionEncoder(getU64Encoder())], ]), ], - ]) satisfies Encoder; + ]); } -export function getTmCreateArgsDecoder() { - return getDataEnumDecoder([ +export function getTmCreateArgsDecoder(): Decoder { + return getDataEnumDecoder([ [ 'V1', - getStructDecoder>([ + getStructDecoder([ ['assetData', getAssetDataDecoder()], ['decimals', getOptionDecoder(getU8Decoder())], ['maxSupply', getOptionDecoder(getU64Decoder())], @@ -88,12 +88,12 @@ export function getTmCreateArgsDecoder() { ], [ 'V2', - getStructDecoder>([ + getStructDecoder([ ['assetData', getAssetDataDecoder()], ['maxSupply', getOptionDecoder(getU64Decoder())], ]), ], - ]) satisfies Decoder; + ]); } export function getTmCreateArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/tmKey.ts b/test/packages/js-experimental/src/generated/types/tmKey.ts index 47c9e2493..8c2d070d2 100644 --- a/test/packages/js-experimental/src/generated/types/tmKey.ts +++ b/test/packages/js-experimental/src/generated/types/tmKey.ts @@ -29,12 +29,12 @@ export enum TmKey { export type TmKeyArgs = TmKey; -export function getTmKeyEncoder() { - return getScalarEnumEncoder(TmKey) satisfies Encoder; +export function getTmKeyEncoder(): Encoder { + return getScalarEnumEncoder(TmKey); } -export function getTmKeyDecoder() { - return getScalarEnumDecoder(TmKey) satisfies Decoder; +export function getTmKeyDecoder(): Decoder { + return getScalarEnumDecoder(TmKey); } export function getTmKeyCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/tokenStandard.ts b/test/packages/js-experimental/src/generated/types/tokenStandard.ts index e6e211f7e..0dc21ed9a 100644 --- a/test/packages/js-experimental/src/generated/types/tokenStandard.ts +++ b/test/packages/js-experimental/src/generated/types/tokenStandard.ts @@ -22,14 +22,12 @@ export enum TokenStandard { export type TokenStandardArgs = TokenStandard; -export function getTokenStandardEncoder() { - return getScalarEnumEncoder( - TokenStandard - ) satisfies Encoder; +export function getTokenStandardEncoder(): Encoder { + return getScalarEnumEncoder(TokenStandard); } -export function getTokenStandardDecoder() { - return getScalarEnumDecoder(TokenStandard) satisfies Decoder; +export function getTokenStandardDecoder(): Decoder { + return getScalarEnumDecoder(TokenStandard); } export function getTokenStandardCodec(): Codec< diff --git a/test/packages/js-experimental/src/generated/types/transferArgs.ts b/test/packages/js-experimental/src/generated/types/transferArgs.ts index 13e9c36c5..a34cee80c 100644 --- a/test/packages/js-experimental/src/generated/types/transferArgs.ts +++ b/test/packages/js-experimental/src/generated/types/transferArgs.ts @@ -41,28 +41,28 @@ export type TransferArgsArgs = { amount: number | bigint; }; -export function getTransferArgsEncoder() { - return getDataEnumEncoder([ +export function getTransferArgsEncoder(): Encoder { + return getDataEnumEncoder([ [ 'V1', - getStructEncoder>([ + getStructEncoder([ ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())], ['amount', getU64Encoder()], ]), ], - ]) satisfies Encoder; + ]); } -export function getTransferArgsDecoder() { - return getDataEnumDecoder([ +export function getTransferArgsDecoder(): Decoder { + return getDataEnumDecoder([ [ 'V1', - getStructDecoder>([ + getStructDecoder([ ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())], ['amount', getU64Decoder()], ]), ], - ]) satisfies Decoder; + ]); } export function getTransferArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/updateArgs.ts b/test/packages/js-experimental/src/generated/types/updateArgs.ts index 439348313..b19c11eb4 100644 --- a/test/packages/js-experimental/src/generated/types/updateArgs.ts +++ b/test/packages/js-experimental/src/generated/types/updateArgs.ts @@ -122,31 +122,12 @@ export type UpdateArgsArgs = { authorityType: AuthorityTypeArgs; }; -export function getUpdateArgsEncoder() { - return getDataEnumEncoder([ +export function getUpdateArgsEncoder(): Encoder { + return getDataEnumEncoder([ [ 'V1', mapEncoder( - getStructEncoder<{ - authorizationData: OptionOrNullable; - newUpdateAuthority: OptionOrNullable
; - data: OptionOrNullable<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>; - primarySaleHappened: OptionOrNullable; - isMutable: OptionOrNullable; - tokenStandard: OptionOrNullable; - collection: OptionOrNullable; - uses: OptionOrNullable; - collectionDetails: OptionOrNullable; - programmableConfig: OptionOrNullable; - delegateState: OptionOrNullable; - authorityType: AuthorityTypeArgs; - }>([ + getStructEncoder([ [ 'authorizationData', getOptionEncoder(getAuthorizationDataEncoder()), @@ -155,13 +136,7 @@ export function getUpdateArgsEncoder() { [ 'data', getOptionEncoder( - getStructEncoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: OptionOrNullable>; - }>([ + getStructEncoder([ ['name', getStringEncoder()], ['symbol', getStringEncoder()], ['uri', getStringEncoder()], @@ -195,26 +170,20 @@ export function getUpdateArgsEncoder() { }) ), ], - ]) satisfies Encoder; + ]); } -export function getUpdateArgsDecoder() { - return getDataEnumDecoder([ +export function getUpdateArgsDecoder(): Decoder { + return getDataEnumDecoder([ [ 'V1', - getStructDecoder>([ + getStructDecoder([ ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())], ['newUpdateAuthority', getOptionDecoder(getAddressDecoder())], [ 'data', getOptionDecoder( - getStructDecoder<{ - name: string; - symbol: string; - uri: string; - sellerFeeBasisPoints: number; - creators: Option>; - }>([ + getStructDecoder([ ['name', getStringDecoder()], ['symbol', getStringDecoder()], ['uri', getStringDecoder()], @@ -240,7 +209,7 @@ export function getUpdateArgsDecoder() { ['authorityType', getAuthorityTypeDecoder()], ]), ], - ]) satisfies Decoder; + ]); } export function getUpdateArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/useAssetArgs.ts b/test/packages/js-experimental/src/generated/types/useAssetArgs.ts index 8384d1785..4e51bb0bd 100644 --- a/test/packages/js-experimental/src/generated/types/useAssetArgs.ts +++ b/test/packages/js-experimental/src/generated/types/useAssetArgs.ts @@ -21,26 +21,16 @@ export type UseAssetArgs = { __kind: 'V1'; useCount: bigint }; export type UseAssetArgsArgs = { __kind: 'V1'; useCount: number | bigint }; -export function getUseAssetArgsEncoder() { - return getDataEnumEncoder([ - [ - 'V1', - getStructEncoder>([ - ['useCount', getU64Encoder()], - ]), - ], - ]) satisfies Encoder; +export function getUseAssetArgsEncoder(): Encoder { + return getDataEnumEncoder([ + ['V1', getStructEncoder([['useCount', getU64Encoder()]])], + ]); } -export function getUseAssetArgsDecoder() { - return getDataEnumDecoder([ - [ - 'V1', - getStructDecoder>([ - ['useCount', getU64Decoder()], - ]), - ], - ]) satisfies Decoder; +export function getUseAssetArgsDecoder(): Decoder { + return getDataEnumDecoder([ + ['V1', getStructDecoder([['useCount', getU64Decoder()]])], + ]); } export function getUseAssetArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/useMethod.ts b/test/packages/js-experimental/src/generated/types/useMethod.ts index 36b2f05f5..662b2e5db 100644 --- a/test/packages/js-experimental/src/generated/types/useMethod.ts +++ b/test/packages/js-experimental/src/generated/types/useMethod.ts @@ -20,12 +20,12 @@ export enum UseMethod { export type UseMethodArgs = UseMethod; -export function getUseMethodEncoder() { - return getScalarEnumEncoder(UseMethod) satisfies Encoder; +export function getUseMethodEncoder(): Encoder { + return getScalarEnumEncoder(UseMethod); } -export function getUseMethodDecoder() { - return getScalarEnumDecoder(UseMethod) satisfies Decoder; +export function getUseMethodDecoder(): Decoder { + return getScalarEnumDecoder(UseMethod); } export function getUseMethodCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/uses.ts b/test/packages/js-experimental/src/generated/types/uses.ts index 7cdadcf38..5370f1082 100644 --- a/test/packages/js-experimental/src/generated/types/uses.ts +++ b/test/packages/js-experimental/src/generated/types/uses.ts @@ -27,20 +27,20 @@ export type UsesArgs = { total: number | bigint; }; -export function getUsesEncoder() { - return getStructEncoder([ +export function getUsesEncoder(): Encoder { + return getStructEncoder([ ['useMethod', getUseMethodEncoder()], ['remaining', getU64Encoder()], ['total', getU64Encoder()], - ]) satisfies Encoder; + ]); } -export function getUsesDecoder() { - return getStructDecoder([ +export function getUsesDecoder(): Decoder { + return getStructDecoder([ ['useMethod', getUseMethodDecoder()], ['remaining', getU64Decoder()], ['total', getU64Decoder()], - ]) satisfies Decoder; + ]); } export function getUsesCodec(): Codec { diff --git a/test/packages/js-experimental/src/generated/types/verifyArgs.ts b/test/packages/js-experimental/src/generated/types/verifyArgs.ts index 4510f2fd7..7b92aa1f1 100644 --- a/test/packages/js-experimental/src/generated/types/verifyArgs.ts +++ b/test/packages/js-experimental/src/generated/types/verifyArgs.ts @@ -18,12 +18,12 @@ export enum VerifyArgs { export type VerifyArgsArgs = VerifyArgs; -export function getVerifyArgsEncoder() { - return getScalarEnumEncoder(VerifyArgs) satisfies Encoder; +export function getVerifyArgsEncoder(): Encoder { + return getScalarEnumEncoder(VerifyArgs); } -export function getVerifyArgsDecoder() { - return getScalarEnumDecoder(VerifyArgs) satisfies Decoder; +export function getVerifyArgsDecoder(): Decoder { + return getScalarEnumDecoder(VerifyArgs); } export function getVerifyArgsCodec(): Codec { diff --git a/test/packages/js-experimental/src/hooked/createReservationListInstructionData.ts b/test/packages/js-experimental/src/hooked/createReservationListInstructionData.ts index adb3c57f4..c28b3ccf9 100644 --- a/test/packages/js-experimental/src/hooked/createReservationListInstructionData.ts +++ b/test/packages/js-experimental/src/hooked/createReservationListInstructionData.ts @@ -17,17 +17,13 @@ export type CreateReservationListInstructionDataArgs = {}; export function getCreateReservationListInstructionDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ discriminator: number }>([ - ['discriminator', getU8Encoder()], - ]), + getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: 42 }) - ) as Encoder; + ); } export function getCreateReservationListInstructionDataDecoder(): Decoder { - return getStructDecoder([ - ['discriminator', getU8Decoder()], - ]) as Decoder; + return getStructDecoder([['discriminator', getU8Decoder()]]); } export function getCreateReservationListInstructionDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/hooked/reservationListV1AccountData.ts b/test/packages/js-experimental/src/hooked/reservationListV1AccountData.ts index 3ab75003a..18488a202 100644 --- a/test/packages/js-experimental/src/hooked/reservationListV1AccountData.ts +++ b/test/packages/js-experimental/src/hooked/reservationListV1AccountData.ts @@ -48,33 +48,23 @@ export type ReservationListV1AccountDataArgs = { export function getReservationListV1AccountDataEncoder(): Encoder { return mapEncoder( - getStructEncoder<{ - key: TmKey; - masterEdition: Address; - supplySnapshot: OptionOrNullable; - reservations: Array; - }>([ + getStructEncoder([ ['key', getTmKeyEncoder()], ['masterEdition', getAddressEncoder()], ['supplySnapshot', getOptionEncoder(getU64Encoder())], ['reservations', getArrayEncoder(getReservationV1Encoder())], ]), (value) => ({ ...value, key: TmKey.ReservationListV1 }) - ) as Encoder; + ); } export function getReservationListV1AccountDataDecoder(): Decoder { - return getStructDecoder<{ - key: TmKey; - masterEdition: Address; - supplySnapshot: OptionOrNullable; - reservations: Array; - }>([ + return getStructDecoder([ ['key', getTmKeyDecoder()], ['masterEdition', getAddressDecoder()], ['supplySnapshot', getOptionDecoder(getU64Decoder())], ['reservations', getArrayDecoder(getReservationV1Decoder())], - ]) as Decoder; + ]); } export function getReservationListV1AccountDataCodec(): Codec< diff --git a/test/packages/js-experimental/src/hooked/resolvers.ts b/test/packages/js-experimental/src/hooked/resolvers.ts index a49e9db47..9779068ed 100644 --- a/test/packages/js-experimental/src/hooked/resolvers.ts +++ b/test/packages/js-experimental/src/hooked/resolvers.ts @@ -11,7 +11,7 @@ export const resolveMasterEditionFromTokenStandard = async ({ args, }: { accounts: Record; - args: { tokenStandard?: TokenStandard }; + args: { tokenStandard?: TokenStandard | undefined }; }): Promise> => { return args.tokenStandard === TokenStandard.NonFungible || args.tokenStandard === TokenStandard.ProgrammableNonFungible @@ -26,7 +26,7 @@ export const resolveMasterEditionFromTokenStandard = async ({ export const resolveTokenOrAta = ({ args, }: { - args: { proof?: Address[] }; + args: { proof?: Address[] | undefined }; }): boolean => { return !!args.proof && args.proof.length > 0; };