@riftresearch/sdk 0.7.0 → 0.8.0
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/index.d.ts +2 -2436
- package/dist/index.js +11 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85,9 +85,7 @@ var Currencies = {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
// src/
|
|
89
|
-
import { treaty } from "@elysiajs/eden";
|
|
90
|
-
|
|
88
|
+
// src/errors.ts
|
|
91
89
|
class SwapRouterApiError extends Error {
|
|
92
90
|
status;
|
|
93
91
|
body;
|
|
@@ -98,9 +96,6 @@ class SwapRouterApiError extends Error {
|
|
|
98
96
|
this.body = body;
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
|
-
function createClient(baseUrl) {
|
|
102
|
-
return treaty(baseUrl);
|
|
103
|
-
}
|
|
104
99
|
// src/router.ts
|
|
105
100
|
import { match, P } from "ts-pattern";
|
|
106
101
|
var CBBTC_ADDRESS2 = "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf";
|
|
@@ -159,6 +154,14 @@ function getSupportedModes(from, to) {
|
|
|
159
154
|
}
|
|
160
155
|
// src/sdk.ts
|
|
161
156
|
import { erc20Abi } from "viem";
|
|
157
|
+
|
|
158
|
+
// src/client.ts
|
|
159
|
+
import { treaty } from "@elysiajs/eden";
|
|
160
|
+
function createClient(baseUrl) {
|
|
161
|
+
return treaty(baseUrl);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// src/sdk.ts
|
|
162
165
|
var GAS_LIMIT_MULTIPLIER_NUMERATOR = 3n;
|
|
163
166
|
var GAS_LIMIT_MULTIPLIER_DENOMINATOR = 2n;
|
|
164
167
|
|
|
@@ -244,8 +247,10 @@ class RiftSdk {
|
|
|
244
247
|
await this.assertSufficientBalance(params.from, quote.from.expected, context);
|
|
245
248
|
}
|
|
246
249
|
this.logDebug("creating swap", { quoteId: riftQuote.id });
|
|
250
|
+
const senderAddress = params.from.chain.kind === "EVM" ? this.getAddress(context) : undefined;
|
|
247
251
|
const swapResponse = this.unwrapEdenResult(await this.riftClient.swap.post({
|
|
248
252
|
id: riftQuote.id,
|
|
253
|
+
...senderAddress ? { senderAddress } : {},
|
|
249
254
|
destinationAddress: context.destinationAddress,
|
|
250
255
|
refundAddress,
|
|
251
256
|
integratorName: this.integratorName,
|
|
@@ -484,7 +489,6 @@ export {
|
|
|
484
489
|
detectRoute,
|
|
485
490
|
createRiftSdk,
|
|
486
491
|
createCurrency,
|
|
487
|
-
createClient,
|
|
488
492
|
SwapRouterApiError,
|
|
489
493
|
RiftSdk,
|
|
490
494
|
Currencies
|