@ref-finance/ref-sdk 1.4.0 → 1.4.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/README.md +6 -3
- package/dist/constant.d.ts +1 -0
- package/dist/ref-sdk.cjs.development.css +2 -2
- package/dist/ref-sdk.cjs.development.js +163 -165
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +164 -168
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +164 -166
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/dist/swap-widget/components.d.ts +10 -11
- package/dist/swap-widget/types.d.ts +5 -3
- package/dist/utils.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -788,11 +788,13 @@ export interface SwapWidgetProps {
|
|
|
788
788
|
defaultTokenIn?: string;
|
|
789
789
|
defaultTokenOut?: string;
|
|
790
790
|
referralId?:string;
|
|
791
|
-
transactionState
|
|
792
|
-
state:
|
|
791
|
+
transactionState: {
|
|
792
|
+
state: SwapState;
|
|
793
|
+
setState: (state: SwapState) => void;
|
|
793
794
|
tx?: string;
|
|
794
795
|
detail?: string;
|
|
795
796
|
};
|
|
797
|
+
minNearAmountLeftForGasFees?: number;
|
|
796
798
|
onConnect: () => void;
|
|
797
799
|
}
|
|
798
800
|
```
|
|
@@ -814,6 +816,7 @@ export interface SwapWidgetProps {
|
|
|
814
816
|
- setState: used to change setState to interact with pop-up.
|
|
815
817
|
- tx: will add link to near explorer according to this tx.
|
|
816
818
|
- detail: you could input some tips to show on sucess pop-up.
|
|
819
|
+
- minNearAmountLeftForGasFees: minimun near value reserved for tx gas fees.
|
|
817
820
|
|
|
818
821
|

|
|
819
822
|
|
|
@@ -889,7 +892,7 @@ export const Widget = ()=>{
|
|
|
889
892
|
|
|
890
893
|
const { modal, selector, accountId } = useWalletSelector();
|
|
891
894
|
|
|
892
|
-
const [swapState, setSwapState] = React.useState<
|
|
895
|
+
const [swapState, setSwapState] = React.useState<SwapState>(
|
|
893
896
|
null
|
|
894
897
|
);
|
|
895
898
|
const [tx, setTx] = React.useState<string | undefined>(undefined);
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TokenMetadata } from './types';
|
|
2
2
|
export declare const FEE_DIVISOR = 10000;
|
|
3
|
+
export declare const DEFAULT_SLIPPAGE_TOLERANCE = "0.5";
|
|
3
4
|
export declare const STABLE_LP_TOKEN_DECIMALS = 18;
|
|
4
5
|
export declare const RATED_POOL_LP_TOKEN_DECIMALS = 24;
|
|
5
6
|
export declare const STORAGE_TO_REGISTER_WITH_MFT = "0.1";
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
padding: 16px;
|
|
49
49
|
padding-right: 20px;
|
|
50
50
|
padding-left: 20px;
|
|
51
|
-
z-index:
|
|
51
|
+
z-index: 5;
|
|
52
52
|
width: 230px;
|
|
53
53
|
font-size: 14px;
|
|
54
54
|
}
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
flex-direction: column;
|
|
229
229
|
align-items: center;
|
|
230
230
|
justify-content: center;
|
|
231
|
-
z-index:
|
|
231
|
+
z-index: 5;
|
|
232
232
|
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.25);
|
|
233
233
|
border-radius: 12px;
|
|
234
234
|
padding: 32px 20px;
|