From ed0966a2a6beca0856af47ea3fe6a1cffe6c2ae0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:18:17 +0000 Subject: [PATCH 01/65] feat(api): api update (#48) --- .stats.yml | 2 +- src/core.ts | 10 +- src/resources/networks/destinations.ts | 4 + src/resources/networks/sources.ts | 4 + src/resources/shared.ts | 4 + tests/index.test.ts | 33 +++++ yarn.lock | 180 +++++++++++++------------ 7 files changed, 145 insertions(+), 92 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff4e6b1..3e13201 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-51e6a70f180aa4a52100b960f947e06f17a84d5eed17d045fef672e3b8b6773a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-581e9b337081912f6873b17be51259c162a9eaa7db86f2ae3488963c225680c5.yml diff --git a/src/core.ts b/src/core.ts index f9790b5..b1c108d 100644 --- a/src/core.ts +++ b/src/core.ts @@ -351,9 +351,13 @@ export abstract class APIClient { delete reqHeaders['content-type']; } - // Don't set the retry count header if it was already set or removed by the caller. We check `headers`, - // which can contain nulls, instead of `reqHeaders` to account for the removal case. - if (getHeader(headers, 'x-stainless-retry-count') === undefined) { + // Don't set the retry count header if it was already set or removed through default headers or by the + // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to + // account for the removal case. + if ( + getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && + getHeader(headers, 'x-stainless-retry-count') === undefined + ) { reqHeaders['x-stainless-retry-count'] = String(retryCount); } diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 208d371..d7913a9 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -63,6 +63,8 @@ export namespace DestinationListResponse { decimals?: number; + destination_rank?: number; + display_asset?: string; listing_date?: string; @@ -75,6 +77,8 @@ export namespace DestinationListResponse { refuel?: SwapsAPI.TokenWithAmount; + source_rank?: number; + status?: string; symbol?: string; diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index d32632b..f4464e1 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -60,6 +60,8 @@ export namespace SourceListResponse { decimals?: number; + destination_rank?: number; + display_asset?: string; listing_date?: string; @@ -72,6 +74,8 @@ export namespace SourceListResponse { refuel?: SwapsAPI.TokenWithAmount; + source_rank?: number; + status?: string; symbol?: string; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 7c07f50..04b0000 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -71,6 +71,8 @@ export interface Token { decimals?: number; + destination_rank?: number; + display_asset?: string; listing_date?: string; @@ -81,5 +83,7 @@ export interface Token { price_in_usd?: number; + source_rank?: number; + symbol?: string; } diff --git a/tests/index.test.ts b/tests/index.test.ts index 2c45124..0a2032a 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -295,6 +295,39 @@ describe('retries', () => { expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); }); + test('omit retry count header by default', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Layerswap({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + defaultHeaders: { 'X-Stainless-Retry-Count': null }, + }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + }), + ).toEqual({ a: 1 }); + + expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); + }); + test('overwrite retry count header', async () => { let count = 0; let capturedRequest: RequestInit | undefined; diff --git a/yarn.lock b/yarn.lock index 10ebd6d..14e8a75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -322,9 +322,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.5.1": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.0.tgz#7ccb5f58703fa61ffdcbf39e2c604a109e781162" - integrity sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ== + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== "@eslint-community/regexpp@^4.6.1": version "4.6.2" @@ -857,9 +857,9 @@ pretty-format "^29.0.0" "@types/json-schema@^7.0.12": - version "7.0.13" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" - integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": version "2.6.4" @@ -882,9 +882,9 @@ integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/semver@^7.5.0": - version "7.5.3" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" - integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== "@types/stack-utils@^2.0.0": version "2.0.3" @@ -904,15 +904,15 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz#d98046e9f7102d49a93d944d413c6055c47fafd7" - integrity sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA== + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" + integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/type-utils" "6.7.3" - "@typescript-eslint/utils" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/type-utils" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -921,71 +921,72 @@ ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.3.tgz#aaf40092a32877439e5957e18f2d6a91c82cc2fd" - integrity sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ== - dependencies: - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz#07e5709c9bdae3eaf216947433ef97b3b8b7d755" - integrity sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ== +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/type-utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz#c2c165c135dda68a5e70074ade183f5ad68f3400" - integrity sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw== +"@typescript-eslint/type-utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" + integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== dependencies: - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/utils" "6.7.3" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/utils" "6.21.0" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.3.tgz#0402b5628a63f24f2dc9d4a678e9a92cc50ea3e9" - integrity sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw== +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/typescript-estree@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz#ec5bb7ab4d3566818abaf0e4a8fa1958561b7279" - integrity sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g== +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" + minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.3.tgz#96c655816c373135b07282d67407cb577f62e143" - integrity sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg== +"@typescript-eslint/utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" + integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz#83809631ca12909bd2083558d2f93f5747deebb2" - integrity sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg== +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== dependencies: - "@typescript-eslint/types" "6.7.3" + "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" abort-controller@^3.0.0: @@ -1392,13 +1393,20 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + dedent@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" @@ -1546,12 +1554,7 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" - integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== - -eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -1709,18 +1712,7 @@ fast-glob@^3.2.12: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.3.0: +fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1742,9 +1734,9 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== dependencies: reusify "^1.0.4" @@ -1967,9 +1959,9 @@ iconv-lite@^0.6.3: safer-buffer ">= 2.1.2 < 3.0.0" ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== import-fresh@^3.2.1: version "3.3.0" @@ -2674,6 +2666,13 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2703,7 +2702,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -3058,13 +3057,18 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3261,9 +3265,9 @@ tr46@~0.0.3: integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= ts-api-utils@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" - integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.1.0: version "29.1.1" From 18ae7ab86f32a446008d3be6b52317b3b74f22e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:18:29 +0000 Subject: [PATCH 02/65] feat(api): api update (#50) --- .gitignore | 2 +- .stats.yml | 2 +- package.json | 2 +- scripts/build | 2 +- src/core.ts | 10 +-- src/error.ts | 2 +- src/index.ts | 86 ++++++++++++++++---------- src/resources/index.ts | 24 +++---- src/resources/networks/destinations.ts | 23 +++++-- src/resources/networks/index.ts | 6 +- src/resources/networks/networks.ts | 31 ++++++---- src/resources/networks/sources.ts | 20 ++++-- src/resources/shared.ts | 24 ++++++- src/resources/swaps/deposit-actions.ts | 9 +-- src/resources/swaps/index.ts | 32 +++++----- src/resources/swaps/limits.ts | 6 +- src/resources/swaps/quote.ts | 11 ++-- src/resources/swaps/swaps.ts | 63 ++++++++++++------- tsconfig.deno.json | 11 +--- tsconfig.json | 3 +- 20 files changed, 229 insertions(+), 140 deletions(-) diff --git a/.gitignore b/.gitignore index 3eed6dd..d98d51a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ yarn-error.log codegen.log Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ diff --git a/.stats.yml b/.stats.yml index 3e13201..594755e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-581e9b337081912f6873b17be51259c162a9eaa7db86f2ae3488963c225680c5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-c29e92915628beaa7c7bca046ce0133a010bd77bbaa6f55372814f96c5ef535c.yml diff --git a/package.json b/package.json index f3f9ac8..ca761f9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, "scripts": { diff --git a/scripts/build b/scripts/build index d3911df..be56b67 100755 --- a/scripts/build +++ b/scripts/build @@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs (cd dist && node -e 'require("@layerswap/sdk")') (cd dist && node -e 'import("@layerswap/sdk")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] +if [ -e ./scripts/build-deno ] then ./scripts/build-deno fi diff --git a/src/core.ts b/src/core.ts index b1c108d..5b303c4 100644 --- a/src/core.ts +++ b/src/core.ts @@ -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); } @@ -668,9 +668,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -678,7 +678,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -721,7 +721,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; diff --git a/src/error.ts b/src/error.ts index c7c3cd9..c9d9c13 100644 --- a/src/error.ts +++ b/src/error.ts @@ -47,7 +47,7 @@ export class APIError extends LayerswapError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { if (!status) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } diff --git a/src/index.ts b/src/index.ts index 61f4b30..4fcce0e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,27 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Errors from './error'; -import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; import * as qs from './internal/qs'; import * as Core from './core'; +import * as Errors from './error'; +import * as Uploads from './uploads'; import * as API from './resources/index'; +import { Health } from './resources/health'; +import { NetworkListParams, NetworkListResponse, Networks } from './resources/networks/networks'; +import { + PreparedSwapResponse, + Swap, + SwapCreateParams, + SwapCreateResponse, + SwapListParams, + SwapListResponse, + SwapQuoteResponse, + SwapResponse, + SwapRetrieveParams, + SwapRetrieveResponse, + Swaps, + TokenWithAmount, +} from './resources/swaps/swaps'; export interface ClientOptions { /** @@ -164,7 +180,7 @@ export class Layerswap extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export const { +export { LayerswapError, APIError, APIConnectionError, @@ -178,38 +194,46 @@ export const { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} = Errors; +} from './error'; export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; -export namespace Layerswap { - export import RequestOptions = Core.RequestOptions; - - export import Health = API.Health; - - export import Swaps = API.Swaps; - export import PreparedSwapResponse = API.PreparedSwapResponse; - export import Swap = API.Swap; - export import SwapQuoteResponse = API.SwapQuoteResponse; - export import SwapResponse = API.SwapResponse; - export import TokenWithAmount = API.TokenWithAmount; - export import SwapCreateResponse = API.SwapCreateResponse; - export import SwapRetrieveResponse = API.SwapRetrieveResponse; - export import SwapListResponse = API.SwapListResponse; - export import SwapCreateParams = API.SwapCreateParams; - export import SwapRetrieveParams = API.SwapRetrieveParams; - export import SwapListParams = API.SwapListParams; - - export import Networks = API.Networks; - export import NetworkListResponse = API.NetworkListResponse; - export import NetworkListParams = API.NetworkListParams; - - export import APIError = API.APIError; - export import Network = API.Network; - export import NetworkMetadata = API.NetworkMetadata; - export import NetworkWithTokens = API.NetworkWithTokens; - export import Token = API.Token; +Layerswap.Health = Health; +Layerswap.Swaps = Swaps; +Layerswap.Networks = Networks; + +export declare namespace Layerswap { + export type RequestOptions = Core.RequestOptions; + + export { Health as Health }; + + export { + Swaps as Swaps, + type PreparedSwapResponse as PreparedSwapResponse, + type Swap as Swap, + type SwapQuoteResponse as SwapQuoteResponse, + type SwapResponse as SwapResponse, + type TokenWithAmount as TokenWithAmount, + type SwapCreateResponse as SwapCreateResponse, + type SwapRetrieveResponse as SwapRetrieveResponse, + type SwapListResponse as SwapListResponse, + type SwapCreateParams as SwapCreateParams, + type SwapRetrieveParams as SwapRetrieveParams, + type SwapListParams as SwapListParams, + }; + + export { + Networks as Networks, + type NetworkListResponse as NetworkListResponse, + type NetworkListParams as NetworkListParams, + }; + + export type APIError = API.APIError; + export type Network = API.Network; + export type NetworkMetadata = API.NetworkMetadata; + export type NetworkWithTokens = API.NetworkWithTokens; + export type Token = API.Token; } export default Layerswap; diff --git a/src/resources/index.ts b/src/resources/index.ts index 6b021f4..de83916 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -2,18 +2,18 @@ export * from './shared'; export { Health } from './health'; -export { NetworkListResponse, NetworkListParams, Networks } from './networks/networks'; +export { Networks, type NetworkListResponse, type NetworkListParams } from './networks/networks'; export { - PreparedSwapResponse, - Swap, - SwapQuoteResponse, - SwapResponse, - TokenWithAmount, - SwapCreateResponse, - SwapRetrieveResponse, - SwapListResponse, - SwapCreateParams, - SwapRetrieveParams, - SwapListParams, Swaps, + type PreparedSwapResponse, + type Swap, + type SwapQuoteResponse, + type SwapResponse, + type TokenWithAmount, + type SwapCreateResponse, + type SwapRetrieveResponse, + type SwapListResponse, + type SwapCreateParams, + type SwapRetrieveParams, + type SwapListParams, } from './swaps/swaps'; diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index d7913a9..5a8aedc 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as DestinationsAPI from './destinations'; import * as Shared from '../shared'; import * as SwapsAPI from '../swaps/swaps'; @@ -54,7 +53,17 @@ export namespace DestinationListResponse { transaction_explorer_template?: string; - type?: 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron'; + type?: + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel'; } export namespace Data { @@ -94,7 +103,7 @@ export interface DestinationListParams { include_unmatched?: boolean; network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' + 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' >; source_network?: string; @@ -102,7 +111,9 @@ export interface DestinationListParams { source_token?: string; } -export namespace Destinations { - export import DestinationListResponse = DestinationsAPI.DestinationListResponse; - export import DestinationListParams = DestinationsAPI.DestinationListParams; +export declare namespace Destinations { + export { + type DestinationListResponse as DestinationListResponse, + type DestinationListParams as DestinationListParams, + }; } diff --git a/src/resources/networks/index.ts b/src/resources/networks/index.ts index 7934a5f..bb15700 100644 --- a/src/resources/networks/index.ts +++ b/src/resources/networks/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DestinationListResponse, DestinationListParams, Destinations } from './destinations'; -export { NetworkListResponse, NetworkListParams, Networks } from './networks'; -export { SourceListResponse, SourceListParams, Sources } from './sources'; +export { Destinations, type DestinationListResponse, type DestinationListParams } from './destinations'; +export { Networks, type NetworkListResponse, type NetworkListParams } from './networks'; +export { Sources, type SourceListResponse, type SourceListParams } from './sources'; diff --git a/src/resources/networks/networks.ts b/src/resources/networks/networks.ts index 5dc8f0e..0ae64f4 100644 --- a/src/resources/networks/networks.ts +++ b/src/resources/networks/networks.ts @@ -3,10 +3,11 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as NetworksAPI from './networks'; import * as Shared from '../shared'; import * as DestinationsAPI from './destinations'; +import { DestinationListParams, DestinationListResponse, Destinations } from './destinations'; import * as SourcesAPI from './sources'; +import { SourceListParams, SourceListResponse, Sources } from './sources'; export class Networks extends APIResource { sources: SourcesAPI.Sources = new SourcesAPI.Sources(this._client); @@ -33,17 +34,25 @@ export interface NetworkListResponse { export interface NetworkListParams { network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' + 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' >; } -export namespace Networks { - export import NetworkListResponse = NetworksAPI.NetworkListResponse; - export import NetworkListParams = NetworksAPI.NetworkListParams; - export import Sources = SourcesAPI.Sources; - export import SourceListResponse = SourcesAPI.SourceListResponse; - export import SourceListParams = SourcesAPI.SourceListParams; - export import Destinations = DestinationsAPI.Destinations; - export import DestinationListResponse = DestinationsAPI.DestinationListResponse; - export import DestinationListParams = DestinationsAPI.DestinationListParams; +Networks.Sources = Sources; +Networks.Destinations = Destinations; + +export declare namespace Networks { + export { type NetworkListResponse as NetworkListResponse, type NetworkListParams as NetworkListParams }; + + export { + Sources as Sources, + type SourceListResponse as SourceListResponse, + type SourceListParams as SourceListParams, + }; + + export { + Destinations as Destinations, + type DestinationListResponse as DestinationListResponse, + type DestinationListParams as DestinationListParams, + }; } diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index f4464e1..b14bec8 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as SourcesAPI from './sources'; import * as Shared from '../shared'; import * as SwapsAPI from '../swaps/swaps'; @@ -51,7 +50,17 @@ export namespace SourceListResponse { transaction_explorer_template?: string; - type?: 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron'; + type?: + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel'; } export namespace Data { @@ -95,11 +104,10 @@ export interface SourceListParams { include_unmatched?: boolean; network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' + 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' >; } -export namespace Sources { - export import SourceListResponse = SourcesAPI.SourceListResponse; - export import SourceListParams = SourcesAPI.SourceListParams; +export declare namespace Sources { + export { type SourceListResponse as SourceListResponse, type SourceListParams as SourceListParams }; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 04b0000..9b49bc6 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -29,7 +29,17 @@ export interface Network { transaction_explorer_template?: string; - type?: 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron'; + type?: + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel'; } export interface NetworkMetadata { @@ -63,7 +73,17 @@ export interface NetworkWithTokens { transaction_explorer_template?: string; - type?: 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron'; + type?: + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel'; } export interface Token { diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index 1c50567..e650299 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as DepositActionsAPI from './deposit-actions'; import * as Shared from '../shared'; export class DepositActions extends APIResource { @@ -57,7 +56,9 @@ export interface DepositActionListParams { source_address?: string; } -export namespace DepositActions { - export import ListTransferDepositAction = DepositActionsAPI.ListTransferDepositAction; - export import DepositActionListParams = DepositActionsAPI.DepositActionListParams; +export declare namespace DepositActions { + export { + type ListTransferDepositAction as ListTransferDepositAction, + type DepositActionListParams as DepositActionListParams, + }; } diff --git a/src/resources/swaps/index.ts b/src/resources/swaps/index.ts index 77ff770..c1491b6 100644 --- a/src/resources/swaps/index.ts +++ b/src/resources/swaps/index.ts @@ -1,19 +1,23 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { LimitListResponse, LimitListParams, Limits } from './limits'; -export { ListTransferDepositAction, DepositActionListParams, DepositActions } from './deposit-actions'; export { - PreparedSwapResponse, - Swap, - SwapQuoteResponse, - SwapResponse, - TokenWithAmount, - SwapCreateResponse, - SwapRetrieveResponse, - SwapListResponse, - SwapCreateParams, - SwapRetrieveParams, - SwapListParams, + DepositActions, + type ListTransferDepositAction, + type DepositActionListParams, +} from './deposit-actions'; +export { Limits, type LimitListResponse, type LimitListParams } from './limits'; +export { QuoteResource, type Quote, type QuoteRetrieveResponse, type QuoteRetrieveParams } from './quote'; +export { Swaps, + type PreparedSwapResponse, + type Swap, + type SwapQuoteResponse, + type SwapResponse, + type TokenWithAmount, + type SwapCreateResponse, + type SwapRetrieveResponse, + type SwapListResponse, + type SwapCreateParams, + type SwapRetrieveParams, + type SwapListParams, } from './swaps'; -export { Quote, QuoteRetrieveResponse, QuoteRetrieveParams, QuoteResource } from './quote'; diff --git a/src/resources/swaps/limits.ts b/src/resources/swaps/limits.ts index ca74dd9..95956fa 100644 --- a/src/resources/swaps/limits.ts +++ b/src/resources/swaps/limits.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as LimitsAPI from './limits'; import * as Shared from '../shared'; export class Limits extends APIResource { @@ -43,7 +42,6 @@ export interface LimitListParams { use_deposit_address?: boolean; } -export namespace Limits { - export import LimitListResponse = LimitsAPI.LimitListResponse; - export import LimitListParams = LimitsAPI.LimitListParams; +export declare namespace Limits { + export { type LimitListResponse as LimitListResponse, type LimitListParams as LimitListParams }; } diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 91f039c..4f8e25d 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as QuoteAPI from './quote'; import * as Shared from '../shared'; import * as SwapsAPI from './swaps'; @@ -69,8 +68,10 @@ export interface QuoteRetrieveParams { use_deposit_address?: boolean; } -export namespace QuoteResource { - export import Quote = QuoteAPI.Quote; - export import QuoteRetrieveResponse = QuoteAPI.QuoteRetrieveResponse; - export import QuoteRetrieveParams = QuoteAPI.QuoteRetrieveParams; +export declare namespace QuoteResource { + export { + type Quote as Quote, + type QuoteRetrieveResponse as QuoteRetrieveResponse, + type QuoteRetrieveParams as QuoteRetrieveParams, + }; } diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index c641fe8..dcebe75 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -3,11 +3,13 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as SwapsAPI from './swaps'; import * as Shared from '../shared'; import * as DepositActionsAPI from './deposit-actions'; +import { DepositActionListParams, DepositActions, ListTransferDepositAction } from './deposit-actions'; import * as LimitsAPI from './limits'; +import { LimitListParams, LimitListResponse, Limits } from './limits'; import * as QuoteAPI from './quote'; +import { Quote, QuoteResource, QuoteRetrieveParams, QuoteRetrieveResponse } from './quote'; export class Swaps extends APIResource { depositActions: DepositActionsAPI.DepositActions = new DepositActionsAPI.DepositActions(this._client); @@ -286,26 +288,41 @@ export interface SwapListParams { page?: number; } -export namespace Swaps { - export import PreparedSwapResponse = SwapsAPI.PreparedSwapResponse; - export import Swap = SwapsAPI.Swap; - export import SwapQuoteResponse = SwapsAPI.SwapQuoteResponse; - export import SwapResponse = SwapsAPI.SwapResponse; - export import TokenWithAmount = SwapsAPI.TokenWithAmount; - export import SwapCreateResponse = SwapsAPI.SwapCreateResponse; - export import SwapRetrieveResponse = SwapsAPI.SwapRetrieveResponse; - export import SwapListResponse = SwapsAPI.SwapListResponse; - export import SwapCreateParams = SwapsAPI.SwapCreateParams; - export import SwapRetrieveParams = SwapsAPI.SwapRetrieveParams; - export import SwapListParams = SwapsAPI.SwapListParams; - export import DepositActions = DepositActionsAPI.DepositActions; - export import ListTransferDepositAction = DepositActionsAPI.ListTransferDepositAction; - export import DepositActionListParams = DepositActionsAPI.DepositActionListParams; - export import Limits = LimitsAPI.Limits; - export import LimitListResponse = LimitsAPI.LimitListResponse; - export import LimitListParams = LimitsAPI.LimitListParams; - export import QuoteResource = QuoteAPI.QuoteResource; - export import Quote = QuoteAPI.Quote; - export import QuoteRetrieveResponse = QuoteAPI.QuoteRetrieveResponse; - export import QuoteRetrieveParams = QuoteAPI.QuoteRetrieveParams; +Swaps.DepositActions = DepositActions; +Swaps.Limits = Limits; +Swaps.QuoteResource = QuoteResource; + +export declare namespace Swaps { + export { + type PreparedSwapResponse as PreparedSwapResponse, + type Swap as Swap, + type SwapQuoteResponse as SwapQuoteResponse, + type SwapResponse as SwapResponse, + type TokenWithAmount as TokenWithAmount, + type SwapCreateResponse as SwapCreateResponse, + type SwapRetrieveResponse as SwapRetrieveResponse, + type SwapListResponse as SwapListResponse, + type SwapCreateParams as SwapCreateParams, + type SwapRetrieveParams as SwapRetrieveParams, + type SwapListParams as SwapListParams, + }; + + export { + DepositActions as DepositActions, + type ListTransferDepositAction as ListTransferDepositAction, + type DepositActionListParams as DepositActionListParams, + }; + + export { + Limits as Limits, + type LimitListResponse as LimitListResponse, + type LimitListParams as LimitListParams, + }; + + export { + QuoteResource as QuoteResource, + type Quote as Quote, + type QuoteRetrieveResponse as QuoteRetrieveResponse, + type QuoteRetrieveParams as QuoteRetrieveParams, + }; } diff --git a/tsconfig.deno.json b/tsconfig.deno.json index 5ed5d59..849e070 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -1,19 +1,14 @@ { "extends": "./tsconfig.json", - "include": ["deno"], + "include": ["dist-deno"], "exclude": [], "compilerOptions": { - "rootDir": "./deno", + "rootDir": "./dist-deno", "lib": ["es2020", "DOM"], - "paths": { - "@layerswap/sdk/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "@layerswap/sdk/*": ["deno/*"], - "@layerswap/sdk": ["deno/index.ts"], - }, "noEmit": true, "declaration": true, "declarationMap": true, - "outDir": "deno", + "outDir": "dist-deno", "pretty": true, "sourceMap": true } diff --git a/tsconfig.json b/tsconfig.json index 88f090d..7690275 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "paths": { "@layerswap/sdk/_shims/auto/*": ["src/_shims/auto/*-node"], "@layerswap/sdk/*": ["src/*"], - "@layerswap/sdk": ["src/index.ts"], + "@layerswap/sdk": ["src/index.ts"] }, "noEmit": true, @@ -32,6 +32,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, + "isolatedModules": false, "skipLibCheck": true } From ed663ff480a2ce0a85ec6a3cda02f035187eadb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:23:49 +0000 Subject: [PATCH 03/65] chore: rebuild project due to codegen change (#51) --- src/index.ts | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4fcce0e..dfc0e98 100644 --- a/src/index.ts +++ b/src/index.ts @@ -180,29 +180,9 @@ export class Layerswap extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export { - LayerswapError, - APIError, - APIConnectionError, - APIConnectionTimeoutError, - APIUserAbortError, - NotFoundError, - ConflictError, - RateLimitError, - BadRequestError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, -} from './error'; - -export import toFile = Uploads.toFile; -export import fileFromPath = Uploads.fileFromPath; - Layerswap.Health = Health; Layerswap.Swaps = Swaps; Layerswap.Networks = Networks; - export declare namespace Layerswap { export type RequestOptions = Core.RequestOptions; @@ -236,4 +216,21 @@ export declare namespace Layerswap { export type Token = API.Token; } +export { toFile, fileFromPath } from '@layerswap/sdk/uploads'; +export { + LayerswapError, + APIError, + APIConnectionError, + APIConnectionTimeoutError, + APIUserAbortError, + NotFoundError, + ConflictError, + RateLimitError, + BadRequestError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, +} from '@layerswap/sdk/error'; + export default Layerswap; From d8a9c360e5f7018fc986638e4b60abf8f306fc2f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:04:50 +0000 Subject: [PATCH 04/65] chore: rebuild project due to codegen change (#52) --- package.json | 1 - src/index.ts | 4 ++-- yarn.lock | 40 ---------------------------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index ca761f9..db63c98 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", diff --git a/src/index.ts b/src/index.ts index dfc0e98..c2635cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -216,7 +216,7 @@ export declare namespace Layerswap { export type Token = API.Token; } -export { toFile, fileFromPath } from '@layerswap/sdk/uploads'; +export { toFile, fileFromPath } from './uploads'; export { LayerswapError, APIError, @@ -231,6 +231,6 @@ export { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} from '@layerswap/sdk/error'; +} from './error'; export default Layerswap; diff --git a/yarn.lock b/yarn.lock index 14e8a75..bfd47d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -759,16 +759,6 @@ dependencies: "@swc/counter" "^0.1.3" -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -1315,11 +1305,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - collect-v8-coverage@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" @@ -2680,23 +2665,11 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2860,11 +2833,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3283,14 +3251,6 @@ ts-jest@^29.1.0: semver "^7.5.3" yargs-parser "^21.0.1" -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - ts-node@^10.5.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" From 4fbf81a9c272399ee9e5030dd10bb1d56ae1cf76 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:26:41 +0000 Subject: [PATCH 05/65] chore: rebuild project due to codegen change (#53) --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 009c425..d55d00a 100644 --- a/README.md +++ b/README.md @@ -325,6 +325,15 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) +- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. +- Deno v1.28.0 or higher, using `import Layerswap from "npm:@layerswap/sdk"`. +- Bun 1.0 or later. +- Cloudflare Workers. +- Vercel Edge Runtime. +- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). +- Nitro v2.6 or greater. + Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. From 91746a11dc05d5bdcbb65e66eed13703e03f9b20 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:24:45 +0000 Subject: [PATCH 06/65] chore: rebuild project due to codegen change (#54) --- tests/api-resources/networks/destinations.test.ts | 2 +- tests/api-resources/networks/networks.test.ts | 5 +---- tests/api-resources/networks/sources.test.ts | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/api-resources/networks/destinations.test.ts b/tests/api-resources/networks/destinations.test.ts index f97bb2e..525927b 100644 --- a/tests/api-resources/networks/destinations.test.ts +++ b/tests/api-resources/networks/destinations.test.ts @@ -35,7 +35,7 @@ describe('resource destinations', () => { include_swaps: true, include_unavailable: true, include_unmatched: true, - network_types: ['evm', 'starknet', 'solana'], + network_types: ['evm'], source_network: 'source_network', source_token: 'source_token', }, diff --git a/tests/api-resources/networks/networks.test.ts b/tests/api-resources/networks/networks.test.ts index a99d2c0..d4adbf1 100644 --- a/tests/api-resources/networks/networks.test.ts +++ b/tests/api-resources/networks/networks.test.ts @@ -30,10 +30,7 @@ describe('resource networks', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.networks.list( - { network_types: ['evm', 'starknet', 'solana'] }, - { path: '/_stainless_unknown_path' }, - ), + client.networks.list({ network_types: ['evm'] }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Layerswap.NotFoundError); }); }); diff --git a/tests/api-resources/networks/sources.test.ts b/tests/api-resources/networks/sources.test.ts index 7b8b875..d643f44 100644 --- a/tests/api-resources/networks/sources.test.ts +++ b/tests/api-resources/networks/sources.test.ts @@ -37,7 +37,7 @@ describe('resource sources', () => { include_swaps: true, include_unavailable: true, include_unmatched: true, - network_types: ['evm', 'starknet', 'solana'], + network_types: ['evm'], }, { path: '/_stainless_unknown_path' }, ), From e4fbba39e7770393ad0843cf65e014dc5536d69b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:03:06 +0000 Subject: [PATCH 07/65] docs: remove suggestion to use `npm` call out (#55) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d55d00a..743233a 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ The following runtimes are supported: - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Layerswap from "npm:@layerswap/sdk"`. +- Deno v1.28.0 or higher. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. From e77fa2944109f07558f1c03719165cee0d96171f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:07:11 +0000 Subject: [PATCH 08/65] chore: remove redundant word in comment (#56) --- scripts/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index be56b67..b99ccda 100755 --- a/scripts/build +++ b/scripts/build @@ -32,7 +32,7 @@ npm exec tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto -# we need to add exports = module.exports = Layerswap Node to index.js; +# we need to add exports = module.exports = Layerswap to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs node scripts/utils/fix-index-exports.cjs From ec1f35dfd716ab8699554512625abd9b05cb5925 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:23:07 +0000 Subject: [PATCH 09/65] feat(internal): make git install file structure match npm (#57) --- package.json | 2 +- scripts/utils/check-is-in-git-install.sh | 2 +- scripts/utils/git-swap.sh | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 scripts/utils/git-swap.sh diff --git a/package.json b/package.json index db63c98..c3060ff 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", "lint": "./scripts/lint", "fix": "./scripts/format" diff --git a/scripts/utils/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh index 36bcedc..1354eb4 100755 --- a/scripts/utils/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 0000000..79d1888 --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist From 4052b68c3968243c7afdbb4e1fe464063d3773f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:04:33 +0000 Subject: [PATCH 10/65] chore(internal): remove unnecessary getRequestClient function (#58) --- src/core.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core.ts b/src/core.ts index 5b303c4..cf75055 100644 --- a/src/core.ts +++ b/src/core.ts @@ -523,19 +523,13 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); From 1aae24f9e76728158164dc58bff41f417d9e21f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 06:29:05 +0000 Subject: [PATCH 11/65] chore(internal): bump cross-spawn to v7.0.6 (#59) Note: it is a dev transitive dependency. --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bfd47d8..bb17942 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1370,9 +1370,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From 436e28417d2982fd03ad9fcdc8bfb30cf30bbad6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 06:41:41 +0000 Subject: [PATCH 12/65] chore(types): nicer error class types + jsdocs (#60) --- src/error.ts | 64 ++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/error.ts b/src/error.ts index c9d9c13..cb0fd48 100644 --- a/src/error.ts +++ b/src/error.ts @@ -4,17 +4,19 @@ import { castToError, Headers } from './core'; export class LayerswapError extends Error {} -export class APIError extends LayerswapError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends LayerswapError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; @@ -48,7 +50,7 @@ export class APIError extends LayerswapError { message: string | undefined, headers: Headers | undefined, ): APIError { - if (!status) { + if (!status || !headers) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } @@ -90,17 +92,13 @@ export class APIError extends LayerswapError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - +export class APIConnectionError extends APIError { constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared @@ -115,32 +113,18 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} From 563e6a17b703eba639591c289748d4260484b8de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 06:34:42 +0000 Subject: [PATCH 13/65] chore(internal): update isAbsoluteURL (#61) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index cf75055..f9d1ff7 100644 --- a/src/core.ts +++ b/src/core.ts @@ -970,8 +970,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; From 374e4633b0a2fd7ddbe87f711e1c0a9af98f5371 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:18:24 +0000 Subject: [PATCH 14/65] feat(api): api update (#62) --- .stats.yml | 2 +- src/resources/networks/destinations.ts | 3 +++ src/resources/networks/networks.ts | 3 +++ src/resources/networks/sources.ts | 3 +++ src/resources/swaps/deposit-actions.ts | 3 +++ src/resources/swaps/limits.ts | 3 +++ src/resources/swaps/quote.ts | 3 +++ src/resources/swaps/swaps.ts | 9 +++++++++ 8 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 594755e..7e9910c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-c29e92915628beaa7c7bca046ce0133a010bd77bbaa6f55372814f96c5ef535c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-052788249d7e8997fabebdc88a07414dab55b0a53bb270ec4c034abbfb3afcaa.yml diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 5a8aedc..347f584 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -7,6 +7,9 @@ import * as Shared from '../shared'; import * as SwapsAPI from '../swaps/swaps'; export class Destinations extends APIResource { + /** + * Retrieves all available destination routes. + */ list( query?: DestinationListParams, options?: Core.RequestOptions, diff --git a/src/resources/networks/networks.ts b/src/resources/networks/networks.ts index 0ae64f4..d60138a 100644 --- a/src/resources/networks/networks.ts +++ b/src/resources/networks/networks.ts @@ -13,6 +13,9 @@ export class Networks extends APIResource { sources: SourcesAPI.Sources = new SourcesAPI.Sources(this._client); destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); + /** + * Retrieves a list of available networks with their tokens. + */ list(query?: NetworkListParams, options?: Core.RequestOptions): Core.APIPromise; list(options?: Core.RequestOptions): Core.APIPromise; list( diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index b14bec8..e85774b 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -7,6 +7,9 @@ import * as Shared from '../shared'; import * as SwapsAPI from '../swaps/swaps'; export class Sources extends APIResource { + /** + * Retrieves all available source routes. + */ list(query?: SourceListParams, options?: Core.RequestOptions): Core.APIPromise; list(options?: Core.RequestOptions): Core.APIPromise; list( diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index e650299..ed8b2d7 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -6,6 +6,9 @@ import * as Core from '../../core'; import * as Shared from '../shared'; export class DepositActions extends APIResource { + /** + * Retrieves the deposit actions for a specific swap. + */ list( swapId: string, query?: DepositActionListParams, diff --git a/src/resources/swaps/limits.ts b/src/resources/swaps/limits.ts index 95956fa..c450e8e 100644 --- a/src/resources/swaps/limits.ts +++ b/src/resources/swaps/limits.ts @@ -5,6 +5,9 @@ import * as Core from '../../core'; import * as Shared from '../shared'; export class Limits extends APIResource { + /** + * Retrieves the limits for swap route. + */ list(query: LimitListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/limits', { query, ...options }); } diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 4f8e25d..7cad692 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -6,6 +6,9 @@ import * as Shared from '../shared'; import * as SwapsAPI from './swaps'; export class QuoteResource extends APIResource { + /** + * Retrieves a swap quote based on the provided route request. + */ retrieve( query: QuoteRetrieveParams, options?: Core.RequestOptions, diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index dcebe75..424934e 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -16,10 +16,16 @@ export class Swaps extends APIResource { limits: LimitsAPI.Limits = new LimitsAPI.Limits(this._client); quote: QuoteAPI.QuoteResource = new QuoteAPI.QuoteResource(this._client); + /** + * Creates a new swap based on the provided request. + */ create(body: SwapCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/api/v2/swaps', { body, ...options }); } + /** + * Retrieves the details of a specific swap by its ID. + */ retrieve( swapId: string, query?: SwapRetrieveParams, @@ -37,6 +43,9 @@ export class Swaps extends APIResource { return this._client.get(`/api/v2/swaps/${swapId}`, { query, ...options }); } + /** + * Retrieves a list of all swaps. + */ list(query: SwapListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/swaps', { query, ...options }); } From 1aabb796e08c92d8aff83328036436e6928f74fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:18:04 +0000 Subject: [PATCH 15/65] feat(api): api update (#63) --- .stats.yml | 2 +- src/resources/health.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7e9910c..40f0fd5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-052788249d7e8997fabebdc88a07414dab55b0a53bb270ec4c034abbfb3afcaa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-2777a5b0e7be2b93b31ea27e6ac7aa028176d2fd60674cdb0efb03325895d708.yml diff --git a/src/resources/health.ts b/src/resources/health.ts index 49569b5..0371407 100644 --- a/src/resources/health.ts +++ b/src/resources/health.ts @@ -4,6 +4,9 @@ import { APIResource } from '../resource'; import * as Core from '../core'; export class Health extends APIResource { + /** + * Verifies that the API is running and operational. + */ retrieve(options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/health', { ...options, From 8944cc68f42c3ea05f7a20017ed20320497aa1eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 06:23:32 +0000 Subject: [PATCH 16/65] chore(internal): fix some typos (#64) --- src/core.ts | 4 ++-- tests/index.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.ts b/src/core.ts index f9d1ff7..2c79095 100644 --- a/src/core.ts +++ b/src/core.ts @@ -163,7 +163,7 @@ export abstract class APIClient { maxRetries = 2, timeout = 60000, // 1 minute httpAgent, - fetch: overridenFetch, + fetch: overriddenFetch, }: { baseURL: string; maxRetries?: number | undefined; @@ -176,7 +176,7 @@ export abstract class APIClient { this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; - this.fetch = overridenFetch ?? fetch; + this.fetch = overriddenFetch ?? fetch; } protected authHeaders(opts: FinalRequestOptions): Headers { diff --git a/tests/index.test.ts b/tests/index.test.ts index 0a2032a..6b0b586 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -177,7 +177,7 @@ describe('instantiate client', () => { expect(client.apiKey).toBe('My API Key'); }); - test('with overriden environment variable arguments', () => { + test('with overridden environment variable arguments', () => { // set options via env var process.env['LAYERSWAP_API_KEY'] = 'another My API Key'; const client = new Layerswap({ apiKey: 'My API Key' }); From ec5a2c9b86ede54108d953596c82e367ec3c72a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 06:19:01 +0000 Subject: [PATCH 17/65] chore(internal): codegen related update (#65) --- CONTRIBUTING.md | 8 ++++---- src/core.ts | 12 +++++++++++- tests/index.test.ts | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45d2f18..88fa1d0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source diff --git a/src/core.ts b/src/core.ts index 2c79095..f727f99 100644 --- a/src/core.ts +++ b/src/core.ts @@ -522,9 +522,19 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + this.fetch.call(undefined, url, fetchOptions).finally(() => { clearTimeout(timeout); }) ); diff --git a/tests/index.test.ts b/tests/index.test.ts index 6b0b586..b8cd987 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -122,6 +122,23 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); + test('normalized method', async () => { + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + capturedRequest = init; + return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Layerswap({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: testFetch, + }); + + await client.patch('/foo'); + expect(capturedRequest?.method).toEqual('PATCH'); + }); + describe('baseUrl', () => { test('trailing slash', () => { const client = new Layerswap({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); From 67883979fd66207bde2031b445b91e3d2568ed36 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 06:20:02 +0000 Subject: [PATCH 18/65] chore(internal): codegen related update (#66) --- CONTRIBUTING.md | 8 ++++---- src/core.ts | 12 +----------- tests/index.test.ts | 17 ----------------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88fa1d0..45d2f18 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -```sh -$ chmod +x examples/.ts +``` +chmod +x examples/.ts # run the example against your api -$ yarn tsn -T examples/.ts +yarn tsn -T examples/.ts ``` ## Using the repository from source diff --git a/src/core.ts b/src/core.ts index f727f99..2c79095 100644 --- a/src/core.ts +++ b/src/core.ts @@ -522,19 +522,9 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); - const fetchOptions = { - signal: controller.signal as any, - ...options, - }; - if (fetchOptions.method) { - // Custom methods like 'patch' need to be uppercased - // See https://github.com/nodejs/undici/issues/2294 - fetchOptions.method = fetchOptions.method.toUpperCase(); - } - return ( // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(undefined, url, fetchOptions).finally(() => { + this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { clearTimeout(timeout); }) ); diff --git a/tests/index.test.ts b/tests/index.test.ts index b8cd987..6b0b586 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -122,23 +122,6 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); - test('normalized method', async () => { - let capturedRequest: RequestInit | undefined; - const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { - capturedRequest = init; - return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); - }; - - const client = new Layerswap({ - baseURL: 'http://localhost:5000/', - apiKey: 'My API Key', - fetch: testFetch, - }); - - await client.patch('/foo'); - expect(capturedRequest?.method).toEqual('PATCH'); - }); - describe('baseUrl', () => { test('trailing slash', () => { const client = new Layerswap({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); From 9fb83daf993b2c7fe3bd513ebee6fa15c18783ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 06:23:01 +0000 Subject: [PATCH 19/65] fix(client): normalize method (#67) --- src/core.ts | 12 +++++++++++- tests/index.test.ts | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 2c79095..f727f99 100644 --- a/src/core.ts +++ b/src/core.ts @@ -522,9 +522,19 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + this.fetch.call(undefined, url, fetchOptions).finally(() => { clearTimeout(timeout); }) ); diff --git a/tests/index.test.ts b/tests/index.test.ts index 6b0b586..b8cd987 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -122,6 +122,23 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); + test('normalized method', async () => { + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + capturedRequest = init; + return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Layerswap({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: testFetch, + }); + + await client.patch('/foo'); + expect(capturedRequest?.method).toEqual('PATCH'); + }); + describe('baseUrl', () => { test('trailing slash', () => { const client = new Layerswap({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); From 943580466332472d0f4a9ece82e2c4a0b205191d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 06:32:40 +0000 Subject: [PATCH 20/65] chore(internal): codegen related update (#68) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45d2f18..88fa1d0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source From 689ebbea58012286954f6524256215c2c5800e13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:18:33 +0000 Subject: [PATCH 21/65] feat(api): api update (#69) --- .stats.yml | 2 +- src/resources/shared.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 40f0fd5..65c5325 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-2777a5b0e7be2b93b31ea27e6ac7aa028176d2fd60674cdb0efb03325895d708.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-58562c0a842103172b8d2fdcd9ed7329162ed24661c0f7edfa04638bb0f193aa.yml diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 9b49bc6..96524a7 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -48,6 +48,8 @@ export interface NetworkMetadata { evm_oracle_contract?: string | null; listing_date?: string; + + zks_paymaster_contract?: string | null; } export interface NetworkWithTokens { From a0a44f14016500699f42e2d45f56530dc15bb584 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:18:59 +0000 Subject: [PATCH 22/65] feat(api): api update (#70) --- .stats.yml | 2 +- src/resources/shared.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 65c5325..519af88 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-58562c0a842103172b8d2fdcd9ed7329162ed24661c0f7edfa04638bb0f193aa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-81a2b042be7cb50419afb38f0b89823af08a50f2c4d86e65b2ecba074860ac5d.yml diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 96524a7..bc932d1 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -49,6 +49,8 @@ export interface NetworkMetadata { listing_date?: string; + watchdog_contract?: string | null; + zks_paymaster_contract?: string | null; } From dce763c80c107cf3010cfee40db9d4bd8654e20b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 06:11:09 +0000 Subject: [PATCH 23/65] chore(internal): codegen related update (#71) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bd4a1e1..7928a47 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Layerswap + Copyright 2025 Layerswap Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From c207085da083304751cf78c771832001159a2284 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 06:36:02 +0000 Subject: [PATCH 24/65] chore(internal): codegen related update (#72) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 743233a..3555192 100644 --- a/README.md +++ b/README.md @@ -312,7 +312,7 @@ await client.swaps.quote.retrieve( This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. From 4335ee6ddddaa0c343876380e124708d1ef82996 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 06:38:37 +0000 Subject: [PATCH 25/65] chore(internal): codegen related update (#73) --- src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index c2635cb..39161dd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,7 +43,7 @@ export interface ClientOptions { * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -51,7 +51,7 @@ export interface ClientOptions { * If not provided, an agent will be constructed by default in the Node.js environment, * otherwise no agent is used. */ - httpAgent?: Agent; + httpAgent?: Agent | undefined; /** * Specify a custom `fetch` function implementation. @@ -67,7 +67,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -75,7 +75,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * header to `undefined` or `null` in request options. */ - defaultHeaders?: Core.Headers; + defaultHeaders?: Core.Headers | undefined; /** * Default query parameters to include with every request to the API. @@ -83,7 +83,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } /** From 2ec9339b328d254a3a51f06870d8b79419fd5de6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 06:25:45 +0000 Subject: [PATCH 26/65] chore(internal): codegen related update (#74) --- tests/index.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/index.test.ts b/tests/index.test.ts index b8cd987..2f98d2e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -96,6 +96,15 @@ describe('instantiate client', () => { expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true }); }); + test('explicit global fetch', async () => { + // make sure the global fetch type is assignable to our Fetch type + const client = new Layerswap({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: defaultFetch, + }); + }); + test('custom signal', async () => { const client = new Layerswap({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', From 0b2940a298d003f82df1e68d77eafaecc86bef13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:19:23 +0000 Subject: [PATCH 27/65] feat(api): api update (#75) --- .stats.yml | 2 +- src/resources/networks/destinations.ts | 4 ++++ src/resources/networks/sources.ts | 4 ++++ src/resources/shared.ts | 8 ++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 519af88..f7c7735 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-81a2b042be7cb50419afb38f0b89823af08a50f2c4d86e65b2ecba074860ac5d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-0e42928f3323514f2747c4bcf7fd97242085b0175752157132fd41f39821da0b.yml diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 347f584..9efe752 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -42,6 +42,8 @@ export namespace DestinationListResponse { deposit_methods?: Array | null; + destination_rank?: number; + display_name?: string; logo?: string; @@ -52,6 +54,8 @@ export namespace DestinationListResponse { node_url?: string | null; + source_rank?: number; + tokens?: Array; transaction_explorer_template?: string; diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index e85774b..b353d0e 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -39,6 +39,8 @@ export namespace SourceListResponse { deposit_methods?: Array | null; + destination_rank?: number; + display_name?: string; logo?: string; @@ -49,6 +51,8 @@ export namespace SourceListResponse { node_url?: string | null; + source_rank?: number; + tokens?: Array; transaction_explorer_template?: string; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index bc932d1..59639a2 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -17,6 +17,8 @@ export interface Network { deposit_methods?: Array | null; + destination_rank?: number; + display_name?: string; logo?: string; @@ -27,6 +29,8 @@ export interface Network { node_url?: string | null; + source_rank?: number; + transaction_explorer_template?: string; type?: @@ -63,6 +67,8 @@ export interface NetworkWithTokens { deposit_methods?: Array | null; + destination_rank?: number; + display_name?: string; logo?: string; @@ -73,6 +79,8 @@ export interface NetworkWithTokens { node_url?: string | null; + source_rank?: number; + tokens?: Array; transaction_explorer_template?: string; From 18487714a8ee70eec85a5e5e697677cba7fbb553 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:18:17 +0000 Subject: [PATCH 28/65] feat(api): api update (#76) --- .stats.yml | 2 +- src/resources/swaps/swaps.ts | 52 +++++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index f7c7735..d155546 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-0e42928f3323514f2747c4bcf7fd97242085b0175752157132fd41f39821da0b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-f487742418f2346e9023096dde8d42e6f6a752cc089d0d70c57adc42f3728062.yml diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index 424934e..5cb1b52 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -58,7 +58,7 @@ export interface PreparedSwapResponse { refuel?: TokenWithAmount; - reward?: TokenWithAmount; + reward?: PreparedSwapResponse.Reward; swap?: Swap; } @@ -83,6 +83,20 @@ export namespace PreparedSwapResponse { type?: string; } + + export interface Reward { + token?: Shared.Token; + + amount?: number; + + amount_in_usd?: number; + + campaign_type?: string; + + network?: Shared.Network; + + nft_contract_address?: string | null; + } } export interface Swap { @@ -212,7 +226,23 @@ export interface SwapQuoteResponse { refuel?: TokenWithAmount; - reward?: TokenWithAmount; + reward?: SwapQuoteResponse.Reward; +} + +export namespace SwapQuoteResponse { + export interface Reward { + token?: Shared.Token; + + amount?: number; + + amount_in_usd?: number; + + campaign_type?: string; + + network?: Shared.Network; + + nft_contract_address?: string | null; + } } export interface SwapResponse { @@ -220,11 +250,27 @@ export interface SwapResponse { refuel?: TokenWithAmount; - reward?: TokenWithAmount; + reward?: SwapResponse.Reward; swap?: Swap; } +export namespace SwapResponse { + export interface Reward { + token?: Shared.Token; + + amount?: number; + + amount_in_usd?: number; + + campaign_type?: string; + + network?: Shared.Network; + + nft_contract_address?: string | null; + } +} + export interface TokenWithAmount { token?: Shared.Token; From a8673d5b5d63f35505a2408ea3b4a53ee5484115 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 06:59:12 +0000 Subject: [PATCH 29/65] chore(internal): codegen related update (#77) --- .devcontainer/Dockerfile | 23 ----------------------- .devcontainer/devcontainer.json | 27 ++++++++++++--------------- README.md | 2 +- SECURITY.md | 4 ++-- package.json | 14 +++++++------- src/core.ts | 20 ++++++++++++++------ 6 files changed, 36 insertions(+), 54 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 8ea34be..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Ensure UTF-8 encoding -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d55fc4d..763462f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,17 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/debian { - "name": "Debian", - "build": { - "dockerfile": "Dockerfile" + "name": "Development", + "image": "mcr.microsoft.com/devcontainers/typescript-node:latest", + "features": { + "ghcr.io/devcontainers/features/node:1": {} + }, + "postCreateCommand": "yarn install", + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode" + ] + } } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } diff --git a/README.md b/README.md index 3555192..aa22531 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This library provides convenient access to the Layerswap REST API from server-si The REST API documentation can be found on [layerswapapi.readme.io](https://layerswapapi.readme.io/). The full API of this library can be found in [api.md](api.md). -It is generated with [Stainless](https://www.stainlessapi.com/). +It is generated with [Stainless](https://www.stainless.com/). ## Installation diff --git a/SECURITY.md b/SECURITY.md index 38a2a5f..18503e8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting Security Issues -This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. -To report a security issue, please contact the Stainless team at security@stainlessapi.com. +To report a security issue, please contact the Stainless team at security@stainless.com. ## Responsible Disclosure diff --git a/package.json b/package.json index c3060ff..eb4713d 100644 --- a/package.json +++ b/package.json @@ -107,17 +107,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": "./dist/*.d.ts", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] }, "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.js", "./dist/*/index.js"] }, "./*": { - "types": "./dist/*.d.ts", - "require": "./dist/*.js", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "require": ["./dist/*.js", "./dist/*/index.js"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] } } } diff --git a/src/core.ts b/src/core.ts index f727f99..e267d38 100644 --- a/src/core.ts +++ b/src/core.ts @@ -280,6 +280,7 @@ export abstract class APIClient { options: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { + options = { ...options }; const { method, path, query, headers: headers = {} } = options; const body = @@ -292,9 +293,9 @@ export abstract class APIClient { const url = this.buildURL(path!, query); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -323,7 +324,7 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ @@ -351,15 +352,22 @@ export abstract class APIClient { delete reqHeaders['content-type']; } - // Don't set the retry count header if it was already set or removed through default headers or by the - // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to - // account for the removal case. + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. if ( getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && getHeader(headers, 'x-stainless-retry-count') === undefined ) { reqHeaders['x-stainless-retry-count'] = String(retryCount); } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(options.timeout); + } this.validateHeaders(reqHeaders, headers); From 5ffa9db46aab3e1f16a1128fe92c324f17941379 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 07:34:22 +0000 Subject: [PATCH 30/65] feat: add SKIP_BREW env var to ./scripts/bootstrap (#78) --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 05dd47a..0af58e2 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle From 95b6207dac3235b2a740f4c12749fe7a56b0e816 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:07:10 +0000 Subject: [PATCH 31/65] feat(client): accept RFC6838 JSON content types (#79) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index e267d38..9a3dc0e 100644 --- a/src/core.ts +++ b/src/core.ts @@ -48,8 +48,8 @@ async function defaultParseResponse(props: APIResponseProps): Promise { } const contentType = response.headers.get('content-type'); - const isJSON = - contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + const mediaType = contentType?.split(';')[0]?.trim(); + const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { const json = await response.json(); From db268b47ae4069f8c66147e0316963017c96749d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 00:18:33 +0000 Subject: [PATCH 32/65] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d155546..8fdff45 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-f487742418f2346e9023096dde8d42e6f6a752cc089d0d70c57adc42f3728062.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-c97b9c51cbf6e8abf935e5045f7c2d7b8ad68d02904c503ff09407ac4de73bca.yml From c9a08746ae50800d24c8b1d3c4bc19c7f577a8a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:18:05 +0000 Subject: [PATCH 33/65] chore(internal): codegen related update (#80) --- .github/workflows/ci.yml | 1 - .stats.yml | 2 ++ package.json | 14 +++++++------- src/_shims/index-deno.ts | 2 ++ src/_shims/index.d.ts | 2 ++ src/_shims/index.js | 6 +++++- src/_shims/index.mjs | 6 +++++- src/core.ts | 23 +++++++++++++++++++++-- src/resources.ts | 1 + src/resources/networks.ts | 3 +++ src/resources/swaps.ts | 3 +++ 11 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 src/resources.ts create mode 100644 src/resources/networks.ts create mode 100644 src/resources/swaps.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3530dc..0312165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,4 +63,3 @@ jobs: - name: Run tests run: ./scripts/test - diff --git a/.stats.yml b/.stats.yml index 8fdff45..2aca14b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ configured_endpoints: 10 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-c97b9c51cbf6e8abf935e5045f7c2d7b8ad68d02904c503ff09407ac4de73bca.yml +openapi_spec_hash: f931385bfda5b44f2c324207a0458b30 +config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/package.json b/package.json index eb4713d..c3060ff 100644 --- a/package.json +++ b/package.json @@ -107,17 +107,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "default": "./dist/*.mjs" }, "./*.js": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.js", "./dist/*/index.js"] + "types": "./dist/*.d.ts", + "default": "./dist/*.js" }, "./*": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "require": ["./dist/*.js", "./dist/*/index.js"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "require": "./dist/*.js", + "default": "./dist/*.mjs" } } } diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index 473cec3..9cc25b1 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 7a647fd..5e5a8cb 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index f366e0c..211e9fb 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('@layerswap/sdk/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index dc74918..256477a 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from '@layerswap/sdk/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/core.ts b/src/core.ts index 9a3dc0e..4cca2ac 100644 --- a/src/core.ts +++ b/src/core.ts @@ -16,7 +16,12 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { @@ -28,6 +33,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { @@ -366,7 +385,7 @@ export abstract class APIClient { getHeader(headers, 'x-stainless-timeout') === undefined && options.timeout ) { - reqHeaders['x-stainless-timeout'] = String(options.timeout); + reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); } this.validateHeaders(reqHeaders, headers); @@ -395,7 +414,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000..b283d57 --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; diff --git a/src/resources/networks.ts b/src/resources/networks.ts new file mode 100644 index 0000000..8aa97a8 --- /dev/null +++ b/src/resources/networks.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './networks/index'; diff --git a/src/resources/swaps.ts b/src/resources/swaps.ts new file mode 100644 index 0000000..2c27985 --- /dev/null +++ b/src/resources/swaps.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './swaps/index'; From 4e0d8eca81f0cf7d1880349c5306879d48a8c143 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:22:35 +0000 Subject: [PATCH 34/65] fix(api): improve type resolution when importing as a package (#81) --- packages/mcp-server/src/tools.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts new file mode 100644 index 0000000..7e516de --- /dev/null +++ b/packages/mcp-server/src/tools.ts @@ -0,0 +1 @@ +export * from './tools/index'; From 2d47b0d417ffa36e6c73b9acd523fa233d00d369 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:35:29 +0000 Subject: [PATCH 35/65] fix(mcp): remove unused tools.ts (#82) --- packages/mcp-server/src/tools.ts | 1 - 1 file changed, 1 deletion(-) delete mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts deleted file mode 100644 index 7e516de..0000000 --- a/packages/mcp-server/src/tools.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './tools/index'; From f47e7077a1aecc9435448f73d27ce3c6365c81ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:18:29 +0000 Subject: [PATCH 36/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2aca14b..411eba9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-c97b9c51cbf6e8abf935e5045f7c2d7b8ad68d02904c503ff09407ac4de73bca.yml -openapi_spec_hash: f931385bfda5b44f2c324207a0458b30 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-3e2a25e1f8ac32a7bb5b21454b39234a525d430a2a61785898a54ec9be9b0109.yml +openapi_spec_hash: fa7045f691f39709f11d7f89cf338cf3 config_hash: c54b23009f612fcc914964f7a1327a91 From f252d0ffb92694d3e94244315d2af27124c286b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:21:54 +0000 Subject: [PATCH 37/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 411eba9..6f8d747 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2FLayerswap-3e2a25e1f8ac32a7bb5b21454b39234a525d430a2a61785898a54ec9be9b0109.yml -openapi_spec_hash: fa7045f691f39709f11d7f89cf338cf3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-782cf61f33cf302c4e6d8483b5d459de119f100e9eb60cc81695cbdfc1a5678e.yml +openapi_spec_hash: 3c7013ba45d600aef712fbaadfa0739a config_hash: c54b23009f612fcc914964f7a1327a91 From cc6ffbe56d3fa8fbbff5b4622c3395cfc674a256 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 12:13:20 +0000 Subject: [PATCH 38/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/networks/destinations.ts | 15 +++++++++++++-- src/resources/networks/networks.ts | 12 +++++++++++- src/resources/networks/sources.ts | 15 +++++++++++++-- src/resources/shared.ts | 6 ++++-- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6f8d747..4b68833 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-782cf61f33cf302c4e6d8483b5d459de119f100e9eb60cc81695cbdfc1a5678e.yml -openapi_spec_hash: 3c7013ba45d600aef712fbaadfa0739a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-ea20c2cfc1061f1220de65059eb2ee62d57535fe5e776bcdcc85ba81723388da.yml +openapi_spec_hash: 4d8cbc44e0700f84b0b9edf35f283b11 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 9efe752..06e43a5 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -70,7 +70,8 @@ export namespace DestinationListResponse { | 'ton' | 'paradex' | 'tron' - | 'fuel'; + | 'fuel' + | 'bitcoin'; } export namespace Data { @@ -110,7 +111,17 @@ export interface DestinationListParams { include_unmatched?: boolean; network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel' + | 'bitcoin' >; source_network?: string; diff --git a/src/resources/networks/networks.ts b/src/resources/networks/networks.ts index d60138a..4c46f35 100644 --- a/src/resources/networks/networks.ts +++ b/src/resources/networks/networks.ts @@ -37,7 +37,17 @@ export interface NetworkListResponse { export interface NetworkListParams { network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel' + | 'bitcoin' >; } diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index b353d0e..bf3a73f 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -67,7 +67,8 @@ export namespace SourceListResponse { | 'ton' | 'paradex' | 'tron' - | 'fuel'; + | 'fuel' + | 'bitcoin'; } export namespace Data { @@ -111,7 +112,17 @@ export interface SourceListParams { include_unmatched?: boolean; network_types?: Array< - 'evm' | 'starknet' | 'solana' | 'cosmos' | 'starkex' | 'zksynclite' | 'ton' | 'paradex' | 'tron' | 'fuel' + | 'evm' + | 'starknet' + | 'solana' + | 'cosmos' + | 'starkex' + | 'zksynclite' + | 'ton' + | 'paradex' + | 'tron' + | 'fuel' + | 'bitcoin' >; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 59639a2..f7e10a3 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -43,7 +43,8 @@ export interface Network { | 'ton' | 'paradex' | 'tron' - | 'fuel'; + | 'fuel' + | 'bitcoin'; } export interface NetworkMetadata { @@ -95,7 +96,8 @@ export interface NetworkWithTokens { | 'ton' | 'paradex' | 'tron' - | 'fuel'; + | 'fuel' + | 'bitcoin'; } export interface Token { From 716db99dd13215003ad89ea675ec54ab3e0924f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:13:30 +0000 Subject: [PATCH 39/65] feat(api): api update --- .github/workflows/ci.yml | 48 +++++++++++----- .github/workflows/publish-npm.yml | 2 +- .stats.yml | 4 +- README.md | 80 +++++++++++--------------- SECURITY.md | 4 +- bin/publish-npm | 52 ++++++++++++++--- scripts/build | 2 +- scripts/utils/upload-artifact.sh | 25 ++++++++ src/core.ts | 23 +++++--- src/index.ts | 8 +++ src/resource.ts | 2 +- src/resources/swaps/deposit-actions.ts | 8 +++ src/resources/swaps/limits.ts | 10 ++++ src/resources/swaps/quote.ts | 13 +++++ src/resources/swaps/swaps.ts | 26 +++++++++ tests/index.test.ts | 22 +++++++ 16 files changed, 246 insertions(+), 83 deletions(-) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0312165..a5e730f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,22 @@ name: CI on: push: - branches: - - main + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' pull_request: - branches: - - main - - next + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: + timeout-minutes: 10 name: lint - runs-on: ubuntu-latest - - + runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -29,10 +32,12 @@ jobs: run: ./scripts/lint build: + timeout-minutes: 5 name: build - runs-on: ubuntu-latest - - + runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -46,17 +51,32 @@ jobs: - name: Check build run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/layerswap-node' + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: github.repository == 'stainless-sdks/layerswap-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh test: + timeout-minutes: 10 name: test - runs-on: ubuntu-latest - + runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 8205588..11f2831 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | diff --git a/.stats.yml b/.stats.yml index 4b68833..98a6472 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-ea20c2cfc1061f1220de65059eb2ee62d57535fe5e776bcdcc85ba81723388da.yml -openapi_spec_hash: 4d8cbc44e0700f84b0b9edf35f283b11 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-fe24319701e2b37515db8a815af9e407453df6b6067569158ff9d781213c5e06.yml +openapi_spec_hash: c0b208baaccb76c1f863676c69dbfa59 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/README.md b/README.md index aa22531..c70aa71 100644 --- a/README.md +++ b/README.md @@ -26,19 +26,15 @@ const client = new Layerswap({ apiKey: process.env['LAYERSWAP_API_KEY'], // This is the default and can be omitted }); -async function main() { - const quote = await client.swaps.quote.retrieve({ - amount: 123, - destination_network: 'ARBITRUM_MAINNET', - destination_token: 'ETH', - source_network: 'OPTIMISM_MAINNET', - source_token: 'ETH', - }); - - console.log(quote.data); -} +const quote = await client.swaps.quote.retrieve({ + amount: 0, + destination_network: 'ARBITRUM_MAINNET', + destination_token: 'ETH', + source_network: 'OPTIMISM_MAINNET', + source_token: 'ETH', +}); -main(); +console.log(quote.data); ``` ### Request & Response types @@ -53,18 +49,14 @@ const client = new Layerswap({ apiKey: process.env['LAYERSWAP_API_KEY'], // This is the default and can be omitted }); -async function main() { - const params: Layerswap.Swaps.QuoteRetrieveParams = { - amount: 0, - destination_network: 'destination_network', - destination_token: 'destination_token', - source_network: 'source_network', - source_token: 'source_token', - }; - const quote: Layerswap.Swaps.QuoteRetrieveResponse = await client.swaps.quote.retrieve(params); -} - -main(); +const params: Layerswap.Swaps.QuoteRetrieveParams = { + amount: 0, + destination_network: 'destination_network', + destination_token: 'destination_token', + source_network: 'source_network', + source_token: 'source_token', +}; +const quote: Layerswap.Swaps.QuoteRetrieveResponse = await client.swaps.quote.retrieve(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. @@ -77,30 +69,26 @@ a subclass of `APIError` will be thrown: ```ts -async function main() { - const quote = await client.swaps.quote - .retrieve({ - amount: 0, - destination_network: 'destination_network', - destination_token: 'destination_token', - source_network: 'source_network', - source_token: 'source_token', - }) - .catch(async (err) => { - if (err instanceof Layerswap.APIError) { - console.log(err.status); // 400 - console.log(err.name); // BadRequestError - console.log(err.headers); // {server: 'nginx', ...} - } else { - throw err; - } - }); -} - -main(); +const quote = await client.swaps.quote + .retrieve({ + amount: 0, + destination_network: 'destination_network', + destination_token: 'destination_token', + source_network: 'source_network', + source_token: 'source_token', + }) + .catch(async (err) => { + if (err instanceof Layerswap.APIError) { + console.log(err.status); // 400 + console.log(err.name); // BadRequestError + console.log(err.headers); // {server: 'nginx', ...} + } else { + throw err; + } + }); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | diff --git a/SECURITY.md b/SECURITY.md index 18503e8..7101408 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Layerswap please follow the respective company's security reporting guidelines. +or products provided by Layerswap, please follow the respective company's security reporting guidelines. ### Layerswap Terms and Policies -Please contact support@layerswap.io for any questions or concerns regarding security of our services. +Please contact support@layerswap.io for any questions or concerns regarding the security of our services. --- diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181..fa2243d 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,19 +4,55 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -# Build the project yarn build - -# Navigate to the dist directory cd dist -# Get the version from package.json -VERSION="$(node -p "require('./package.json').version")" +# Get package name and version from package.json +PACKAGE_NAME="$(jq -r -e '.name' ./package.json)" +VERSION="$(jq -r -e '.version' ./package.json)" + +# Get latest version from npm +# +# If the package doesn't exist, npm will return: +# { +# "error": { +# "code": "E404", +# "summary": "Unpublished on 2025-06-05T09:54:53.528Z", +# "detail": "'the_package' is not in this registry..." +# } +# } +NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)" + +# Check if we got an E404 error +if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then + # Package doesn't exist yet, no last version + LAST_VERSION="" +elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then + # Report other errors + echo "ERROR: npm returned unexpected data:" + echo "$NPM_INFO" + exit 1 +else + # Success - get the version + LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes +fi -# Extract the pre-release tag if it exists +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - # Extract the part before any dot in the pre-release identifier - TAG="${BASH_REMATCH[1]}" + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" else TAG="latest" fi diff --git a/scripts/build b/scripts/build index b99ccda..92d0ae0 100755 --- a/scripts/build +++ b/scripts/build @@ -28,7 +28,7 @@ fi node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files -npm exec tsc-multi +./node_modules/.bin/tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000..040b01b --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/layerswap-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/core.ts b/src/core.ts index 4cca2ac..d120cb1 100644 --- a/src/core.ts +++ b/src/core.ts @@ -170,6 +170,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + #baseURLOverridden: boolean; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -179,18 +180,21 @@ export abstract class APIClient { constructor({ baseURL, + baseURLOverridden, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, fetch: overriddenFetch, }: { baseURL: string; + baseURLOverridden: boolean; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.#baseURLOverridden = baseURLOverridden; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; @@ -296,11 +300,11 @@ export abstract class APIClient { } buildRequest( - options: FinalRequestOptions, + inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { - options = { ...options }; - const { method, path, query, headers: headers = {} } = options; + const options = { ...inputOptions }; + const { method, path, query, defaultBaseURL, headers: headers = {} } = options; const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? @@ -310,7 +314,7 @@ export abstract class APIClient { : null; const contentLength = this.calculateContentLength(body); - const url = this.buildURL(path!, query); + const url = this.buildURL(path!, query, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); @@ -327,8 +331,8 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); @@ -503,11 +507,12 @@ export abstract class APIClient { return new PagePromise(this, request, Page); } - buildURL(path: string, query: Req | null | undefined): string { + buildURL(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string { + const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { @@ -792,6 +797,7 @@ export type RequestOptions< query?: Req | undefined; body?: Req | null | undefined; headers?: Headers | undefined; + defaultBaseURL?: string | undefined; maxRetries?: number; stream?: boolean | undefined; @@ -813,6 +819,7 @@ const requestOptionsKeys: KeysEnum = { query: true, body: true, headers: true, + defaultBaseURL: true, maxRetries: true, stream: true, diff --git a/src/index.ts b/src/index.ts index 39161dd..2e807ea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,6 +125,7 @@ export class Layerswap extends Core.APIClient { super({ baseURL: options.baseURL!, + baseURLOverridden: baseURL ? baseURL !== 'https://api.layerswap.io' : false, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, @@ -140,6 +141,13 @@ export class Layerswap extends Core.APIClient { swaps: API.Swaps = new API.Swaps(this); networks: API.Networks = new API.Networks(this); + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://api.layerswap.io'; + } + protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; } diff --git a/src/resource.ts b/src/resource.ts index 5e45777..4b287d1 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -2,7 +2,7 @@ import type { Layerswap } from './index'; -export class APIResource { +export abstract class APIResource { protected _client: Layerswap; constructor(client: Layerswap) { diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index ed8b2d7..934887c 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -8,6 +8,14 @@ import * as Shared from '../shared'; export class DepositActions extends APIResource { /** * Retrieves the deposit actions for a specific swap. + * + * @example + * ```ts + * const listTransferDepositAction = + * await client.swaps.depositActions.list( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ list( swapId: string, diff --git a/src/resources/swaps/limits.ts b/src/resources/swaps/limits.ts index c450e8e..8ebd648 100644 --- a/src/resources/swaps/limits.ts +++ b/src/resources/swaps/limits.ts @@ -7,6 +7,16 @@ import * as Shared from '../shared'; export class Limits extends APIResource { /** * Retrieves the limits for swap route. + * + * @example + * ```ts + * const limits = await client.swaps.limits.list({ + * destination_network: 'destination_network', + * destination_token: 'destination_token', + * source_network: 'source_network', + * source_token: 'source_token', + * }); + * ``` */ list(query: LimitListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/limits', { query, ...options }); diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 7cad692..7bd8aa5 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -8,6 +8,17 @@ import * as SwapsAPI from './swaps'; export class QuoteResource extends APIResource { /** * Retrieves a swap quote based on the provided route request. + * + * @example + * ```ts + * const quote = await client.swaps.quote.retrieve({ + * amount: 0, + * destination_network: 'destination_network', + * destination_token: 'destination_token', + * source_network: 'source_network', + * source_token: 'source_token', + * }); + * ``` */ retrieve( query: QuoteRetrieveParams, @@ -26,6 +37,8 @@ export interface Quote { destination_token?: Shared.Token; + fee_discount?: number; + min_receive_amount?: number; receive_amount?: number; diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index 5cb1b52..bc0d495 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -18,6 +18,18 @@ export class Swaps extends APIResource { /** * Creates a new swap based on the provided request. + * + * @example + * ```ts + * const swap = await client.swaps.create({ + * amount: 0.0042, + * destination_address: '0x', + * destination_network: 'ARBITRUM_MAINNET', + * destination_token: 'ETH', + * source_network: 'ETHEREUM_MAINNET', + * source_token: 'ETH', + * }); + * ``` */ create(body: SwapCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/api/v2/swaps', { body, ...options }); @@ -25,6 +37,13 @@ export class Swaps extends APIResource { /** * Retrieves the details of a specific swap by its ID. + * + * @example + * ```ts + * const swap = await client.swaps.retrieve( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ retrieve( swapId: string, @@ -45,6 +64,13 @@ export class Swaps extends APIResource { /** * Retrieves a list of all swaps. + * + * @example + * ```ts + * const swaps = await client.swaps.list({ + * address: 'address', + * }); + * ``` */ list(query: SwapListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/swaps', { query, ...options }); diff --git a/tests/index.test.ts b/tests/index.test.ts index 2f98d2e..87b5b5c 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -185,6 +185,28 @@ describe('instantiate client', () => { const client = new Layerswap({ apiKey: 'My API Key' }); expect(client.baseURL).toEqual('https://api.layerswap.io'); }); + + test('in request options', () => { + const client = new Layerswap({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/option/foo', + ); + }); + + test('in request options overridden by client options', () => { + const client = new Layerswap({ apiKey: 'My API Key', baseURL: 'http://localhost:5000/client' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/client/foo', + ); + }); + + test('in request options overridden by env variable', () => { + process.env['LAYERSWAP_BASE_URL'] = 'http://localhost:5000/env'; + const client = new Layerswap({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/env/foo', + ); + }); }); test('maxRetries option is correctly set', () => { From 399967af72ce6bd5011b3ea2bbfc05adba25f222 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 07:15:36 +0000 Subject: [PATCH 40/65] refactor(types): replace Record with mapped types --- src/resources/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/shared.ts b/src/resources/shared.ts index f7e10a3..8cacfe2 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -5,7 +5,7 @@ export interface APIError { message?: string; - metadata?: Record; + metadata?: { [key: string]: unknown }; } export interface Network { From b65a2dc29119cfb5aefd9cbe82c6b8c31f4995a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:13:37 +0000 Subject: [PATCH 41/65] feat(api): api update --- .github/workflows/ci.yml | 3 +++ .stats.yml | 4 ++-- bin/check-release-environment | 2 +- src/resources/swaps/quote.ts | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5e730f..7ed2e34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -35,6 +36,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork permissions: contents: read id-token: write @@ -70,6 +72,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 diff --git a/.stats.yml b/.stats.yml index 98a6472..6e2d9bd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-fe24319701e2b37515db8a815af9e407453df6b6067569158ff9d781213c5e06.yml -openapi_spec_hash: c0b208baaccb76c1f863676c69dbfa59 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d1e323570eb87917d3c2c8afafbfb25922d75c5726044426768fbe978b71365a.yml +openapi_spec_hash: 26d42c14da7aed72f4f072d1eb76e8f1 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/bin/check-release-environment b/bin/check-release-environment index c5eef3c..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${NPM_TOKEN}" ]; then - errors+=("The LAYERSWAP_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 7bd8aa5..43aaf8a 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -45,6 +45,8 @@ export interface Quote { refuel_in_source?: number | null; + requested_amount?: number; + service_fee?: number; slippage?: number; From 33913e057918fed470cfd00139fe5dd9527f6c2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:13:25 +0000 Subject: [PATCH 42/65] feat(api): api update --- .gitignore | 1 + .stats.yml | 4 +- bin/publish-npm | 2 +- package.json | 7 +- scripts/bootstrap | 14 ++- scripts/fast-format | 40 ++++++ scripts/mock | 4 +- scripts/test | 2 +- scripts/utils/upload-artifact.sh | 2 +- src/core.ts | 16 +-- src/index.ts | 3 + src/resources/networks/destinations.ts | 4 +- src/resources/networks/networks.ts | 1 + src/resources/networks/sources.ts | 4 +- src/resources/shared.ts | 6 +- tests/index.test.ts | 24 ++-- tsconfig.build.json | 4 +- tsconfig.json | 7 +- yarn.lock | 163 ++++++++++++++++++++----- 19 files changed, 233 insertions(+), 75 deletions(-) create mode 100755 scripts/fast-format diff --git a/.gitignore b/.gitignore index d98d51a..2412bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist dist-deno /*.tgz .idea/ +.eslintcache diff --git a/.stats.yml b/.stats.yml index 6e2d9bd..21983a4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d1e323570eb87917d3c2c8afafbfb25922d75c5726044426768fbe978b71365a.yml -openapi_spec_hash: 26d42c14da7aed72f4f072d1eb76e8f1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-7ef28075e2f4fe9332af29a90c7930da86493234d9973c10c2804191706c54f9.yml +openapi_spec_hash: d1bf81829143a988598cf8e0542cf36b config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d..45e8aa8 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index c3060ff..0def9d7 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", @@ -58,10 +61,6 @@ "./shims/web.js", "./shims/web.mjs" ], - "imports": { - "@layerswap/sdk": ".", - "@layerswap/sdk/*": "./src/*" - }, "exports": { "./_shims/auto/*": { "deno": { diff --git a/scripts/bootstrap b/scripts/bootstrap index 0af58e2..f68beda 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000..8a8e9d5 --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | ESLINT_USE_FLAT_CONFIG="false" xargs ./node_modules/.bin/eslint --cache --fix +fi + +echo "==> Running prettier --write" +# format things eslint didn't +PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" +if ! [ -z "$PRETTIER_FILES" ]; then + echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ + '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +fi diff --git a/scripts/mock b/scripts/mock index d2814ae..0b28f6e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2049e31..7bce051 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 040b01b..80b4c8b 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ +UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ -H "Content-Type: application/gzip" \ --data-binary @- "$SIGNED_URL" 2>&1) diff --git a/src/core.ts b/src/core.ts index d120cb1..2a2652f 100644 --- a/src/core.ts +++ b/src/core.ts @@ -217,7 +217,7 @@ export abstract class APIClient { protected defaultHeaders(opts: FinalRequestOptions): Headers { return { Accept: 'application/json', - 'Content-Type': 'application/json', + ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }), 'User-Agent': this.getUserAgent(), ...getPlatformHeaders(), ...this.authHeaders(opts), @@ -299,10 +299,10 @@ export abstract class APIClient { return null; } - buildRequest( + async buildRequest( inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, - ): { req: RequestInit; url: string; timeout: number } { + ): Promise<{ req: RequestInit; url: string; timeout: number }> { const options = { ...inputOptions }; const { method, path, query, defaultBaseURL, headers: headers = {} } = options; @@ -450,7 +450,9 @@ export abstract class APIClient { await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); @@ -1085,21 +1087,21 @@ export const coerceBoolean = (value: unknown): boolean => { }; export const maybeCoerceInteger = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceInteger(value); }; export const maybeCoerceFloat = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceFloat(value); }; export const maybeCoerceBoolean = (value: unknown): boolean | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceBoolean(value); diff --git a/src/index.ts b/src/index.ts index 2e807ea..3913094 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,6 +42,8 @@ export interface ClientOptions { * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. + * + * @unit milliseconds */ timeout?: number | undefined; @@ -191,6 +193,7 @@ export class Layerswap extends Core.APIClient { Layerswap.Health = Health; Layerswap.Swaps = Swaps; Layerswap.Networks = Networks; + export declare namespace Layerswap { export type RequestOptions = Core.RequestOptions; diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 06e43a5..eaa713f 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -71,7 +71,8 @@ export namespace DestinationListResponse { | 'paradex' | 'tron' | 'fuel' - | 'bitcoin'; + | 'bitcoin' + | 'hyperliquid'; } export namespace Data { @@ -122,6 +123,7 @@ export interface DestinationListParams { | 'tron' | 'fuel' | 'bitcoin' + | 'hyperliquid' >; source_network?: string; diff --git a/src/resources/networks/networks.ts b/src/resources/networks/networks.ts index 4c46f35..8a47db3 100644 --- a/src/resources/networks/networks.ts +++ b/src/resources/networks/networks.ts @@ -48,6 +48,7 @@ export interface NetworkListParams { | 'tron' | 'fuel' | 'bitcoin' + | 'hyperliquid' >; } diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index bf3a73f..1a70518 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -68,7 +68,8 @@ export namespace SourceListResponse { | 'paradex' | 'tron' | 'fuel' - | 'bitcoin'; + | 'bitcoin' + | 'hyperliquid'; } export namespace Data { @@ -123,6 +124,7 @@ export interface SourceListParams { | 'tron' | 'fuel' | 'bitcoin' + | 'hyperliquid' >; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 8cacfe2..bf99f2f 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -44,7 +44,8 @@ export interface Network { | 'paradex' | 'tron' | 'fuel' - | 'bitcoin'; + | 'bitcoin' + | 'hyperliquid'; } export interface NetworkMetadata { @@ -97,7 +98,8 @@ export interface NetworkWithTokens { | 'paradex' | 'tron' | 'fuel' - | 'bitcoin'; + | 'bitcoin' + | 'hyperliquid'; } export interface Token { diff --git a/tests/index.test.ts b/tests/index.test.ts index 87b5b5c..275f630 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -26,13 +26,13 @@ describe('instantiate client', () => { apiKey: 'My API Key', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -40,8 +40,8 @@ describe('instantiate client', () => { expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -237,20 +237,20 @@ describe('request building', () => { const client = new Layerswap({ apiKey: 'My API Key' }); describe('Content-Length', () => { - test('handles multi-byte characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); + test('handles multi-byte characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); expect((req.headers as Record)['content-length']).toEqual('20'); }); - test('handles standard characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); + test('handles standard characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); expect((req.headers as Record)['content-length']).toEqual('22'); }); }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' }, diff --git a/tsconfig.build.json b/tsconfig.build.json index 1e6432c..5cbaa8b 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "@layerswap/sdk/*": ["dist/src/*"], - "@layerswap/sdk": ["dist/src/index.ts"], + "@layerswap/sdk/*": ["./dist/src/*"], + "@layerswap/sdk": ["./dist/src/index.ts"], }, "noEmit": false, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index 7690275..5972ed1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,10 @@ "module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, - "baseUrl": "./", "paths": { - "@layerswap/sdk/_shims/auto/*": ["src/_shims/auto/*-node"], - "@layerswap/sdk/*": ["src/*"], - "@layerswap/sdk": ["src/index.ts"] + "@layerswap/sdk/_shims/auto/*": ["./src/_shims/auto/*-node"], + "@layerswap/sdk/*": ["./src/*"], + "@layerswap/sdk": ["./src/index.ts"] }, "noEmit": true, diff --git a/yarn.lock b/yarn.lock index bb17942..2bcc59e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -852,19 +852,19 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.13" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" + integrity sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.4" "@types/node@*": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + version "24.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" + integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== dependencies: - undici-types "~5.26.4" + undici-types "~7.10.0" "@types/node@^18.11.18": version "18.11.18" @@ -1097,7 +1097,7 @@ array-union@^2.1.0: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== babel-jest@^29.7.0: version "29.7.0" @@ -1234,6 +1234,14 @@ bundle-name@^3.0.0: dependencies: run-applescript "^5.0.0" +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1433,7 +1441,7 @@ define-lazy-prop@^3.0.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== depd@^1.1.2: version "1.1.2" @@ -1469,6 +1477,15 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + electron-to-chromium@^1.4.601: version "1.4.614" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" @@ -1491,6 +1508,33 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1780,13 +1824,15 @@ form-data-encoder@1.7.2: resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" formdata-node@^4.3.2: @@ -1822,11 +1868,35 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" @@ -1887,6 +1957,11 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -1907,6 +1982,18 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + hasown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" @@ -1914,6 +2001,13 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -2611,6 +2705,11 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -2629,17 +2728,17 @@ micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2691,9 +2790,9 @@ node-domexception@1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7: - version "2.6.11" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -3230,7 +3329,7 @@ to-regex-range@^5.0.1: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-api-utils@^1.0.1: version "1.3.0" @@ -3332,10 +3431,10 @@ typescript@^4.8.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== untildify@^4.0.0: version "4.0.0" @@ -3391,12 +3490,12 @@ web-streams-polyfill@4.0.0-beta.1: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" From 3a5f70cf0b56cfd3d8ebbad58361eef60dbb8896 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:13:42 +0000 Subject: [PATCH 43/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/swaps.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 21983a4..3aba996 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-7ef28075e2f4fe9332af29a90c7930da86493234d9973c10c2804191706c54f9.yml -openapi_spec_hash: d1bf81829143a988598cf8e0542cf36b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-e77b27df2686332181fc50b583302aefc0f3ac99956d15c3d60337db309d2083.yml +openapi_spec_hash: 1d7c7368409e5f731e8ef20cff080a66 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index bc0d495..83a7ec3 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -340,6 +340,8 @@ export interface SwapCreateParams { refuel?: boolean; + refund_address?: string | null; + slippage?: string | null; source_address?: string | null; From f3a94d35b0ede08af07fd37d4d52a81914a2fd30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 02:30:00 +0000 Subject: [PATCH 44/65] chore(internal): use npm pack for build uploads --- scripts/utils/upload-artifact.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 80b4c8b..95cd721 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" From 266b17a71617034ecdb3f88b056c3054f6735a53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:13:30 +0000 Subject: [PATCH 45/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3aba996..efe02d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-e77b27df2686332181fc50b583302aefc0f3ac99956d15c3d60337db309d2083.yml -openapi_spec_hash: 1d7c7368409e5f731e8ef20cff080a66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d5aca728b9b2e1fe5cffd17abbcc39a19390573bf7baf393d17f9d110992ccdb.yml +openapi_spec_hash: f4b97774002c543b92f722264dc16c32 config_hash: c54b23009f612fcc914964f7a1327a91 From 7a0e7ab5989351cc6cb9f16cade61882b74715aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:13:45 +0000 Subject: [PATCH 46/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/networks/destinations.ts | 2 ++ src/resources/networks/sources.ts | 2 ++ src/resources/shared.ts | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index efe02d4..169d26f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d5aca728b9b2e1fe5cffd17abbcc39a19390573bf7baf393d17f9d110992ccdb.yml -openapi_spec_hash: f4b97774002c543b92f722264dc16c32 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-9005376169aba37e838d1fc499d2274b09253aca8d2e60496c620e0e6f4dea5e.yml +openapi_spec_hash: 5ad265c83fa9b1e25dce9895b471dea6 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index eaa713f..4643b93 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -85,6 +85,8 @@ export namespace DestinationListResponse { display_asset?: string; + group?: string | null; + listing_date?: string; logo?: string; diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index 1a70518..b0d8b7b 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -82,6 +82,8 @@ export namespace SourceListResponse { display_asset?: string; + group?: string | null; + listing_date?: string; logo?: string; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index bf99f2f..5d26ad4 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -111,6 +111,8 @@ export interface Token { display_asset?: string; + group?: string | null; + listing_date?: string; logo?: string; From 837eaed787ad89bab95069191341d2d83317e69f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:13:34 +0000 Subject: [PATCH 47/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 169d26f..8d5f4d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-9005376169aba37e838d1fc499d2274b09253aca8d2e60496c620e0e6f4dea5e.yml -openapi_spec_hash: 5ad265c83fa9b1e25dce9895b471dea6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-c883c862fed2af3afed2a3be51f2b3f59b6568fe6122cf2eb4d7d79279747360.yml +openapi_spec_hash: a6cd700ede64ec5569a32813468af1e0 config_hash: c54b23009f612fcc914964f7a1327a91 From e7e420b69bac63d82f86b44d7b3bf44473c70984 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:13:32 +0000 Subject: [PATCH 48/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/deposit-actions.ts | 8 -------- src/resources/swaps/limits.ts | 10 ---------- src/resources/swaps/quote.ts | 11 ----------- src/resources/swaps/swaps.ts | 26 -------------------------- 5 files changed, 2 insertions(+), 57 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8d5f4d0..1778a94 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-c883c862fed2af3afed2a3be51f2b3f59b6568fe6122cf2eb4d7d79279747360.yml -openapi_spec_hash: a6cd700ede64ec5569a32813468af1e0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-b3711a6db3c6f7b5b40f81b301c5073bbaaa6158beb894d54dd8f1ba967601e9.yml +openapi_spec_hash: e487aa364cad07984352d29e2e8d0acb config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index 934887c..ed8b2d7 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -8,14 +8,6 @@ import * as Shared from '../shared'; export class DepositActions extends APIResource { /** * Retrieves the deposit actions for a specific swap. - * - * @example - * ```ts - * const listTransferDepositAction = - * await client.swaps.depositActions.list( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * ); - * ``` */ list( swapId: string, diff --git a/src/resources/swaps/limits.ts b/src/resources/swaps/limits.ts index 8ebd648..c450e8e 100644 --- a/src/resources/swaps/limits.ts +++ b/src/resources/swaps/limits.ts @@ -7,16 +7,6 @@ import * as Shared from '../shared'; export class Limits extends APIResource { /** * Retrieves the limits for swap route. - * - * @example - * ```ts - * const limits = await client.swaps.limits.list({ - * destination_network: 'destination_network', - * destination_token: 'destination_token', - * source_network: 'source_network', - * source_token: 'source_token', - * }); - * ``` */ list(query: LimitListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/limits', { query, ...options }); diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 43aaf8a..565944f 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -8,17 +8,6 @@ import * as SwapsAPI from './swaps'; export class QuoteResource extends APIResource { /** * Retrieves a swap quote based on the provided route request. - * - * @example - * ```ts - * const quote = await client.swaps.quote.retrieve({ - * amount: 0, - * destination_network: 'destination_network', - * destination_token: 'destination_token', - * source_network: 'source_network', - * source_token: 'source_token', - * }); - * ``` */ retrieve( query: QuoteRetrieveParams, diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index 83a7ec3..d963991 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -18,18 +18,6 @@ export class Swaps extends APIResource { /** * Creates a new swap based on the provided request. - * - * @example - * ```ts - * const swap = await client.swaps.create({ - * amount: 0.0042, - * destination_address: '0x', - * destination_network: 'ARBITRUM_MAINNET', - * destination_token: 'ETH', - * source_network: 'ETHEREUM_MAINNET', - * source_token: 'ETH', - * }); - * ``` */ create(body: SwapCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/api/v2/swaps', { body, ...options }); @@ -37,13 +25,6 @@ export class Swaps extends APIResource { /** * Retrieves the details of a specific swap by its ID. - * - * @example - * ```ts - * const swap = await client.swaps.retrieve( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * ); - * ``` */ retrieve( swapId: string, @@ -64,13 +45,6 @@ export class Swaps extends APIResource { /** * Retrieves a list of all swaps. - * - * @example - * ```ts - * const swaps = await client.swaps.list({ - * address: 'address', - * }); - * ``` */ list(query: SwapListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/swaps', { query, ...options }); From cd352fa6ca2552f112304e9a816affecd49d0ba0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 14:13:44 +0000 Subject: [PATCH 49/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/swaps.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1778a94..0a2a736 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-b3711a6db3c6f7b5b40f81b301c5073bbaaa6158beb894d54dd8f1ba967601e9.yml -openapi_spec_hash: e487aa364cad07984352d29e2e8d0acb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d7c065e6a99ef00cd87d48010e9baf690e753777f48421108b68667908149666.yml +openapi_spec_hash: fbbbd5e9236a0aace6ea2215100a6f26 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index d963991..d15bbde 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -300,7 +300,7 @@ export interface SwapListResponse { } export interface SwapCreateParams { - amount?: number; + amount?: number | null; destination_address?: string; From 2fa86153438e7c36237cd84041f9c9a0fd3a5ebd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:13:44 +0000 Subject: [PATCH 50/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/networks/sources.ts | 2 ++ tests/api-resources/networks/sources.test.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a2a736..5a4bce7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-d7c065e6a99ef00cd87d48010e9baf690e753777f48421108b68667908149666.yml -openapi_spec_hash: fbbbd5e9236a0aace6ea2215100a6f26 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-07f724ec9417b0b571c6effca5403a727ac5b25386ff3f0fa398f9f68f633ecb.yml +openapi_spec_hash: 0c63b924cd3f210eaba157816dc9c613 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index b0d8b7b..ce3ca72 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -108,6 +108,8 @@ export interface SourceListParams { destination_token?: string; + has_deposit_address?: boolean; + include_swaps?: boolean; include_unavailable?: boolean; diff --git a/tests/api-resources/networks/sources.test.ts b/tests/api-resources/networks/sources.test.ts index d643f44..7d4297a 100644 --- a/tests/api-resources/networks/sources.test.ts +++ b/tests/api-resources/networks/sources.test.ts @@ -34,6 +34,7 @@ describe('resource sources', () => { { destination_network: 'destination_network', destination_token: 'destination_token', + has_deposit_address: true, include_swaps: true, include_unavailable: true, include_unmatched: true, From 092687b3b8e1e71adcecc9c4840c30afdc5e2691 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:13:42 +0000 Subject: [PATCH 51/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5a4bce7..fed0481 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-07f724ec9417b0b571c6effca5403a727ac5b25386ff3f0fa398f9f68f633ecb.yml -openapi_spec_hash: 0c63b924cd3f210eaba157816dc9c613 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-5895a010513a356910315004576e4e51129650fe66f91f830fad0758b128fe83.yml +openapi_spec_hash: 15e4184d969220011de3c1b194be53b3 config_hash: c54b23009f612fcc914964f7a1327a91 From a7a4967d14e0e8cac20ca336b03940265ce4efc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:13:34 +0000 Subject: [PATCH 52/65] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fed0481..910c262 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-5895a010513a356910315004576e4e51129650fe66f91f830fad0758b128fe83.yml -openapi_spec_hash: 15e4184d969220011de3c1b194be53b3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-0319d071175ae1cebf86e3d0dcfac22f678f77115857fbd51d02fd9845dca172.yml +openapi_spec_hash: dd5a94b89e243e0905c3fd476f5288cc config_hash: c54b23009f612fcc914964f7a1327a91 From f2030ba49268575eb14b8f93c6ff9c44deef88a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 15:13:38 +0000 Subject: [PATCH 53/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/quote.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 910c262..e699b29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-0319d071175ae1cebf86e3d0dcfac22f678f77115857fbd51d02fd9845dca172.yml -openapi_spec_hash: dd5a94b89e243e0905c3fd476f5288cc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-05b0060897bcc987ee640ed286196cab5568c35375cd397de807d8947ffd0b61.yml +openapi_spec_hash: 5b34542d973be4212fe806de9c013728 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 565944f..081639f 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -30,6 +30,8 @@ export interface Quote { min_receive_amount?: number; + rate?: number; + receive_amount?: number; refuel_in_source?: number | null; From b00af238f9fd73b88009c8037421395aba77e8b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:13:26 +0000 Subject: [PATCH 54/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/networks/destinations.ts | 2 ++ src/resources/networks/sources.ts | 2 ++ src/resources/shared.ts | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e699b29..53a3e0f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-05b0060897bcc987ee640ed286196cab5568c35375cd397de807d8947ffd0b61.yml -openapi_spec_hash: 5b34542d973be4212fe806de9c013728 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-4fceb32cccf5e1f854096b76abf631976ab2f72d74ca85acdd9ff44b75e4bb6b.yml +openapi_spec_hash: c20424678981440bb486ceb36187dba0 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 4643b93..64dee54 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -54,6 +54,8 @@ export namespace DestinationListResponse { node_url?: string | null; + nodes?: Array | null; + source_rank?: number; tokens?: Array; diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index ce3ca72..94369c1 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -51,6 +51,8 @@ export namespace SourceListResponse { node_url?: string | null; + nodes?: Array | null; + source_rank?: number; tokens?: Array; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 5d26ad4..5272225 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -29,6 +29,8 @@ export interface Network { node_url?: string | null; + nodes?: Array | null; + source_rank?: number; transaction_explorer_template?: string; @@ -81,6 +83,8 @@ export interface NetworkWithTokens { node_url?: string | null; + nodes?: Array | null; + source_rank?: number; tokens?: Array; From a9bfec9c1685f38f05399052498a6393c3b48eeb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:13:21 +0000 Subject: [PATCH 55/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/quote.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 53a3e0f..bf65bc1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-4fceb32cccf5e1f854096b76abf631976ab2f72d74ca85acdd9ff44b75e4bb6b.yml -openapi_spec_hash: c20424678981440bb486ceb36187dba0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-3ed8f43eefc06db18404a95e53082df7ea37944303229391abd4858c41dbebe5.yml +openapi_spec_hash: e4c037c7a305eb0347abf6530253e4eb config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index 081639f..a62272f 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -30,6 +30,8 @@ export interface Quote { min_receive_amount?: number; + path?: Array; + rate?: number; receive_amount?: number; @@ -51,6 +53,14 @@ export interface Quote { total_fee_in_usd?: number; } +export namespace Quote { + export interface Path { + order?: number; + + provider?: string; + } +} + export interface QuoteRetrieveResponse { data?: SwapsAPI.SwapQuoteResponse; From 52517c3bf87aa0c587329dfbc0d38e5ff8c8be97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:19:44 +0000 Subject: [PATCH 56/65] feat(api): api update --- .github/workflows/ci.yml | 30 +- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- .stats.yml | 4 +- CONTRIBUTING.md | 6 +- LICENSE | 2 +- README.md | 16 +- scripts/mock | 31 +- scripts/test | 16 +- src/core.ts | 37 +- src/index.ts | 6 +- src/internal/utils/query.ts | 7 + src/resources/swaps/deposit-actions.ts | 2 + src/resources/swaps/swaps.ts | 4 + tests/api-resources/swaps/swaps.test.ts | 6 +- tests/index.test.ts | 24 +- tests/stringifyQuery.test.ts | 6 +- yarn.lock | 562 +++++++++++------------- 18 files changed, 385 insertions(+), 378 deletions(-) create mode 100644 src/internal/utils/query.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ed2e34..e36a5e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -19,7 +21,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -41,7 +43,7 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -55,14 +57,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/layerswap-node' + if: |- + github.repository == 'stainless-sdks/layerswap-node' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/layerswap-node' + if: |- + github.repository == 'stainless-sdks/layerswap-node' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -74,7 +80,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 11f2831..652a30f 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v3 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 0a0e69c..7c6a492 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'layerswap/layerswap-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | diff --git a/.stats.yml b/.stats.yml index bf65bc1..2286b82 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-3ed8f43eefc06db18404a95e53082df7ea37944303229391abd4858c41dbebe5.yml -openapi_spec_hash: e4c037c7a305eb0347abf6530253e4eb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-02b1c0baeb0039411103d75eac29d1ba3ee555e24e8123ca6a3f888f50b8c053.yml +openapi_spec_hash: 13c9ace946524958a5a3d4f3d6ac5c2f config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88fa1d0..a917ac6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,15 +60,15 @@ $ yarn link @layerswap/sdk # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global @layerswap/sdk +$ pnpm link --global @layerswap/sdk ``` ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/LICENSE b/LICENSE index 7928a47..af6ef47 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Layerswap + Copyright 2026 Layerswap Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index c70aa71..72de1ef 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,13 @@ const client = new Layerswap({ }); // Or, configure per-request: -await client.swaps.quote.retrieve({ amount: 0, destination_network: 'destination_network', destination_token: 'destination_token', source_network: 'source_network', source_token: 'source_token' }, { +await client.swaps.quote.retrieve({ + amount: 0, + destination_network: 'destination_network', + destination_token: 'destination_token', + source_network: 'source_network', + source_token: 'source_token', +}, { maxRetries: 5, }); ``` @@ -134,7 +140,13 @@ const client = new Layerswap({ }); // Override per-request: -await client.swaps.quote.retrieve({ amount: 0, destination_network: 'destination_network', destination_token: 'destination_token', source_network: 'source_network', source_token: 'source_token' }, { +await client.swaps.quote.retrieve({ + amount: 0, + destination_network: 'destination_network', + destination_token: 'destination_token', + source_network: 'source_network', + source_token: 'source_token', +}, { timeout: 5 * 1000, }); ``` diff --git a/scripts/mock b/scripts/mock index 0b28f6e..e1c19e8 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,23 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.19.4 -- steady --version - # Wait for server to come online + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 7bce051..8cf5220 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/src/core.ts b/src/core.ts index 2a2652f..c8577c2 100644 --- a/src/core.ts +++ b/src/core.ts @@ -6,6 +6,7 @@ import { APIConnectionTimeoutError, APIUserAbortError, } from './error'; +import { stringifyQuery } from './internal/utils/query'; import { kind as shimsKind, type Readable, @@ -70,6 +71,12 @@ async function defaultParseResponse(props: APIResponseProps): Promise { const mediaType = contentType?.split(';')[0]?.trim(); const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { + const contentLength = response.headers.get('content-length'); + if (contentLength === '0') { + // if there is no content we can't do anything + return undefined as T; + } + const json = await response.json(); debug('response', response.status, response.url, response.headers, json); @@ -517,32 +524,20 @@ export abstract class APIClient { : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query } as Req; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query } as Req; } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); } - protected stringifyQuery(query: Record): string { - return Object.entries(query) - .filter(([_, value]) => typeof value !== 'undefined') - .map(([key, value]) => { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new LayerswapError( - `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, - ); - }) - .join('&'); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } async fetchWithTimeout( @@ -624,9 +619,9 @@ export abstract class APIClient { } } - // If the API asks us to wait a certain amount of time (and it's a reasonable amount), - // just do what it says, but otherwise calculate a default - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { + // If the API asks us to wait a certain amount of time, do what it says. + // Otherwise calculate a default. + if (timeoutMillis === undefined) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } diff --git a/src/index.ts b/src/index.ts index 3913094..fa50b33 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { type Agent } from './_shims/index'; -import * as qs from './internal/qs'; +import { stringifyQuery } from './internal/utils/query'; import * as Core from './core'; import * as Errors from './error'; import * as Uploads from './uploads'; @@ -165,8 +165,8 @@ export class Layerswap extends Core.APIClient { return { 'X-LS-APIKEY': this.apiKey }; } - protected override stringifyQuery(query: Record): string { - return qs.stringify(query, { arrayFormat: 'comma' }); + protected override stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } static Layerswap = this; diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 0000000..0139cac --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import * as qs from '../qs/stringify'; + +export function stringifyQuery(query: object | Record) { + return qs.stringify(query, { arrayFormat: 'comma' }); +} diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index ed8b2d7..32d6955 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -43,6 +43,8 @@ export namespace ListTransferDepositAction { call_data?: string | null; + encoded_args?: Array | null; + fee_token?: Shared.Token; network?: Shared.Network; diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index d15bbde..77c2dc0 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -73,6 +73,8 @@ export namespace PreparedSwapResponse { call_data?: string | null; + encoded_args?: Array | null; + fee_token?: Shared.Token; network?: Shared.Network; @@ -328,6 +330,8 @@ export interface SwapCreateParams { use_deposit_address?: boolean; + use_depository?: boolean; + use_new_deposit_address?: boolean | null; } diff --git a/tests/api-resources/swaps/swaps.test.ts b/tests/api-resources/swaps/swaps.test.ts index b8e6e72..4061131 100644 --- a/tests/api-resources/swaps/swaps.test.ts +++ b/tests/api-resources/swaps/swaps.test.ts @@ -61,6 +61,10 @@ describe('resource swaps', () => { }); test('list: required and optional params', async () => { - const response = await client.swaps.list({ address: 'address', include_expired: true, page: 0 }); + const response = await client.swaps.list({ + address: 'address', + include_expired: true, + page: 0, + }); }); }); diff --git a/tests/index.test.ts b/tests/index.test.ts index 275f630..944d9e8 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -276,7 +276,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Layerswap({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new Layerswap({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -306,7 +310,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Layerswap({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Layerswap({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); @@ -330,7 +338,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Layerswap({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Layerswap({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ @@ -392,7 +404,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Layerswap({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Layerswap({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index ebfbe82..e14b342 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { Layerswap } from '@layerswap/sdk'; - -const { stringifyQuery } = Layerswap.prototype as any; +import { stringifyQuery } from '@layerswap/sdk/internal/utils/query'; describe(stringifyQuery, () => { for (const [input, expected] of [ @@ -15,7 +13,7 @@ describe(stringifyQuery, () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); }); diff --git a/yarn.lock b/yarn.lock index 2bcc59e..d6c83fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,163 +7,119 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" - integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" + integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== dependencies: - "@babel/highlight" "^7.23.4" - chalk "^2.4.2" + "@babel/helper-validator-identifier" "^7.28.5" + js-tokens "^4.0.0" + picocolors "^1.1.1" -"@babel/compat-data@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" - integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== +"@babel/compat-data@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" + integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.6.tgz#8be77cd77c55baadcc1eae1c33df90ab6d2151d4" - integrity sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.23.6" - "@babel/parser" "^7.23.6" - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" + integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-compilation-targets" "^7.28.6" + "@babel/helper-module-transforms" "^7.28.6" + "@babel/helpers" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.23.6", "@babel/generator@^7.7.2": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" - integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== +"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" + integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== + dependencies: + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" + jsesc "^3.0.2" + +"@babel/helper-compilation-targets@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" + integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== + dependencies: + "@babel/compat-data" "^7.28.6" + "@babel/helper-validator-option" "^7.27.1" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + +"@babel/helper-module-imports@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== dependencies: - "@babel/types" "^7.23.6" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== +"@babel/helper-module-transforms@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" + integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" - lru-cache "^5.1.1" - semver "^6.3.1" + "@babel/helper-module-imports" "^7.28.6" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/traverse" "^7.28.6" -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-module-imports@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" - integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" - integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== - -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== - -"@babel/helpers@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.6.tgz#d03af2ee5fb34691eec0cda90f5ecbb4d4da145a" - integrity sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA== - dependencies: - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" - -"@babel/highlight@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" - integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" + integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== + +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" - integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/helper-validator-option@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" + integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== + +"@babel/helpers@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" + integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== + dependencies: + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" + integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== + dependencies: + "@babel/types" "^7.28.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -179,14 +135,28 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-attributes@^7.24.7": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" + integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -201,13 +171,13 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" - integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" + integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.28.6" -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -221,7 +191,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -249,7 +219,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== @@ -257,45 +234,41 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" - integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/template@^7.22.15", "@babel/template@^7.3.3": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" - integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== - dependencies: - "@babel/code-frame" "^7.22.13" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" - -"@babel/traverse@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" - integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" + integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/template@^7.28.6", "@babel/template@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + +"@babel/traverse@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" + integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" debug "^4.3.1" - globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.3.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" - integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.6", "@babel/types@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" + integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -585,31 +558,38 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" - integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== +"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/remapping@^2.3.5": + version "2.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" + integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": +"@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18": version "0.3.20" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== @@ -617,6 +597,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1045,13 +1033,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -1134,22 +1115,25 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" + integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" babel-preset-jest@^29.6.3: version "29.6.3" @@ -1164,6 +1148,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +baseline-browser-mapping@^2.9.0: + version "2.9.14" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" + integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== + big-integer@^1.6.44: version "1.6.52" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" @@ -1177,17 +1166,17 @@ bplist-parser@^0.2.0: big-integer "^1.6.44" brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + version "1.1.12" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" + integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" + integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== dependencies: balanced-match "^1.0.0" @@ -1198,15 +1187,16 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.22.2: - version "4.22.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.2.tgz#704c4943072bd81ea18997f3bd2180e89c77874b" - integrity sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A== +browserslist@^4.24.0: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - caniuse-lite "^1.0.30001565" - electron-to-chromium "^1.4.601" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" bs-logger@0.x: version "0.2.6" @@ -1257,19 +1247,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001565: - version "1.0.30001570" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz#b4e5c1fa786f733ab78fc70f592df6b3f23244ca" - integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" +caniuse-lite@^1.0.30001759: + version "1.0.30001764" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" + integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== chalk@^4.0.0: version "4.1.2" @@ -1318,13 +1299,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -1332,11 +1306,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -1486,10 +1455,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.4.601: - version "1.4.614" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" - integrity sha512-X4ze/9Sc3QWs6h92yerwqv7aB/uU8vCjZcrMjA8N9R1pjMFRe44dLsck5FzLilOYvcXuDn93B+bpGYyufc70gQ== +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== emittery@^0.13.1: version "0.13.1" @@ -1540,10 +1509,10 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^2.0.0: version "2.0.0" @@ -1933,11 +1902,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - globals@^13.19.0: version "13.20.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" @@ -1972,11 +1936,6 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -2581,24 +2540,24 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" + integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== dependencies: argparse "^1.0.7" esprima "^4.0.0" js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== json-parse-even-better-errors@^2.3.0: version "2.3.1" @@ -2801,10 +2760,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== normalize-path@^3.0.0: version "3.0.0" @@ -2967,6 +2926,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -3256,13 +3220,6 @@ superstruct@^1.0.3: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046" integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -3314,11 +3271,6 @@ tmpl@1.0.5: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3441,13 +3393,13 @@ untildify@^4.0.0: resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" uri-js@^4.2.2: version "4.4.1" From 7fcc0255d3f1c27722cb85e98a018518264e0487 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 04:43:14 +0000 Subject: [PATCH 57/65] chore(tests): bump steady to v0.19.5 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index e1c19e8..ab814d3 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.4 -- steady --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 8cf5220..907f7be 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From e997b3b2352405b32ed034096112453a604f1c68 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:17:05 +0000 Subject: [PATCH 58/65] chore(internal): codegen related update --- .gitignore | 1 + scripts/mock | 6 +++--- scripts/test | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2412bb7..c85fe68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log node_modules yarn-error.log codegen.log diff --git a/scripts/mock b/scripts/mock index ab814d3..b319bdf 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.5 -- steady --version + npm exec --package=@stdy/cli@0.19.6 -- steady --version - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 907f7be..8061e04 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 5fef8edeb827fdcfd440a63a301e5308916ed589 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:01:10 +0000 Subject: [PATCH 59/65] chore(internal): codegen related update --- .github/workflows/ci.yml | 4 ++-- scripts/mock | 6 +++--- scripts/test | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36a5e5..583fb5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -38,7 +38,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/layerswap-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read id-token: write diff --git a/scripts/mock b/scripts/mock index b319bdf..09eb49f 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.6 -- steady --version + npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 8061e04..a7cf561 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 711fb7be6f6ce8feb7a93d5874782a070c3a9f73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 05:25:02 +0000 Subject: [PATCH 60/65] chore(internal): codegen related update --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index 09eb49f..290e21b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -24,7 +24,7 @@ if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a7cf561..a1ebb5e 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From e5028d05771411c7ac976ad8d5a8c59b49e87196 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 13:19:50 +0000 Subject: [PATCH 61/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/swaps/deposit-actions.ts | 2 ++ src/resources/swaps/swaps.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2286b82..3e1dece 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-02b1c0baeb0039411103d75eac29d1ba3ee555e24e8123ca6a3f888f50b8c053.yml -openapi_spec_hash: 13c9ace946524958a5a3d4f3d6ac5c2f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-224b792b2ead1dafc497fc9cbe32134e81d9559440053eef39aca3b6bf33500e.yml +openapi_spec_hash: 63b690a49361dc49ec8a39b1c67bb016 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/swaps/deposit-actions.ts b/src/resources/swaps/deposit-actions.ts index 32d6955..bd871ec 100644 --- a/src/resources/swaps/deposit-actions.ts +++ b/src/resources/swaps/deposit-actions.ts @@ -47,6 +47,8 @@ export namespace ListTransferDepositAction { fee_token?: Shared.Token; + gas_limit?: string | null; + network?: Shared.Network; order?: number; diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index 77c2dc0..0375d31 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -77,6 +77,8 @@ export namespace PreparedSwapResponse { fee_token?: Shared.Token; + gas_limit?: string | null; + network?: Shared.Network; order?: number; From 0b8055efcfd91f4a1dce7ecccb6fcf44f0222c9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:19:49 +0000 Subject: [PATCH 62/65] feat(api): api update --- .stats.yml | 4 ++-- src/resources/networks/destinations.ts | 6 +++++- src/resources/networks/sources.ts | 6 +++++- src/resources/swaps/limits.ts | 6 +++++- src/resources/swaps/quote.ts | 6 +++++- src/resources/swaps/swaps.ts | 6 +++++- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3e1dece..85ffd9a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-224b792b2ead1dafc497fc9cbe32134e81d9559440053eef39aca3b6bf33500e.yml -openapi_spec_hash: 63b690a49361dc49ec8a39b1c67bb016 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-eeba6c1a3a075fe15d0739d565a0c2805bfa01c263dd5066c1f4993005f86a92.yml +openapi_spec_hash: df38eb0384dd68b5ef6980235ad60c80 config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/src/resources/networks/destinations.ts b/src/resources/networks/destinations.ts index 64dee54..6dbdf38 100644 --- a/src/resources/networks/destinations.ts +++ b/src/resources/networks/destinations.ts @@ -8,7 +8,11 @@ import * as SwapsAPI from '../swaps/swaps'; export class Destinations extends APIResource { /** - * Retrieves all available destination routes. + * Retrieves all available destination routes. Token parameters accept either asset + * names (e.g. USDC, ETH) or token contract addresses (e.g. 0xa0b8...). For native + * tokens via contract address, use the network's zero address (e.g. + * 0x0000000000000000000000000000000000000000 for EVM, + * 11111111111111111111111111111111 for Solana). */ list( query?: DestinationListParams, diff --git a/src/resources/networks/sources.ts b/src/resources/networks/sources.ts index 94369c1..7378883 100644 --- a/src/resources/networks/sources.ts +++ b/src/resources/networks/sources.ts @@ -8,7 +8,11 @@ import * as SwapsAPI from '../swaps/swaps'; export class Sources extends APIResource { /** - * Retrieves all available source routes. + * Retrieves all available source routes. Token parameters accept either asset + * names (e.g. USDC, ETH) or token contract addresses (e.g. 0xa0b8...). For native + * tokens via contract address, use the network's zero address (e.g. + * 0x0000000000000000000000000000000000000000 for EVM, + * 11111111111111111111111111111111 for Solana). */ list(query?: SourceListParams, options?: Core.RequestOptions): Core.APIPromise; list(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/swaps/limits.ts b/src/resources/swaps/limits.ts index c450e8e..46a664b 100644 --- a/src/resources/swaps/limits.ts +++ b/src/resources/swaps/limits.ts @@ -6,7 +6,11 @@ import * as Shared from '../shared'; export class Limits extends APIResource { /** - * Retrieves the limits for swap route. + * Retrieves the limits for swap route. Token parameters accept either asset names + * (e.g. USDC, ETH) or token contract addresses (e.g. 0xa0b8...). For native tokens + * via contract address, use the network's zero address (e.g. + * 0x0000000000000000000000000000000000000000 for EVM, + * 11111111111111111111111111111111 for Solana). */ list(query: LimitListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/api/v2/limits', { query, ...options }); diff --git a/src/resources/swaps/quote.ts b/src/resources/swaps/quote.ts index a62272f..5a459c3 100644 --- a/src/resources/swaps/quote.ts +++ b/src/resources/swaps/quote.ts @@ -7,7 +7,11 @@ import * as SwapsAPI from './swaps'; export class QuoteResource extends APIResource { /** - * Retrieves a swap quote based on the provided route request. + * Retrieves a swap quote based on the provided route request. Token parameters + * accept either asset names (e.g. USDC, ETH) or token contract addresses (e.g. + * 0xa0b8...). For native tokens via contract address, use the network's zero + * address (e.g. 0x0000000000000000000000000000000000000000 for EVM, + * 11111111111111111111111111111111 for Solana). */ retrieve( query: QuoteRetrieveParams, diff --git a/src/resources/swaps/swaps.ts b/src/resources/swaps/swaps.ts index 0375d31..a1351e9 100644 --- a/src/resources/swaps/swaps.ts +++ b/src/resources/swaps/swaps.ts @@ -17,7 +17,11 @@ export class Swaps extends APIResource { quote: QuoteAPI.QuoteResource = new QuoteAPI.QuoteResource(this._client); /** - * Creates a new swap based on the provided request. + * Creates a new swap based on the provided request. Token parameters accept either + * asset names (e.g. USDC, ETH) or token contract addresses (e.g. 0xa0b8...). For + * native tokens via contract address, use the network's zero address (e.g. + * 0x0000000000000000000000000000000000000000 for EVM, + * 11111111111111111111111111111111 for Solana). */ create(body: SwapCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/api/v2/swaps', { body, ...options }); From 4b85b6c05f0c3b28c7bbabdab03d383d42c13bae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 18:20:03 +0000 Subject: [PATCH 63/65] feat(api): api update --- .stats.yml | 4 ++-- scripts/mock | 6 +++--- scripts/test | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 85ffd9a..049251d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-eeba6c1a3a075fe15d0739d565a0c2805bfa01c263dd5066c1f4993005f86a92.yml -openapi_spec_hash: df38eb0384dd68b5ef6980235ad60c80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babgev%2Flayerswap-9df2a2574bdc1162441f84dc9254992ecb4509d68eb8c516a3bfd0f00a025f27.yml +openapi_spec_hash: e2c25cf40779795d595bb3e34025082d config_hash: c54b23009f612fcc914964f7a1327a91 diff --git a/scripts/mock b/scripts/mock index 290e21b..15c2994 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.7 -- steady --version + npm exec --package=@stdy/cli@0.20.1 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a1ebb5e..7431f9f 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 84ff05ac320943f0e98470878094c2fca9a91048 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 07:04:33 +0000 Subject: [PATCH 64/65] chore(tests): bump steady to v0.20.2 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 15c2994..5cd7c15 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.1 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 7431f9f..a9d718c 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 79b1427180ebfe6fa12d2b4fe0a64bd8662bbcad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 07:05:06 +0000 Subject: [PATCH 65/65] release: 0.1.0-alpha.11 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 80 +++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 931fce1..acba45e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.10" + ".": "0.1.0-alpha.11" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bea470..7031d67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,85 @@ # Changelog +## 0.1.0-alpha.11 (2026-04-01) + +Full Changelog: [v0.1.0-alpha.10...v0.1.0-alpha.11](https://github.com/layerswap/layerswap-sdk/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) + +### Features + +* add SKIP_BREW env var to ./scripts/bootstrap ([#78](https://github.com/layerswap/layerswap-sdk/issues/78)) ([5ffa9db](https://github.com/layerswap/layerswap-sdk/commit/5ffa9db46aab3e1f16a1128fe92c324f17941379)) +* **api:** api update ([4b85b6c](https://github.com/layerswap/layerswap-sdk/commit/4b85b6c05f0c3b28c7bbabdab03d383d42c13bae)) +* **api:** api update ([0b8055e](https://github.com/layerswap/layerswap-sdk/commit/0b8055efcfd91f4a1dce7ecccb6fcf44f0222c9c)) +* **api:** api update ([e5028d0](https://github.com/layerswap/layerswap-sdk/commit/e5028d05771411c7ac976ad8d5a8c59b49e87196)) +* **api:** api update ([52517c3](https://github.com/layerswap/layerswap-sdk/commit/52517c3bf87aa0c587329dfbc0d38e5ff8c8be97)) +* **api:** api update ([a9bfec9](https://github.com/layerswap/layerswap-sdk/commit/a9bfec9c1685f38f05399052498a6393c3b48eeb)) +* **api:** api update ([b00af23](https://github.com/layerswap/layerswap-sdk/commit/b00af238f9fd73b88009c8037421395aba77e8b3)) +* **api:** api update ([f2030ba](https://github.com/layerswap/layerswap-sdk/commit/f2030ba49268575eb14b8f93c6ff9c44deef88a6)) +* **api:** api update ([2fa8615](https://github.com/layerswap/layerswap-sdk/commit/2fa86153438e7c36237cd84041f9c9a0fd3a5ebd)) +* **api:** api update ([cd352fa](https://github.com/layerswap/layerswap-sdk/commit/cd352fa6ca2552f112304e9a816affecd49d0ba0)) +* **api:** api update ([e7e420b](https://github.com/layerswap/layerswap-sdk/commit/e7e420b69bac63d82f86b44d7b3bf44473c70984)) +* **api:** api update ([7a0e7ab](https://github.com/layerswap/layerswap-sdk/commit/7a0e7ab5989351cc6cb9f16cade61882b74715aa)) +* **api:** api update ([3a5f70c](https://github.com/layerswap/layerswap-sdk/commit/3a5f70cf0b56cfd3d8ebbad58361eef60dbb8896)) +* **api:** api update ([33913e0](https://github.com/layerswap/layerswap-sdk/commit/33913e057918fed470cfd00139fe5dd9527f6c2a)) +* **api:** api update ([b65a2dc](https://github.com/layerswap/layerswap-sdk/commit/b65a2dc29119cfb5aefd9cbe82c6b8c31f4995a7)) +* **api:** api update ([716db99](https://github.com/layerswap/layerswap-sdk/commit/716db99dd13215003ad89ea675ec54ab3e0924f2)) +* **api:** api update ([cc6ffbe](https://github.com/layerswap/layerswap-sdk/commit/cc6ffbe56d3fa8fbbff5b4622c3395cfc674a256)) +* **api:** api update ([#48](https://github.com/layerswap/layerswap-sdk/issues/48)) ([ed0966a](https://github.com/layerswap/layerswap-sdk/commit/ed0966a2a6beca0856af47ea3fe6a1cffe6c2ae0)) +* **api:** api update ([#50](https://github.com/layerswap/layerswap-sdk/issues/50)) ([18ae7ab](https://github.com/layerswap/layerswap-sdk/commit/18ae7ab86f32a446008d3be6b52317b3b74f22e2)) +* **api:** api update ([#62](https://github.com/layerswap/layerswap-sdk/issues/62)) ([374e463](https://github.com/layerswap/layerswap-sdk/commit/374e4633b0a2fd7ddbe87f711e1c0a9af98f5371)) +* **api:** api update ([#63](https://github.com/layerswap/layerswap-sdk/issues/63)) ([1aabb79](https://github.com/layerswap/layerswap-sdk/commit/1aabb796e08c92d8aff83328036436e6928f74fb)) +* **api:** api update ([#69](https://github.com/layerswap/layerswap-sdk/issues/69)) ([689ebbe](https://github.com/layerswap/layerswap-sdk/commit/689ebbea58012286954f6524256215c2c5800e13)) +* **api:** api update ([#70](https://github.com/layerswap/layerswap-sdk/issues/70)) ([a0a44f1](https://github.com/layerswap/layerswap-sdk/commit/a0a44f14016500699f42e2d45f56530dc15bb584)) +* **api:** api update ([#75](https://github.com/layerswap/layerswap-sdk/issues/75)) ([0b2940a](https://github.com/layerswap/layerswap-sdk/commit/0b2940a298d003f82df1e68d77eafaecc86bef13)) +* **api:** api update ([#76](https://github.com/layerswap/layerswap-sdk/issues/76)) ([1848771](https://github.com/layerswap/layerswap-sdk/commit/18487714a8ee70eec85a5e5e697677cba7fbb553)) +* **client:** accept RFC6838 JSON content types ([#79](https://github.com/layerswap/layerswap-sdk/issues/79)) ([95b6207](https://github.com/layerswap/layerswap-sdk/commit/95b6207dac3235b2a740f4c12749fe7a56b0e816)) +* **internal:** make git install file structure match npm ([#57](https://github.com/layerswap/layerswap-sdk/issues/57)) ([ec1f35d](https://github.com/layerswap/layerswap-sdk/commit/ec1f35dfd716ab8699554512625abd9b05cb5925)) + + +### Bug Fixes + +* **api:** improve type resolution when importing as a package ([#81](https://github.com/layerswap/layerswap-sdk/issues/81)) ([4e0d8ec](https://github.com/layerswap/layerswap-sdk/commit/4e0d8eca81f0cf7d1880349c5306879d48a8c143)) +* **client:** normalize method ([#67](https://github.com/layerswap/layerswap-sdk/issues/67)) ([9fb83da](https://github.com/layerswap/layerswap-sdk/commit/9fb83daf993b2c7fe3bd513ebee6fa15c18783ea)) +* **mcp:** remove unused tools.ts ([#82](https://github.com/layerswap/layerswap-sdk/issues/82)) ([2d47b0d](https://github.com/layerswap/layerswap-sdk/commit/2d47b0d417ffa36e6c73b9acd523fa233d00d369)) + + +### Chores + +* **internal:** bump cross-spawn to v7.0.6 ([#59](https://github.com/layerswap/layerswap-sdk/issues/59)) ([1aae24f](https://github.com/layerswap/layerswap-sdk/commit/1aae24f9e76728158164dc58bff41f417d9e21f9)) +* **internal:** codegen related update ([711fb7b](https://github.com/layerswap/layerswap-sdk/commit/711fb7be6f6ce8feb7a93d5874782a070c3a9f73)) +* **internal:** codegen related update ([5fef8ed](https://github.com/layerswap/layerswap-sdk/commit/5fef8edeb827fdcfd440a63a301e5308916ed589)) +* **internal:** codegen related update ([e997b3b](https://github.com/layerswap/layerswap-sdk/commit/e997b3b2352405b32ed034096112453a604f1c68)) +* **internal:** codegen related update ([#65](https://github.com/layerswap/layerswap-sdk/issues/65)) ([ec5a2c9](https://github.com/layerswap/layerswap-sdk/commit/ec5a2c9b86ede54108d953596c82e367ec3c72a5)) +* **internal:** codegen related update ([#66](https://github.com/layerswap/layerswap-sdk/issues/66)) ([6788397](https://github.com/layerswap/layerswap-sdk/commit/67883979fd66207bde2031b445b91e3d2568ed36)) +* **internal:** codegen related update ([#68](https://github.com/layerswap/layerswap-sdk/issues/68)) ([9435804](https://github.com/layerswap/layerswap-sdk/commit/943580466332472d0f4a9ece82e2c4a0b205191d)) +* **internal:** codegen related update ([#71](https://github.com/layerswap/layerswap-sdk/issues/71)) ([dce763c](https://github.com/layerswap/layerswap-sdk/commit/dce763c80c107cf3010cfee40db9d4bd8654e20b)) +* **internal:** codegen related update ([#72](https://github.com/layerswap/layerswap-sdk/issues/72)) ([c207085](https://github.com/layerswap/layerswap-sdk/commit/c207085da083304751cf78c771832001159a2284)) +* **internal:** codegen related update ([#73](https://github.com/layerswap/layerswap-sdk/issues/73)) ([4335ee6](https://github.com/layerswap/layerswap-sdk/commit/4335ee6ddddaa0c343876380e124708d1ef82996)) +* **internal:** codegen related update ([#74](https://github.com/layerswap/layerswap-sdk/issues/74)) ([2ec9339](https://github.com/layerswap/layerswap-sdk/commit/2ec9339b328d254a3a51f06870d8b79419fd5de6)) +* **internal:** codegen related update ([#77](https://github.com/layerswap/layerswap-sdk/issues/77)) ([a8673d5](https://github.com/layerswap/layerswap-sdk/commit/a8673d5b5d63f35505a2408ea3b4a53ee5484115)) +* **internal:** codegen related update ([#80](https://github.com/layerswap/layerswap-sdk/issues/80)) ([c9a0874](https://github.com/layerswap/layerswap-sdk/commit/c9a08746ae50800d24c8b1d3c4bc19c7f577a8a5)) +* **internal:** fix some typos ([#64](https://github.com/layerswap/layerswap-sdk/issues/64)) ([8944cc6](https://github.com/layerswap/layerswap-sdk/commit/8944cc68f42c3ea05f7a20017ed20320497aa1eb)) +* **internal:** remove unnecessary getRequestClient function ([#58](https://github.com/layerswap/layerswap-sdk/issues/58)) ([4052b68](https://github.com/layerswap/layerswap-sdk/commit/4052b68c3968243c7afdbb4e1fe464063d3773f4)) +* **internal:** update isAbsoluteURL ([#61](https://github.com/layerswap/layerswap-sdk/issues/61)) ([563e6a1](https://github.com/layerswap/layerswap-sdk/commit/563e6a17b703eba639591c289748d4260484b8de)) +* **internal:** use npm pack for build uploads ([f3a94d3](https://github.com/layerswap/layerswap-sdk/commit/f3a94d35b0ede08af07fd37d4d52a81914a2fd30)) +* rebuild project due to codegen change ([#51](https://github.com/layerswap/layerswap-sdk/issues/51)) ([ed663ff](https://github.com/layerswap/layerswap-sdk/commit/ed663ff480a2ce0a85ec6a3cda02f035187eadb8)) +* rebuild project due to codegen change ([#52](https://github.com/layerswap/layerswap-sdk/issues/52)) ([d8a9c36](https://github.com/layerswap/layerswap-sdk/commit/d8a9c360e5f7018fc986638e4b60abf8f306fc2f)) +* rebuild project due to codegen change ([#53](https://github.com/layerswap/layerswap-sdk/issues/53)) ([4fbf81a](https://github.com/layerswap/layerswap-sdk/commit/4fbf81a9c272399ee9e5030dd10bb1d56ae1cf76)) +* rebuild project due to codegen change ([#54](https://github.com/layerswap/layerswap-sdk/issues/54)) ([91746a1](https://github.com/layerswap/layerswap-sdk/commit/91746a11dc05d5bdcbb65e66eed13703e03f9b20)) +* remove redundant word in comment ([#56](https://github.com/layerswap/layerswap-sdk/issues/56)) ([e77fa29](https://github.com/layerswap/layerswap-sdk/commit/e77fa2944109f07558f1c03719165cee0d96171f)) +* **tests:** bump steady to v0.19.5 ([7fcc025](https://github.com/layerswap/layerswap-sdk/commit/7fcc0255d3f1c27722cb85e98a018518264e0487)) +* **tests:** bump steady to v0.20.2 ([84ff05a](https://github.com/layerswap/layerswap-sdk/commit/84ff05ac320943f0e98470878094c2fca9a91048)) +* **types:** nicer error class types + jsdocs ([#60](https://github.com/layerswap/layerswap-sdk/issues/60)) ([436e284](https://github.com/layerswap/layerswap-sdk/commit/436e28417d2982fd03ad9fcdc8bfb30cf30bbad6)) + + +### Documentation + +* remove suggestion to use `npm` call out ([#55](https://github.com/layerswap/layerswap-sdk/issues/55)) ([e4fbba3](https://github.com/layerswap/layerswap-sdk/commit/e4fbba39e7770393ad0843cf65e014dc5536d69b)) + + +### Refactors + +* **types:** replace Record with mapped types ([399967a](https://github.com/layerswap/layerswap-sdk/commit/399967af72ce6bd5011b3ea2bbfc05adba25f222)) + ## 0.1.0-alpha.10 (2024-10-09) Full Changelog: [v0.1.0-alpha.9...v0.1.0-alpha.10](https://github.com/layerswap/layerswap-sdk/compare/v0.1.0-alpha.9...v0.1.0-alpha.10) diff --git a/package.json b/package.json index 0def9d7..936c6e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@layerswap/sdk", - "version": "0.1.0-alpha.10", + "version": "0.1.0-alpha.11", "description": "The official TypeScript library for the Layerswap API", "author": "Layerswap ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 5ed52cd..51a202a 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.10'; // x-release-please-version +export const VERSION = '0.1.0-alpha.11'; // x-release-please-version