Skip to content

Commit

Permalink
Merge pull request #20 from ava-labs/speakeasy-sdk-regen-1724969690
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 0.2.0
  • Loading branch information
SayanKar authored Aug 29, 2024
2 parents fe5f6b2 + 95e4699 commit 4a8caca
Show file tree
Hide file tree
Showing 189 changed files with 895 additions and 739 deletions.
15 changes: 8 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 2b9c4bf6-4d87-4382-84d9-5fb3c84c7fad
management:
docChecksum: a3899fcc878e74b37e045c4648cd947e
docChecksum: b7c80728933921cf1fd9ad31274d5ad7
docVersion: Beta
speakeasyVersion: 1.383.0
generationVersion: 2.404.11
releaseVersion: 0.1.0
configChecksum: 9fc60104651d9ae9899527e16e4c7c54
speakeasyVersion: 1.383.2
generationVersion: 2.407.0
releaseVersion: 0.2.0
configChecksum: c0ea7d51e7782a892a23d8b54a7e9bce
repoURL: https://github.com/ava-labs/avacloud-sdk-typescript.git
installationURL: https://github.com/ava-labs/avacloud-sdk-typescript
published: true
Expand Down Expand Up @@ -154,7 +154,7 @@ generatedFiles:
- src/types/operations.ts
- src/types/rfcdate.ts
- tsconfig.json
- src/models/components/network.ts
- src/models/components/globalparamnetwork.ts
- src/models/components/listnfttokens.ts
- src/models/components/erc721token.ts
- src/models/components/erc721tokenmetadata.ts
Expand Down Expand Up @@ -415,7 +415,7 @@ generatedFiles:
- src/models/errors/index.ts
- src/models/components/index.ts
- src/models/operations/index.ts
- docs/models/components/network.md
- docs/models/components/globalparamnetwork.md
- docs/models/components/tokens.md
- docs/models/components/listnfttokens.md
- docs/models/components/erctype.md
Expand Down Expand Up @@ -725,6 +725,7 @@ generatedFiles:
- docs/models/operations/getvertexbyheightresponse.md
- docs/models/operations/requesttype.md
- docs/models/operations/getapiusagemetricsrequest.md
- docs/models/operations/queryparamrequesttype.md
- docs/models/operations/getapilogsrequest.md
- docs/models/operations/getapilogsresponse.md
- docs/models/operations/listwebhooksrequest.md
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.1.0
version: 0.2.0
additionalDependencies:
dependencies:
json-canonicalize: ^1.0.6
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.383.0
speakeasyVersion: 1.383.2
sources:
AvaCloudSDK-OAS:
sourceNamespace: avacloud-sdk-oas
sourceRevisionDigest: sha256:94b1a02f955836abaa8ede312ba38532983313de6baf0adfb4d8759cb63dc832
sourceBlobDigest: sha256:05214b8e100c927f60abd8625944d8e60680d0296132e8a4b1a41deab911a3e0
sourceRevisionDigest: sha256:303aa83897a990f12523549cb34e55ac639a264aab65f09c0107fe21320ca0b2
sourceBlobDigest: sha256:7bdbf020c983454ba41e539bdc06708e421d942e068f9a18f85b5f4978ff7c9b
tags:
- latest
- main
Expand All @@ -18,10 +18,10 @@ targets:
avacloud-sdk:
source: AvaCloudSDK-OAS
sourceNamespace: avacloud-sdk-oas
sourceRevisionDigest: sha256:94b1a02f955836abaa8ede312ba38532983313de6baf0adfb4d8759cb63dc832
sourceBlobDigest: sha256:05214b8e100c927f60abd8625944d8e60680d0296132e8a4b1a41deab911a3e0
sourceRevisionDigest: sha256:303aa83897a990f12523549cb34e55ac639a264aab65f09c0107fe21320ca0b2
sourceBlobDigest: sha256:7bdbf020c983454ba41e539bdc06708e421d942e068f9a18f85b5f4978ff7c9b
codeSamplesNamespace: avacloud-sdk-ts-code-samples
codeSamplesRevisionDigest: sha256:0911e97a6dd81a90e02d580e242156e513e3784bd0e90b46f1664ac6e2e8ad11
codeSamplesRevisionDigest: sha256:2b497ef2942c118b71bb1b43d19a997370056ee9fe04cc654b294895b01ddb31
outLocation: /github/workspace/repo
avalanche-sdk:
source: AvalancheSDK-OAS
Expand Down
2 changes: 1 addition & 1 deletion FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { SDKValidationError } from "@avalabs/avacloud-sdk/models/errors/sdkvalid
// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down
106 changes: 75 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<!-- Start SDK Installation [installation] -->
## SDK Installation

The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.

### NPM

