Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #304

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ yarn-error.log
codegen.log
Brewfile.lock.json
dist
/deno
dist-deno
/*.tgz
.idea/

2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-46d8eab626e61bba9c77116adbcfcbc34a35b2742976789e9f3643f399386f2c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-68190ea619cfe126cdb1d0d08d55d0701e87c1cb45aaaf714807e2fc0bdde5e6.yml
3 changes: 0 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">DelegatedAssetDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">FungibleMintAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">InstructionErrorDetails</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeSolDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeSolDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeSolOwnershipDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NonFungibleMintAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">PdaAccountSchema</a></code>
Expand All @@ -115,7 +113,6 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplTokenOwnershipDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">StakedSolAssetDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">StakedSolWithdrawAuthorityDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SuccessfulSimulationResultSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SystemAccountDetailsSchema</a></code>
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs
(cd dist && node -e 'require("@blockaid/client")')
(cd dist && node -e 'import("@blockaid/client")' --input-type=module)

if command -v deno &> /dev/null && [ -e ./scripts/build-deno ]
if [ -e ./scripts/build-deno ]
then
./scripts/build-deno
fi
10 changes: 5 additions & 5 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export abstract class APIClient {
error: Object | undefined,
message: string | undefined,
headers: Headers | undefined,
) {
): APIError {
return APIError.generate(status, error, message, headers);
}

Expand Down Expand Up @@ -668,17 +668,17 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
}

async *iterPages() {
async *iterPages(): AsyncGenerator<this> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
let page: AbstractPage<Item> = this;
let page: this = this;
yield page;
while (page.hasNextPage()) {
page = await page.getNextPage();
yield page;
}
}

async *[Symbol.asyncIterator]() {
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
for await (const page of this.iterPages()) {
for (const item of page.getPaginatedItems()) {
yield item;
Expand Down Expand Up @@ -721,7 +721,7 @@ export class PagePromise<
* console.log(item)
* }
*/
async *[Symbol.asyncIterator]() {
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
const page = await this;
for await (const item of page) {
yield item;
Expand Down
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class APIError extends BlockaidError {
errorResponse: Object | undefined,
message: string | undefined,
headers: Headers | undefined,
) {
): APIError {
if (!status) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
Expand Down
Loading