0xtrails 0.9.0 → 0.9.2
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/{ccip-3JTFJIx6.js → ccip-g6lDdnrD.js} +1 -1
- package/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/{index-DcL9VF7o.js → index-D-QngA_s.js} +66447 -66407
- package/dist/index.js +3 -3
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/widget/components/FiatSelector.d.ts.map +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/index.js +1 -1
- package/dist/widget/providers/TrailsProvider.d.ts +0 -2
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/widget.d.ts +0 -1
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +1781 -0
- package/src/onrampClient.ts +2 -2
- package/src/prepareSend.ts +8 -5
- package/src/widget/components/FiatSelector.tsx +1 -1781
- package/src/widget/components/MeldForm.tsx +2 -2
- package/src/widget/components/MeldStepsFlow.tsx +2 -2
- package/src/widget/components/OnrampProviderConfirmation.tsx +121 -53
- package/src/widget/components/Receipt.tsx +1 -1
- package/src/widget/components/Swap.tsx +1 -1
- package/src/widget/components/TransferPendingVertical.tsx +1 -1
- package/src/widget/components/WalletConfirmation.tsx +1 -1
- package/src/widget/providers/TrailsProvider.tsx +0 -6
- package/src/widget/widget.tsx +1 -4
package/src/onrampClient.ts
CHANGED
|
@@ -30,7 +30,7 @@ export const useOnrampClient = (
|
|
|
30
30
|
return new TrailsOnramp(
|
|
31
31
|
configOverride?.apiKey || trailsConfig.trailsApiKey || "",
|
|
32
32
|
{
|
|
33
|
-
hostname: configOverride?.hostname || trailsConfig.
|
|
33
|
+
hostname: configOverride?.hostname || trailsConfig.trailsApiUrl,
|
|
34
34
|
jwt: configOverride?.jwt,
|
|
35
35
|
},
|
|
36
36
|
)
|
|
@@ -39,7 +39,7 @@ export const useOnrampClient = (
|
|
|
39
39
|
configOverride?.apiKey,
|
|
40
40
|
configOverride?.jwt,
|
|
41
41
|
trailsConfig.trailsApiKey,
|
|
42
|
-
trailsConfig.
|
|
42
|
+
trailsConfig.trailsApiUrl,
|
|
43
43
|
])
|
|
44
44
|
|
|
45
45
|
return onrampClient
|
package/src/prepareSend.ts
CHANGED
|
@@ -118,11 +118,14 @@ export async function prepareSend(
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// Use slippage
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
// Use slippage tolerance priority:
|
|
122
|
+
// 1. If explicitly passed as prop → use that value
|
|
123
|
+
// 2. If not passed → check localStorage via getSlippageToleranceValue
|
|
124
|
+
// 3. If localStorage has no value → fallback to "0.01"
|
|
125
|
+
const slippageTolerance =
|
|
126
|
+
slippageToleranceFromOptions !== undefined
|
|
127
|
+
? slippageToleranceFromOptions
|
|
128
|
+
: getSlippageToleranceValue("0.01")
|
|
126
129
|
|
|
127
130
|
if (!sourceTokenDecimals) {
|
|
128
131
|
throw new Error("Source token decimals not provided")
|