@ref-finance/ref-sdk 1.4.1 → 1.4.3

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 CHANGED
@@ -788,11 +788,13 @@ export interface SwapWidgetProps {
788
788
  defaultTokenIn?: string;
789
789
  defaultTokenOut?: string;
790
790
  referralId?:string;
791
- transactionState?: {
792
- state: 'success' | 'fail' | null;
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
  ![111](https://user-images.githubusercontent.com/50706666/199178453-8d09be3f-5a00-4b62-a6f1-af42ce4beae6.png)
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<'success' | 'fail' | null>(
895
+   const [swapState, setSwapState] = React.useState<SwapState>(
893
896
      null
894
897
    );
895
898
    const [tx, setTx] = React.useState<string | undefined>(undefined);
@@ -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: 100;
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: 100;
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;