@ravnexchange/sdk 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -1
- package/dist/client.js +4 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export interface RavnClientConfig {
|
|
|
4
4
|
apiKey?: string;
|
|
5
5
|
/** Default: https://app.ravn.exchange/api/v1 */
|
|
6
6
|
baseUrl?: string;
|
|
7
|
-
/** Swap in your own fetch (e.g. for React Native, or a test double). Defaults to global fetch.
|
|
7
|
+
/** Swap in your own fetch (e.g. for React Native, or a test double). Defaults to global fetch.
|
|
8
|
+
* Called as a plain function (no `this`): pass fetch itself, or a plain or bound wrapper. */
|
|
8
9
|
fetch?: typeof fetch;
|
|
9
10
|
}
|
|
10
11
|
export declare class RavnClient {
|
package/dist/client.js
CHANGED
|
@@ -13,7 +13,10 @@ class RavnClient {
|
|
|
13
13
|
this.fetchImpl = config.fetch ?? globalThis.fetch;
|
|
14
14
|
}
|
|
15
15
|
async request(path, init) {
|
|
16
|
-
|
|
16
|
+
// Called unbound, never as this.fetchImpl(...): a browser's own fetch (the default, or one
|
|
17
|
+
// passed in) throws "Illegal invocation" when `this` is the client, failing every call.
|
|
18
|
+
const fetchImpl = this.fetchImpl;
|
|
19
|
+
const res = await fetchImpl(`${this.baseUrl}${path}`, {
|
|
17
20
|
...init,
|
|
18
21
|
headers: {
|
|
19
22
|
"content-type": "application/json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ravnexchange/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Typed client for the RAVN integrator API (/api/v1): quote, execute, submit-signature, status.",
|
|
5
5
|
"keywords": ["ravn", "cross-chain", "swap", "swap-api", "dex-aggregator", "bitcoin", "native-btc", "solana", "evm", "crypto", "defi", "typescript", "sdk", "api-client"],
|
|
6
6
|
"main": "./dist/index.js",
|