diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f9fde93..c76398b 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2b9c4bf6-4d87-4382-84d9-5fb3c84c7fad management: - docChecksum: 21e433953628bb40823c36021dcb9f0a + docChecksum: 4155e3d49d853fdc3e6cf264ac0f997d docVersion: Beta - speakeasyVersion: 1.453.10 - generationVersion: 2.474.15 - releaseVersion: 0.8.2 - configChecksum: 171e0b0b43eb7e8867fa9d4b2d8a48f8 + speakeasyVersion: 1.455.3 + generationVersion: 2.479.3 + releaseVersion: 0.8.3 + configChecksum: 6f84b9a6cd393b8ea212cec077f58d26 repoURL: https://github.com/ava-labs/avacloud-sdk-typescript.git installationURL: https://github.com/ava-labs/avacloud-sdk-typescript published: true @@ -281,6 +281,8 @@ generatedFiles: - docs/models/components/rollingwindowmetricsapiresponse.md - docs/models/components/security.md - docs/models/components/sharedsecretsresponse.md + - docs/models/components/signatureaggregationresponse.md + - docs/models/components/signatureaggregatorrequest.md - docs/models/components/sortbyoption.md - docs/models/components/sortorder.md - docs/models/components/sourcechainid.md @@ -576,6 +578,7 @@ generatedFiles: - docs/sdks/operations/README.md - docs/sdks/primarynetwork/README.md - docs/sdks/rewards/README.md + - docs/sdks/signatureaggregator/README.md - docs/sdks/teleporter/README.md - docs/sdks/transactions/README.md - docs/sdks/usagemetrics/README.md @@ -637,6 +640,7 @@ generatedFiles: - src/funcs/dataPrimaryNetworkVerticesGetVertexByHash.ts - src/funcs/dataPrimaryNetworkVerticesGetVertexByHeight.ts - src/funcs/dataPrimaryNetworkVerticesListLatestXChainVertices.ts + - src/funcs/dataSignatureAggregatorAggregateSignatures.ts - src/funcs/dataTeleporterGetTeleporterMessage.ts - src/funcs/dataTeleporterListTeleporterMessages.ts - src/funcs/dataTeleporterListTeleporterMessagesByAddress.ts @@ -871,6 +875,8 @@ generatedFiles: - src/models/components/rollingwindowmetricsapiresponse.ts - src/models/components/security.ts - src/models/components/sharedsecretsresponse.ts + - src/models/components/signatureaggregationresponse.ts + - src/models/components/signatureaggregatorrequest.ts - src/models/components/sortbyoption.ts - src/models/components/sortorder.ts - src/models/components/stakingdistribution.ts @@ -933,6 +939,7 @@ generatedFiles: - src/models/errors/toomanyrequests.ts - src/models/errors/unauthorized.ts - src/models/operations/addaddressestowebhook.ts + - src/models/operations/aggregatesignatures.ts - src/models/operations/compositequeryv2.ts - src/models/operations/createwebhook.ts - src/models/operations/datahealthcheck.ts @@ -1036,6 +1043,7 @@ generatedFiles: - src/sdk/primarynetwork.ts - src/sdk/rewards.ts - src/sdk/sdk.ts + - src/sdk/signatureaggregator.ts - src/sdk/teleporter.ts - src/sdk/transactions.ts - src/sdk/usagemetrics.ts @@ -3226,4 +3234,27 @@ examples: application/json: {"message": "", "statusCode": 502, "error": "Bad Gateway"} "503": application/json: {"message": [], "statusCode": 503, "error": "Service Unavailable"} + aggregateSignatures: + speakeasy-default-aggregate-signatures: + requestBody: + application/json: {"message": "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003cc0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000", "justification": "0001abcdabcfff", "signingSubnetId": "7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5", "quorumPercentage": 50} + responses: + "201": + application/json: {"signedMessage": "0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000103807355b21dd497ecc9f560dfbdefc64aeec72b226c70d3793273db01d1a0c0bfd74d095d6a9e0b4db2dc652245fd28ac032c0f1f6b7f761b912ad58c93cde2e337bef4a4e8175af69f226520cd1baedd2dd7db79bb5752cb50a465531e46e8af"} + "400": + application/json: {"message": [], "statusCode": 400, "error": "Bad Request"} + "401": + application/json: {"message": ["", ""], "statusCode": 401, "error": "Unauthorized"} + "403": + application/json: {"message": "", "statusCode": 403, "error": "Forbidden"} + "404": + application/json: {"message": [""], "statusCode": 404, "error": "Not Found"} + "429": + application/json: {"message": [""], "statusCode": 429, "error": "Too Many Requests"} + "500": + application/json: {"message": "", "statusCode": 500, "error": "Internal Server Error"} + "502": + application/json: {"message": [], "statusCode": 502, "error": "Bad Gateway"} + "503": + application/json: {"message": "", "statusCode": 503, "error": "Service Unavailable"} generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 17cf894..2f84027 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false typescript: - version: 0.8.2 + version: 0.8.3 additionalDependencies: dependencies: json-canonicalize: ^1.0.6 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5e2a69f..a6910b8 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.453.10 +speakeasyVersion: 1.455.3 sources: AvaCloudSDK-OAS: sourceNamespace: avacloud-sdk-oas - sourceRevisionDigest: sha256:6b4280da639355b47fe2abf85ab13a5d409b0e86927b6f1c86ac8ba4aa654fba - sourceBlobDigest: sha256:0f93031f1bf44df2b07fe28b3d09cc86b9466ec81aa7ec7b4c3a3d82c3f2f20c + sourceRevisionDigest: sha256:427e2339ce2b9eb81a273c7bb83de00c43a308e09c84b0d7903fcf77b9319fd6 + sourceBlobDigest: sha256:169dbb1bda661ac86728cf0e25a89bffd9fc653d0841861fe9b4721df7e80d00 tags: - latest - - speakeasy-sdk-regen-1733444645 + - speakeasy-sdk-regen-1734049462 - Beta AvalancheSDK-OAS: sourceNamespace: avalanche-sdk-oas @@ -19,10 +19,10 @@ targets: avacloud-sdk: source: AvaCloudSDK-OAS sourceNamespace: avacloud-sdk-oas - sourceRevisionDigest: sha256:6b4280da639355b47fe2abf85ab13a5d409b0e86927b6f1c86ac8ba4aa654fba - sourceBlobDigest: sha256:0f93031f1bf44df2b07fe28b3d09cc86b9466ec81aa7ec7b4c3a3d82c3f2f20c + sourceRevisionDigest: sha256:427e2339ce2b9eb81a273c7bb83de00c43a308e09c84b0d7903fcf77b9319fd6 + sourceBlobDigest: sha256:169dbb1bda661ac86728cf0e25a89bffd9fc653d0841861fe9b4721df7e80d00 codeSamplesNamespace: avacloud-sdk-ts-code-samples - codeSamplesRevisionDigest: sha256:8f599360e4ba1eedb32310c22bae2dc5e6f5d5e7ae636810b56a7cd2ad5fc780 + codeSamplesRevisionDigest: sha256:1fb35b8427e52e57400257751487603371d4102a047ecf2e4c3a7a1216474270 avalanche-sdk: source: AvalancheSDK-OAS sourceNamespace: avalanche-sdk-oas diff --git a/README.md b/README.md index f10a734..d7f1041 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,10 @@ run(); * [getVertexByHash](docs/sdks/vertices/README.md#getvertexbyhash) - Get vertex * [getVertexByHeight](docs/sdks/vertices/README.md#getvertexbyheight) - List vertices by height +#### [data.signatureAggregator](docs/sdks/signatureaggregator/README.md) + +* [aggregateSignatures](docs/sdks/signatureaggregator/README.md#aggregatesignatures) - Aggregate Signatures + #### [data.teleporter](docs/sdks/teleporter/README.md) * [getTeleporterMessage](docs/sdks/teleporter/README.md#getteleportermessage) - Get a teleporter message @@ -314,6 +318,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`dataPrimaryNetworkVerticesGetVertexByHash`](docs/sdks/vertices/README.md#getvertexbyhash) - Get vertex - [`dataPrimaryNetworkVerticesGetVertexByHeight`](docs/sdks/vertices/README.md#getvertexbyheight) - List vertices by height - [`dataPrimaryNetworkVerticesListLatestXChainVertices`](docs/sdks/vertices/README.md#listlatestxchainvertices) - List vertices +- [`dataSignatureAggregatorAggregateSignatures`](docs/sdks/signatureaggregator/README.md#aggregatesignatures) - Aggregate Signatures - [`dataTeleporterGetTeleporterMessage`](docs/sdks/teleporter/README.md#getteleportermessage) - Get a teleporter message - [`dataTeleporterListTeleporterMessages`](docs/sdks/teleporter/README.md#listteleportermessages) - List teleporter messages - [`dataTeleporterListTeleporterMessagesByAddress`](docs/sdks/teleporter/README.md#listteleportermessagesbyaddress) - List teleporter messages by address @@ -498,19 +503,7 @@ run(); ## Error Handling -All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`. - -If a HTTP request fails, an operation my also throw an error from the `models/errors/httpclienterrors.ts` module: - -| HTTP Client Error | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | -| RequestAbortedError | HTTP request was aborted by the client | -| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | -| ConnectionError | HTTP client was unable to make a request to a server | -| InvalidRequestError | Any input used to create a request is invalid | -| UnexpectedClientError | Unrecognised or unexpected error | - -In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `reindexNft` method may throw the following errors: +Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `reindexNft` method may throw the following errors: | Error Type | Status Code | Content Type | | -------------------------- | ----------- | ---------------- | @@ -524,6 +517,8 @@ In addition, when custom error responses are specified for an operation, the SDK | errors.ServiceUnavailable | 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`. + ```typescript import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; import { @@ -552,8 +547,9 @@ async function run() { }); } catch (err) { switch (true) { + // The server response does not match the expected SDK schema case (err instanceof SDKValidationError): { - // Validation errors can be pretty-printed + // Pretty-print will provide a human-readable multi-line error message console.error(err.pretty()); // Raw value may also be inspected console.error(err.rawValue); @@ -600,6 +596,7 @@ async function run() { return; } default: { + // Other errors such as network errors, see HTTPClientErrors for more details throw err; } } @@ -610,7 +607,17 @@ run(); ``` -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging. + +In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module: + +| HTTP Client Error | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | +| RequestAbortedError | HTTP request was aborted by the client | +| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | +| ConnectionError | HTTP client was unable to make a request to a server | +| InvalidRequestError | Any input used to create a request is invalid | +| UnexpectedClientError | Unrecognised or unexpected error | diff --git a/RELEASES.md b/RELEASES.md index 696363c..8999ed9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -179,4 +179,14 @@ Based on: ### Generated - [typescript v0.8.2] . ### Releases -- [NPM v0.8.2] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.8.2 - . \ No newline at end of file +- [NPM v0.8.2] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.8.2 - . + +## 2024-12-16 00:25:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.455.3 (2.479.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.8.3] . +### Releases +- [NPM v0.8.3] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.8.3 - . \ No newline at end of file diff --git a/docs/models/components/signatureaggregationresponse.md b/docs/models/components/signatureaggregationresponse.md new file mode 100644 index 0000000..430baf9 --- /dev/null +++ b/docs/models/components/signatureaggregationresponse.md @@ -0,0 +1,18 @@ +# SignatureAggregationResponse + +## Example Usage + +```typescript +import { SignatureAggregationResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: SignatureAggregationResponse = { + signedMessage: + "0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000103807355b21dd497ecc9f560dfbdefc64aeec72b226c70d3793273db01d1a0c0bfd74d095d6a9e0b4db2dc652245fd28ac032c0f1f6b7f761b912ad58c93cde2e337bef4a4e8175af69f226520cd1baedd2dd7db79bb5752cb50a465531e46e8af", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `signedMessage` | *string* | :heavy_check_mark: | N/A | 0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000103807355b21dd497ecc9f560dfbdefc64aeec72b226c70d3793273db01d1a0c0bfd74d095d6a9e0b4db2dc652245fd28ac032c0f1f6b7f761b912ad58c93cde2e337bef4a4e8175af69f226520cd1baedd2dd7db79bb5752cb50a465531e46e8af | \ No newline at end of file diff --git a/docs/models/components/signatureaggregatorrequest.md b/docs/models/components/signatureaggregatorrequest.md new file mode 100644 index 0000000..301f74d --- /dev/null +++ b/docs/models/components/signatureaggregatorrequest.md @@ -0,0 +1,24 @@ +# SignatureAggregatorRequest + +## Example Usage + +```typescript +import { SignatureAggregatorRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: SignatureAggregatorRequest = { + message: + "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003cc0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000", + justification: "0001abcdabcfff", + signingSubnetId: "7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5", + quorumPercentage: 50, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `message` | *string* | :heavy_check_mark: | N/A | 000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003cc0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000 | +| `justification` | *string* | :heavy_minus_sign: | N/A | 0001abcdabcfff | +| `signingSubnetId` | *string* | :heavy_minus_sign: | N/A | 7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5 | +| `quorumPercentage` | *number* | :heavy_minus_sign: | N/A | 50 | \ No newline at end of file diff --git a/docs/sdks/avacloudsdkchains/README.md b/docs/sdks/avacloudsdkchains/README.md index 0d28732..c603dcf 100644 --- a/docs/sdks/avacloudsdkchains/README.md +++ b/docs/sdks/avacloudsdkchains/README.md @@ -187,7 +187,7 @@ run(); ## getAddressChains -Gets the list of chains an address has interacted with. +Gets a list of all chains where the address was either a sender or receiver in a transaction or ERC transfer. The list is currently updated every 15 minutes. ### Example Usage diff --git a/docs/sdks/signatureaggregator/README.md b/docs/sdks/signatureaggregator/README.md new file mode 100644 index 0000000..e3c391a --- /dev/null +++ b/docs/sdks/signatureaggregator/README.md @@ -0,0 +1,103 @@ +# SignatureAggregator +(*data.signatureAggregator*) + +## Overview + +### Available Operations + +* [aggregateSignatures](#aggregatesignatures) - Aggregate Signatures + +## aggregateSignatures + +Aggregates Signatures for a Warp message from Subnet validators. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.data.signatureAggregator.aggregateSignatures({ + message: "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003cc0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000", + justification: "0001abcdabcfff", + signingSubnetId: "7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5", + quorumPercentage: 50, + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { dataSignatureAggregatorAggregateSignatures } from "@avalabs/avacloud-sdk/funcs/dataSignatureAggregatorAggregateSignatures.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await dataSignatureAggregatorAggregateSignatures(avaCloudSDK, { + message: "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003cc0000000000059f3be606497285d0ffbb5ac9ba24aa60346a9b1812479ed66cb329f394a4b1c7000003a200000000000100000014253b2784c75e510dd0ff1da844684a1ac0aa5fcf00000380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001150000000000000000000000008578ae7723751446b196bd5124e1bf57b40eb7bc7fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000000000000000000000009660ed66aef60dfba5467afe865f612edbfb5c710000000000000000000000000000000000000000000000000000000000014c080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000011a00000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011a20000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011b50000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e80000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000011e90000000000000000000000007ec2afb0a06a73666adc24983ebdbf2b6f1d708200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000001c07f66981b45056e5024eb6d51f9f30aa0d28fd00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000", + justification: "0001abcdabcfff", + signingSubnetId: "7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5", + quorumPercentage: 50, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.SignatureAggregatorRequest](../../models/components/signatureaggregatorrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | + +### Response + +**Promise\<[components.SignatureAggregationResponse](../../models/components/signatureaggregationresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9077718..f4ca764 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@avalabs/avacloud-sdk", - "version": "0.8.2", + "version": "0.8.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@avalabs/avacloud-sdk", - "version": "0.8.2", + "version": "0.8.3", "license": "SEE LICENSE", "dependencies": { "json-canonicalize": "^1.0.6" diff --git a/package.json b/package.json index f5302ab..eef71df 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "@avalabs/avacloud-sdk", - "version": "0.8.2", + "version": "0.8.3", "author": "AvaCloud", - "homepage": "https://developer.avacloud.io/avacloud-sdk/getting-started", "license": "SEE LICENSE", + "homepage": "https://developer.avacloud.io/avacloud-sdk/getting-started", "main": "./index.js", "sideEffects": false, "repository": { diff --git a/src/funcs/dataEvmChainsGetAddressChains.ts b/src/funcs/dataEvmChainsGetAddressChains.ts index 96ba930..c865224 100644 --- a/src/funcs/dataEvmChainsGetAddressChains.ts +++ b/src/funcs/dataEvmChainsGetAddressChains.ts @@ -28,7 +28,7 @@ import { Result } from "../types/fp.js"; * Get chains for address * * @remarks - * Gets the list of chains an address has interacted with. + * Gets a list of all chains where the address was either a sender or receiver in a transaction or ERC transfer. The list is currently updated every 15 minutes. */ export async function dataEvmChainsGetAddressChains( client: AvaCloudSDKCore, diff --git a/src/funcs/dataSignatureAggregatorAggregateSignatures.ts b/src/funcs/dataSignatureAggregatorAggregateSignatures.ts new file mode 100644 index 0000000..b4a8429 --- /dev/null +++ b/src/funcs/dataSignatureAggregatorAggregateSignatures.ts @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { AggregateSignaturesServerList } from "../models/operations/aggregatesignatures.js"; +import { Result } from "../types/fp.js"; + +/** + * Aggregate Signatures + * + * @remarks + * Aggregates Signatures for a Warp message from Subnet validators. + */ +export async function dataSignatureAggregatorAggregateSignatures( + client: AvaCloudSDKCore, + request: components.SignatureAggregatorRequest, + options?: RequestOptions & { serverURL?: string }, +): Promise< + Result< + components.SignatureAggregationResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => + components.SignatureAggregatorRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = encodeJSON("body", payload, { explode: true }); + + const baseURL = options?.serverURL + || pathToFunc(AggregateSignaturesServerList[0], { + charEncoding: "percent", + })(); + + const path = pathToFunc("/v1/signatureAggregator/aggregateSignatures")(); + + const headers = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "aggregateSignatures", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: baseURL, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "429", + "4XX", + "500", + "502", + "503", + "5XX", + ], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.SignatureAggregationResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(201, components.SignatureAggregationResponse$inboundSchema), + M.jsonErr(400, errors.BadRequest$inboundSchema), + M.jsonErr(401, errors.Unauthorized$inboundSchema), + M.jsonErr(403, errors.Forbidden$inboundSchema), + M.jsonErr(404, errors.NotFound$inboundSchema), + M.jsonErr(429, errors.TooManyRequests$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.jsonErr(502, errors.BadGateway$inboundSchema), + M.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index ddfeb6d..ef5301d 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -50,8 +50,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "Beta", - sdkVersion: "0.8.2", - genVersion: "2.474.15", + sdkVersion: "0.8.3", + genVersion: "2.479.3", userAgent: - "speakeasy-sdk/typescript 0.8.2 2.474.15 Beta @avalabs/avacloud-sdk", + "speakeasy-sdk/typescript 0.8.3 2.479.3 Beta @avalabs/avacloud-sdk", } as const; diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 12ac145..7b6ee90 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -189,6 +189,8 @@ export * from "./richaddress.js"; export * from "./rollingwindowmetricsapiresponse.js"; export * from "./security.js"; export * from "./sharedsecretsresponse.js"; +export * from "./signatureaggregationresponse.js"; +export * from "./signatureaggregatorrequest.js"; export * from "./sortbyoption.js"; export * from "./sortorder.js"; export * from "./stakingdistribution.js"; diff --git a/src/models/components/signatureaggregationresponse.ts b/src/models/components/signatureaggregationresponse.ts new file mode 100644 index 0000000..d945e89 --- /dev/null +++ b/src/models/components/signatureaggregationresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SignatureAggregationResponse = { + signedMessage: string; +}; + +/** @internal */ +export const SignatureAggregationResponse$inboundSchema: z.ZodType< + SignatureAggregationResponse, + z.ZodTypeDef, + unknown +> = z.object({ + signedMessage: z.string(), +}); + +/** @internal */ +export type SignatureAggregationResponse$Outbound = { + signedMessage: string; +}; + +/** @internal */ +export const SignatureAggregationResponse$outboundSchema: z.ZodType< + SignatureAggregationResponse$Outbound, + z.ZodTypeDef, + SignatureAggregationResponse +> = z.object({ + signedMessage: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SignatureAggregationResponse$ { + /** @deprecated use `SignatureAggregationResponse$inboundSchema` instead. */ + export const inboundSchema = SignatureAggregationResponse$inboundSchema; + /** @deprecated use `SignatureAggregationResponse$outboundSchema` instead. */ + export const outboundSchema = SignatureAggregationResponse$outboundSchema; + /** @deprecated use `SignatureAggregationResponse$Outbound` instead. */ + export type Outbound = SignatureAggregationResponse$Outbound; +} + +export function signatureAggregationResponseToJSON( + signatureAggregationResponse: SignatureAggregationResponse, +): string { + return JSON.stringify( + SignatureAggregationResponse$outboundSchema.parse( + signatureAggregationResponse, + ), + ); +} + +export function signatureAggregationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SignatureAggregationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SignatureAggregationResponse' from JSON`, + ); +} diff --git a/src/models/components/signatureaggregatorrequest.ts b/src/models/components/signatureaggregatorrequest.ts new file mode 100644 index 0000000..47eda72 --- /dev/null +++ b/src/models/components/signatureaggregatorrequest.ts @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SignatureAggregatorRequest = { + message: string; + justification?: string | undefined; + signingSubnetId?: string | undefined; + quorumPercentage?: number | undefined; +}; + +/** @internal */ +export const SignatureAggregatorRequest$inboundSchema: z.ZodType< + SignatureAggregatorRequest, + z.ZodTypeDef, + unknown +> = z.object({ + message: z.string(), + justification: z.string().optional(), + signingSubnetId: z.string().optional(), + quorumPercentage: z.number().optional(), +}); + +/** @internal */ +export type SignatureAggregatorRequest$Outbound = { + message: string; + justification?: string | undefined; + signingSubnetId?: string | undefined; + quorumPercentage?: number | undefined; +}; + +/** @internal */ +export const SignatureAggregatorRequest$outboundSchema: z.ZodType< + SignatureAggregatorRequest$Outbound, + z.ZodTypeDef, + SignatureAggregatorRequest +> = z.object({ + message: z.string(), + justification: z.string().optional(), + signingSubnetId: z.string().optional(), + quorumPercentage: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SignatureAggregatorRequest$ { + /** @deprecated use `SignatureAggregatorRequest$inboundSchema` instead. */ + export const inboundSchema = SignatureAggregatorRequest$inboundSchema; + /** @deprecated use `SignatureAggregatorRequest$outboundSchema` instead. */ + export const outboundSchema = SignatureAggregatorRequest$outboundSchema; + /** @deprecated use `SignatureAggregatorRequest$Outbound` instead. */ + export type Outbound = SignatureAggregatorRequest$Outbound; +} + +export function signatureAggregatorRequestToJSON( + signatureAggregatorRequest: SignatureAggregatorRequest, +): string { + return JSON.stringify( + SignatureAggregatorRequest$outboundSchema.parse(signatureAggregatorRequest), + ); +} + +export function signatureAggregatorRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SignatureAggregatorRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SignatureAggregatorRequest' from JSON`, + ); +} diff --git a/src/models/operations/aggregatesignatures.ts b/src/models/operations/aggregatesignatures.ts new file mode 100644 index 0000000..eac3ed7 --- /dev/null +++ b/src/models/operations/aggregatesignatures.ts @@ -0,0 +1,7 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export const AggregateSignaturesServerList = [ + "https://glacier-api.avax.network", +] as const; diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index c6f790f..bd74ab5 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -3,6 +3,7 @@ */ export * from "./addaddressestowebhook.js"; +export * from "./aggregatesignatures.js"; export * from "./compositequeryv2.js"; export * from "./createwebhook.js"; export * from "./datahealthcheck.js"; diff --git a/src/sdk/avacloudsdkchains.ts b/src/sdk/avacloudsdkchains.ts index c80938a..a1a9e23 100644 --- a/src/sdk/avacloudsdkchains.ts +++ b/src/sdk/avacloudsdkchains.ts @@ -49,7 +49,7 @@ export class AvaCloudSDKChains extends ClientSDK { * Get chains for address * * @remarks - * Gets the list of chains an address has interacted with. + * Gets a list of all chains where the address was either a sender or receiver in a transaction or ERC transfer. The list is currently updated every 15 minutes. */ async getAddressChains( request: operations.GetAddressChainsRequest, diff --git a/src/sdk/data.ts b/src/sdk/data.ts index 3532f77..314e8e6 100644 --- a/src/sdk/data.ts +++ b/src/sdk/data.ts @@ -8,6 +8,7 @@ import { AvaCloudSDKHealthCheck } from "./avacloudsdkhealthcheck.js"; import { Nfts } from "./nfts.js"; import { Operations } from "./operations.js"; import { PrimaryNetwork } from "./primarynetwork.js"; +import { SignatureAggregator } from "./signatureaggregator.js"; import { Teleporter } from "./teleporter.js"; import { UsageMetrics } from "./usagemetrics.js"; import { Webhooks } from "./webhooks.js"; @@ -48,6 +49,13 @@ export class Data extends ClientSDK { return (this._webhooks ??= new Webhooks(this._options)); } + private _signatureAggregator?: SignatureAggregator; + get signatureAggregator(): SignatureAggregator { + return (this._signatureAggregator ??= new SignatureAggregator( + this._options, + )); + } + private _evm?: AvaCloudSDKEvm; get evm(): AvaCloudSDKEvm { return (this._evm ??= new AvaCloudSDKEvm(this._options)); diff --git a/src/sdk/signatureaggregator.ts b/src/sdk/signatureaggregator.ts new file mode 100644 index 0000000..4ddbc2c --- /dev/null +++ b/src/sdk/signatureaggregator.ts @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { dataSignatureAggregatorAggregateSignatures } from "../funcs/dataSignatureAggregatorAggregateSignatures.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class SignatureAggregator extends ClientSDK { + /** + * Aggregate Signatures + * + * @remarks + * Aggregates Signatures for a Warp message from Subnet validators. + */ + async aggregateSignatures( + request: components.SignatureAggregatorRequest, + options?: RequestOptions & { serverURL?: string }, + ): Promise { + return unwrapAsync(dataSignatureAggregatorAggregateSignatures( + this, + request, + options, + )); + } +}