```bash
Expand Down Expand Up @@ -51,7 +53,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -292,7 +294,7 @@ The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| chainId | string | | A supported EVM chain id, chain alias, or blockchain id. |
| network | components.Network | | A supported network type mainnet or a testnet. |
| network | components.GlobalParamNetwork | | A supported network type mainnet or a testnet. |


### Example
Expand All @@ -301,7 +303,7 @@ The following global parameters are available.
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -334,7 +336,7 @@ Here's an example of one such pagination call:
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -366,7 +368,7 @@ To change the default retry strategy for a single API call, simply provide a ret
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -408,7 +410,7 @@ const avaCloudSDK = new AvaCloudSDK({
},
retryConnectionErrors: false,
},
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -447,10 +449,20 @@ Validation errors can also occur when either method arguments or data returned f

```typescript
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
import { SDKValidationError } from "@avalabs/avacloud-sdk/models/errors";
import {
BadGateway,
BadRequest,
Forbidden,
InternalServerError,
NotFound,
SDKValidationError,
ServiceUnavailable,
TooManyRequests,
Unauthorized,
} from "@avalabs/avacloud-sdk/models/errors";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand All @@ -470,36 +482,44 @@ async function run() {
console.error(err.rawValue);
return;
}
case err instanceof errors.BadRequest: {
console.error(err); // handle exception
case err instanceof BadRequest: {
// Handle err.data$: BadRequestData
console.error(err);
return;
}
case err instanceof errors.Unauthorized: {
console.error(err); // handle exception
case err instanceof Unauthorized: {
// Handle err.data$: UnauthorizedData
console.error(err);
return;
}
case err instanceof errors.Forbidden: {
console.error(err); // handle exception
case err instanceof Forbidden: {
// Handle err.data$: ForbiddenData
console.error(err);
return;
}
case err instanceof errors.NotFound: {
console.error(err); // handle exception
case err instanceof NotFound: {
// Handle err.data$: NotFoundData
console.error(err);
return;
}
case err instanceof errors.TooManyRequests: {
console.error(err); // handle exception
case err instanceof TooManyRequests: {
// Handle err.data$: TooManyRequestsData
console.error(err);
return;
}
case err instanceof errors.InternalServerError: {
console.error(err); // handle exception
case err instanceof InternalServerError: {
// Handle err.data$: InternalServerErrorData
console.error(err);
return;
}
case err instanceof errors.BadGateway: {
console.error(err); // handle exception
case err instanceof BadGateway: {
// Handle err.data$: BadGatewayData
console.error(err);
return;
}
case err instanceof errors.ServiceUnavailable: {
console.error(err); // handle exception
case err instanceof ServiceUnavailable: {
// Handle err.data$: ServiceUnavailableData
console.error(err);
return;
}
default: {
Expand Down Expand Up @@ -530,7 +550,7 @@ import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
serverIdx: 0,
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand All @@ -556,7 +576,7 @@ import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
serverURL: "https://glacier-api.avax.network",
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -629,16 +649,16 @@ const sdk = new AvaCloudSDK({ httpClient });

This SDK supports the following security scheme globally:

| Name | Type | Scheme |
| --------------- | --------------- | --------------- |
| `glacierApiKey` | apiKey | API key |
| Name | Type | Scheme |
| -------- | -------- | -------- |
| `apiKey` | apiKey | API key |

To authenticate with the API the `glacierApiKey` parameter must be set when initializing the SDK client instance. For example:
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
```typescript
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down Expand Up @@ -672,6 +692,30 @@ const sdk = new AvaCloudSDK({ debugLogger: console });
```
<!-- End Debugging [debug] -->

<!-- Start Summary [summary] -->
## Summary

Glacier API: The Glacier API provides web3 application developers with multi-chain data related to Avalanche's primary network, Avalanche subnets, and Ethereum. With Glacier, you can easily build products that leverage real-time and historical transaction and transfer history, native and token balances, and various types of token metadata. The API is in Beta and may be subject to change.</br></br>If you have feedback or feature requests for the API, please submit them <a href="https://portal.productboard.com/dndv9ahlkdfye4opdm8ksafi/tabs/4-glacier-api">here</a>. Bug reports can be submitted <a href="https://docs.google.com/forms/d/e/1FAIpQLSeJQrcp7QoNiqozMDKrVJGX5wpU827d3cVTgF8qa7t_J1Pb-g/viewform">here</a>, and any potential security issues can be reported <a href="https://immunefi.com/bounty/avalabs">here</a>.
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents

* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [Global Parameters](#global-parameters)
* [Pagination](#pagination)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Authentication](#authentication)
* [Debugging](#debugging)
<!-- End Table of Contents [toc] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

## Verify Webhook Signature
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ Based on:
### Generated
- [typescript v0.1.0] .
### Releases
- [NPM v0.1.0] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.1.0 - .
- [NPM v0.1.0] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.1.0 - .

## 2024-08-29 22:14:46
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.383.2 (2.407.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.2.0] .
### Releases
- [NPM v0.2.0] https://www.npmjs.com/package/@avalabs/avacloud-sdk/v/0.2.0 - .
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
glacierApiKey: "<YOUR_API_KEY_HERE>",
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
Expand Down
15 changes: 15 additions & 0 deletions docs/models/components/globalparamnetwork.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GlobalParamNetwork

## Example Usage

```typescript
import { GlobalParamNetwork } from "@avalabs/avacloud-sdk/models/components";

let value: GlobalParamNetwork = "mainnet";
```

## Values

```typescript
"mainnet" | "fuji"
```
15 changes: 0 additions & 15 deletions docs/models/components/network.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/models/components/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import { Security } from "@avalabs/avacloud-sdk/models/components";

let value: Security = {
glacierApiKey: "<value>",
apiKey: "<value>",
};
```

## Fields

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `glacierApiKey` | *string* | :heavy_check_mark: | N/A |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
2 changes: 1 addition & 1 deletion docs/models/components/timeintervalgranularityextended.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```typescript
import { TimeIntervalGranularityExtended } from "@avalabs/avacloud-sdk/models/components";

let value: TimeIntervalGranularityExtended = "hourly";
let value: TimeIntervalGranularityExtended = "daily";
```

## Values
Expand Down
Loading

0 comments on commit 4a8caca

Please sign in to comment.