diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 31c7a3ca..196144d5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.658.2 +speakeasyVersion: 1.659.0 sources: chainkit-source: sourceNamespace: avalanche-sdk-chainkit-typescript - sourceRevisionDigest: sha256:9fee7d090be1dd467728b0ba83dabc5c4a8d1c507678f99832acdfd9aa6fb010 - sourceBlobDigest: sha256:791df338e1bc1a9d1dc86e284ae6404bd667a7f4957a5623b0ef6d4bc126711b + sourceRevisionDigest: sha256:a2725e93698de1ec0e06309de395a7be6b7d18f64148e05150a262aa7f76a608 + sourceBlobDigest: sha256:179e4d223f82564b1c25d36dbf57c7a232d861a96bd54c3ad44089d4262716d7 tags: - latest - - speakeasy-sdk-regen-1763232057 + - speakeasy-sdk-regen-1763577819 - 1.0.0 targets: chainkit-sdk: source: chainkit-source sourceNamespace: avalanche-sdk-chainkit-typescript - sourceRevisionDigest: sha256:9fee7d090be1dd467728b0ba83dabc5c4a8d1c507678f99832acdfd9aa6fb010 - sourceBlobDigest: sha256:791df338e1bc1a9d1dc86e284ae6404bd667a7f4957a5623b0ef6d4bc126711b + sourceRevisionDigest: sha256:a2725e93698de1ec0e06309de395a7be6b7d18f64148e05150a262aa7f76a608 + sourceBlobDigest: sha256:179e4d223f82564b1c25d36dbf57c7a232d861a96bd54c3ad44089d4262716d7 codeSamplesNamespace: avalanche-sdk-chainkit-typescript-code-samples - codeSamplesRevisionDigest: sha256:f1944be210c241d8993f8b95d9ca896f31322ac89f11f906f8cc3ab84404309c + codeSamplesRevisionDigest: sha256:0f57006ca4e06cd1c43089c12b5c185b31e98856e28bda13e441caafc9f9a6a1 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/chainkit/.speakeasy/gen.lock b/chainkit/.speakeasy/gen.lock index 56e1a91c..c93616c2 100644 --- a/chainkit/.speakeasy/gen.lock +++ b/chainkit/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 125b8491-d8a2-4e4f-ad7e-83badf249c68 management: - docChecksum: 527ef490a067f9f34c8b22e229aee190 + docChecksum: 15cecdbe980748d5e71fd0a1cef97ddf docVersion: 1.0.0 - speakeasyVersion: 1.658.2 + speakeasyVersion: 1.659.0 generationVersion: 2.755.9 - releaseVersion: 0.3.0-alpha.10 - configChecksum: 23dc04d58371ed9ebb90e06ee91d1be3 + releaseVersion: 0.3.0-alpha.11 + configChecksum: 7c73dbc14327a4c23c9f491eda8c79b2 repoURL: https://github.com/ava-labs/avalanche-sdk-typescript.git repoSubDirectory: chainkit installationURL: https://gitpkg.now.sh/ava-labs/avalanche-sdk-typescript/chainkit @@ -493,7 +493,9 @@ generatedFiles: - docs/models/operations/getutxosbyaddressesv2globals.md - docs/models/operations/getutxosbyaddressesv2request.md - docs/models/operations/getutxosbyaddressesv2response.md - - docs/models/operations/getutxosbyaddressesv2responsebody.md + - docs/models/operations/getutxosbyaddressesv2responsebody1.md + - docs/models/operations/getutxosbyaddressesv2responsebody2.md + - docs/models/operations/getutxosbyaddressesv2responseresult.md - docs/models/operations/getvalidatorsbydaterangerequest.md - docs/models/operations/getvalidatorsbydaterangeresponse.md - docs/models/operations/getvertexbyhashglobals.md @@ -6288,6 +6290,8 @@ examples: application/json: {"message": "", "statusCode": 502, "error": "Bad Gateway"} "503": application/json: {"message": ["", ""], "statusCode": 503, "error": "Service Unavailable"} + "201": + application/json: {"utxos": [], "chainInfo": {"chainName": "p-chain", "network": "mainnet"}} live-check: speakeasy-default-live-check: responses: @@ -6334,4 +6338,4 @@ examplesVersion: 1.0.2 generatedTests: {} releaseNotes: | ## Typescript SDK Changes Detected: - * `avalanche.avaxSupply.get()`: `response.l1validatorfees` **Added** + * `avalanche.data.primaryNetwork.utxos.listByAddressesV2()`: `response.status[201]` **Added** **Breaking** :warning: diff --git a/chainkit/.speakeasy/gen.yaml b/chainkit/.speakeasy/gen.yaml index bc44b7b9..f6b48f5f 100644 --- a/chainkit/.speakeasy/gen.yaml +++ b/chainkit/.speakeasy/gen.yaml @@ -25,7 +25,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 0.3.0-alpha.10 + version: 0.3.0-alpha.11 acceptHeaderEnum: true additionalDependencies: dependencies: diff --git a/chainkit/RELEASES.md b/chainkit/RELEASES.md index 6a881f07..2f6c5534 100644 --- a/chainkit/RELEASES.md +++ b/chainkit/RELEASES.md @@ -120,4 +120,14 @@ Based on: ### Generated - [typescript v0.3.0-alpha.10] chainkit ### Releases -- [NPM v0.3.0-alpha.10] https://www.npmjs.com/package/@avalanche-sdk/chainkit/v/0.3.0-alpha.10 - chainkit \ No newline at end of file +- [NPM v0.3.0-alpha.10] https://www.npmjs.com/package/@avalanche-sdk/chainkit/v/0.3.0-alpha.10 - chainkit + +## 2025-11-20 21:26:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.659.0 (2.755.9) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.3.0-alpha.11] chainkit +### Releases +- [NPM v0.3.0-alpha.11] https://www.npmjs.com/package/@avalanche-sdk/chainkit/v/0.3.0-alpha.11 - chainkit \ No newline at end of file diff --git a/chainkit/docs/models/operations/getutxosbyaddressesv2response.md b/chainkit/docs/models/operations/getutxosbyaddressesv2response.md index f2e4965e..35b81e81 100644 --- a/chainkit/docs/models/operations/getutxosbyaddressesv2response.md +++ b/chainkit/docs/models/operations/getutxosbyaddressesv2response.md @@ -43,6 +43,6 @@ let value: GetUtxosByAddressesV2Response = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `result` | *operations.GetUtxosByAddressesV2ResponseBody* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `result` | *operations.GetUtxosByAddressesV2ResponseResult* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody.md b/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody1.md similarity index 98% rename from chainkit/docs/models/operations/getutxosbyaddressesv2responsebody.md rename to chainkit/docs/models/operations/getutxosbyaddressesv2responsebody1.md index 07b015b2..532808b3 100644 --- a/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody.md +++ b/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody1.md @@ -1,4 +1,4 @@ -# GetUtxosByAddressesV2ResponseBody +# GetUtxosByAddressesV2ResponseBody1 Successful response diff --git a/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody2.md b/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody2.md new file mode 100644 index 00000000..3c1f1f95 --- /dev/null +++ b/chainkit/docs/models/operations/getutxosbyaddressesv2responsebody2.md @@ -0,0 +1,88 @@ +# GetUtxosByAddressesV2ResponseBody2 + +Successful response + + +## Supported Types + +### `components.ListPChainUtxosResponse` + +```typescript +const value: components.ListPChainUtxosResponse = { + utxos: [ + { + addresses: [ + "avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw", + ], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "871.14", + assetId: "", + blockNumber: "", + blockTimestamp: 9647.88, + outputIndex: 5158.07, + txHash: "", + utxoType: "STAKE", + }, + ], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + +### `components.ListUtxosResponse` + +```typescript +const value: components.ListUtxosResponse = { + utxos: [ + { + addresses: [ + "avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw", + ], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + diff --git a/chainkit/docs/models/operations/getutxosbyaddressesv2responseresult.md b/chainkit/docs/models/operations/getutxosbyaddressesv2responseresult.md new file mode 100644 index 00000000..bf8c526e --- /dev/null +++ b/chainkit/docs/models/operations/getutxosbyaddressesv2responseresult.md @@ -0,0 +1,29 @@ +# GetUtxosByAddressesV2ResponseResult + + +## Supported Types + +### `operations.GetUtxosByAddressesV2ResponseBody1` + +```typescript +const value: operations.GetUtxosByAddressesV2ResponseBody1 = { + utxos: [], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + +### `operations.GetUtxosByAddressesV2ResponseBody2` + +```typescript +const value: operations.GetUtxosByAddressesV2ResponseBody2 = { + utxos: [], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + diff --git a/chainkit/docs/models/operations/listpendingprimarynetworkrewardsrequest.md b/chainkit/docs/models/operations/listpendingprimarynetworkrewardsrequest.md index c4a5721d..1658825a 100644 --- a/chainkit/docs/models/operations/listpendingprimarynetworkrewardsrequest.md +++ b/chainkit/docs/models/operations/listpendingprimarynetworkrewardsrequest.md @@ -6,7 +6,6 @@ import { ListPendingPrimaryNetworkRewardsRequest } from "@avalanche-sdk/chainkit/models/operations"; let value: ListPendingPrimaryNetworkRewardsRequest = { - addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", sortOrder: "asc", @@ -17,7 +16,7 @@ let value: ListPendingPrimaryNetworkRewardsRequest = { | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". One of addresses or nodeIds is required. | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". One of addresses or nodeIds is required. | | | `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | | `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | | `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or testnet/fuji. | mainnet | diff --git a/chainkit/examples/package-lock.json b/chainkit/examples/package-lock.json index c5c9eae7..d6d4c3a6 100644 --- a/chainkit/examples/package-lock.json +++ b/chainkit/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@avalanche-sdk/chainkit", - "version": "0.3.0-alpha.10", + "version": "0.3.0-alpha.11", "license": "BSD-3-Clause", "dependencies": { "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", diff --git a/chainkit/package-lock.json b/chainkit/package-lock.json index c06498e1..177bf6fb 100644 --- a/chainkit/package-lock.json +++ b/chainkit/package-lock.json @@ -1,12 +1,12 @@ { "name": "@avalanche-sdk/chainkit", - "version": "0.3.0-alpha.10", + "version": "0.3.0-alpha.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@avalanche-sdk/chainkit", - "version": "0.3.0-alpha.10", + "version": "0.3.0-alpha.11", "license": "BSD-3-Clause", "dependencies": { "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", diff --git a/chainkit/package.json b/chainkit/package.json index b8333737..c860701b 100644 --- a/chainkit/package.json +++ b/chainkit/package.json @@ -1,6 +1,6 @@ { "name": "@avalanche-sdk/chainkit", - "version": "0.3.0-alpha.10", + "version": "0.3.0-alpha.11", "author": "Sayan Kar", "license": "BSD-3-Clause", "publishConfig": { diff --git a/chainkit/src/funcs/dataPrimaryNetworkUtxosListByAddressesV2.ts b/chainkit/src/funcs/dataPrimaryNetworkUtxosListByAddressesV2.ts index 02b4a71c..f69f612e 100644 --- a/chainkit/src/funcs/dataPrimaryNetworkUtxosListByAddressesV2.ts +++ b/chainkit/src/funcs/dataPrimaryNetworkUtxosListByAddressesV2.ts @@ -248,6 +248,9 @@ async function $do( M.json(200, operations.GetUtxosByAddressesV2Response$inboundSchema, { key: "Result", }), + M.json(201, operations.GetUtxosByAddressesV2Response$inboundSchema, { + key: "Result", + }), M.jsonErr(400, errors.BadRequestError$inboundSchema), M.jsonErr(401, errors.UnauthorizedError$inboundSchema), M.jsonErr(403, errors.ForbiddenError$inboundSchema), diff --git a/chainkit/src/lib/config.ts b/chainkit/src/lib/config.ts index 3acb8096..cbfee00f 100644 --- a/chainkit/src/lib/config.ts +++ b/chainkit/src/lib/config.ts @@ -82,8 +82,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.3.0-alpha.10", + sdkVersion: "0.3.0-alpha.11", genVersion: "2.755.9", userAgent: - "speakeasy-sdk/typescript 0.3.0-alpha.10 2.755.9 1.0.0 @avalanche-sdk/chainkit", + "speakeasy-sdk/typescript 0.3.0-alpha.11 2.755.9 1.0.0 @avalanche-sdk/chainkit", } as const; diff --git a/chainkit/src/mcp-server/mcp-server.ts b/chainkit/src/mcp-server/mcp-server.ts index f42b65c5..a9d221e3 100644 --- a/chainkit/src/mcp-server/mcp-server.ts +++ b/chainkit/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "0.3.0-alpha.10", + currentVersion: "0.3.0-alpha.11", }, }); diff --git a/chainkit/src/mcp-server/server.ts b/chainkit/src/mcp-server/server.ts index 99dbbb3b..fde37bbe 100644 --- a/chainkit/src/mcp-server/server.ts +++ b/chainkit/src/mcp-server/server.ts @@ -129,7 +129,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Avalanche", - version: "0.3.0-alpha.10", + version: "0.3.0-alpha.11", }); const client = new AvalancheCore({ diff --git a/chainkit/src/models/operations/getutxosbyaddressesv2.ts b/chainkit/src/models/operations/getutxosbyaddressesv2.ts index 59d4d57f..3e3add67 100644 --- a/chainkit/src/models/operations/getutxosbyaddressesv2.ts +++ b/chainkit/src/models/operations/getutxosbyaddressesv2.ts @@ -63,12 +63,29 @@ export type GetUtxosByAddressesV2Request = { /** * Successful response */ -export type GetUtxosByAddressesV2ResponseBody = +export type GetUtxosByAddressesV2ResponseBody2 = + | components.ListPChainUtxosResponse + | components.ListUtxosResponse; + +/** + * Successful response + */ +export type GetUtxosByAddressesV2ResponseBody1 = + | components.ListPChainUtxosResponse + | components.ListUtxosResponse; + +export type GetUtxosByAddressesV2ResponseResult = + | components.ListPChainUtxosResponse + | components.ListUtxosResponse | components.ListPChainUtxosResponse | components.ListUtxosResponse; export type GetUtxosByAddressesV2Response = { - result: components.ListPChainUtxosResponse | components.ListUtxosResponse; + result: + | components.ListPChainUtxosResponse + | components.ListUtxosResponse + | components.ListPChainUtxosResponse + | components.ListUtxosResponse; }; /** @internal */ @@ -192,8 +209,8 @@ export function getUtxosByAddressesV2RequestFromJSON( } /** @internal */ -export const GetUtxosByAddressesV2ResponseBody$inboundSchema: z.ZodType< - GetUtxosByAddressesV2ResponseBody, +export const GetUtxosByAddressesV2ResponseBody2$inboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseBody2, z.ZodTypeDef, unknown > = z.union([ @@ -201,36 +218,139 @@ export const GetUtxosByAddressesV2ResponseBody$inboundSchema: z.ZodType< components.ListUtxosResponse$inboundSchema, ]); /** @internal */ -export type GetUtxosByAddressesV2ResponseBody$Outbound = +export type GetUtxosByAddressesV2ResponseBody2$Outbound = | components.ListPChainUtxosResponse$Outbound | components.ListUtxosResponse$Outbound; /** @internal */ -export const GetUtxosByAddressesV2ResponseBody$outboundSchema: z.ZodType< - GetUtxosByAddressesV2ResponseBody$Outbound, +export const GetUtxosByAddressesV2ResponseBody2$outboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseBody2$Outbound, z.ZodTypeDef, - GetUtxosByAddressesV2ResponseBody + GetUtxosByAddressesV2ResponseBody2 > = z.union([ components.ListPChainUtxosResponse$outboundSchema, components.ListUtxosResponse$outboundSchema, ]); -export function getUtxosByAddressesV2ResponseBodyToJSON( - getUtxosByAddressesV2ResponseBody: GetUtxosByAddressesV2ResponseBody, +export function getUtxosByAddressesV2ResponseBody2ToJSON( + getUtxosByAddressesV2ResponseBody2: GetUtxosByAddressesV2ResponseBody2, +): string { + return JSON.stringify( + GetUtxosByAddressesV2ResponseBody2$outboundSchema.parse( + getUtxosByAddressesV2ResponseBody2, + ), + ); +} +export function getUtxosByAddressesV2ResponseBody2FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetUtxosByAddressesV2ResponseBody2$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUtxosByAddressesV2ResponseBody2' from JSON`, + ); +} + +/** @internal */ +export const GetUtxosByAddressesV2ResponseBody1$inboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseBody1, + z.ZodTypeDef, + unknown +> = z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, +]); +/** @internal */ +export type GetUtxosByAddressesV2ResponseBody1$Outbound = + | components.ListPChainUtxosResponse$Outbound + | components.ListUtxosResponse$Outbound; + +/** @internal */ +export const GetUtxosByAddressesV2ResponseBody1$outboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseBody1$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesV2ResponseBody1 +> = z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, +]); + +export function getUtxosByAddressesV2ResponseBody1ToJSON( + getUtxosByAddressesV2ResponseBody1: GetUtxosByAddressesV2ResponseBody1, +): string { + return JSON.stringify( + GetUtxosByAddressesV2ResponseBody1$outboundSchema.parse( + getUtxosByAddressesV2ResponseBody1, + ), + ); +} +export function getUtxosByAddressesV2ResponseBody1FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetUtxosByAddressesV2ResponseBody1$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUtxosByAddressesV2ResponseBody1' from JSON`, + ); +} + +/** @internal */ +export const GetUtxosByAddressesV2ResponseResult$inboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseResult, + z.ZodTypeDef, + unknown +> = z.union([ + z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, + ]), + z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, + ]), +]); +/** @internal */ +export type GetUtxosByAddressesV2ResponseResult$Outbound = + | components.ListPChainUtxosResponse$Outbound + | components.ListUtxosResponse$Outbound + | components.ListPChainUtxosResponse$Outbound + | components.ListUtxosResponse$Outbound; + +/** @internal */ +export const GetUtxosByAddressesV2ResponseResult$outboundSchema: z.ZodType< + GetUtxosByAddressesV2ResponseResult$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesV2ResponseResult +> = z.union([ + z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, + ]), + z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, + ]), +]); + +export function getUtxosByAddressesV2ResponseResultToJSON( + getUtxosByAddressesV2ResponseResult: GetUtxosByAddressesV2ResponseResult, ): string { return JSON.stringify( - GetUtxosByAddressesV2ResponseBody$outboundSchema.parse( - getUtxosByAddressesV2ResponseBody, + GetUtxosByAddressesV2ResponseResult$outboundSchema.parse( + getUtxosByAddressesV2ResponseResult, ), ); } -export function getUtxosByAddressesV2ResponseBodyFromJSON( +export function getUtxosByAddressesV2ResponseResultFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => GetUtxosByAddressesV2ResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetUtxosByAddressesV2ResponseBody' from JSON`, + (x) => + GetUtxosByAddressesV2ResponseResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUtxosByAddressesV2ResponseResult' from JSON`, ); } @@ -241,8 +361,14 @@ export const GetUtxosByAddressesV2Response$inboundSchema: z.ZodType< unknown > = z.object({ Result: z.union([ - components.ListPChainUtxosResponse$inboundSchema, - components.ListUtxosResponse$inboundSchema, + z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, + ]), + z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, + ]), ]), }).transform((v) => { return remap$(v, { @@ -252,6 +378,8 @@ export const GetUtxosByAddressesV2Response$inboundSchema: z.ZodType< /** @internal */ export type GetUtxosByAddressesV2Response$Outbound = { Result: + | components.ListPChainUtxosResponse$Outbound + | components.ListUtxosResponse$Outbound | components.ListPChainUtxosResponse$Outbound | components.ListUtxosResponse$Outbound; }; @@ -263,8 +391,14 @@ export const GetUtxosByAddressesV2Response$outboundSchema: z.ZodType< GetUtxosByAddressesV2Response > = z.object({ result: z.union([ - components.ListPChainUtxosResponse$outboundSchema, - components.ListUtxosResponse$outboundSchema, + z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, + ]), + z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, + ]), ]), }).transform((v) => { return remap$(v, {