@rango-dev/widget-embedded 0.45.1-next.1 → 0.45.1-next.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/dist/components/CustomDestination/CustomDestination.styles.d.ts +1 -0
- package/dist/components/CustomDestination/CustomDestination.styles.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +0 -162
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/store/slices/wallets.d.ts +2 -2
- package/dist/store/slices/wallets.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +1 -0
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +1 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +7 -7
- package/src/components/Slippage/Slippage.styles.ts +0 -23
- package/src/components/Slippage/Slippage.tsx +24 -26
- package/src/containers/Wallets/useUpdates.ts +1 -1
- package/src/store/slices/wallets.ts +11 -5
- package/src/types/wallets.ts +1 -0
- package/src/utils/swap.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.45.1-next.
|
|
3
|
+
"version": "0.45.1-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"@lingui/core": "4.2.1",
|
|
26
26
|
"@lingui/react": "4.2.1",
|
|
27
27
|
"@rango-dev/logging-core": "^0.9.1-next.0",
|
|
28
|
-
"@rango-dev/provider-all": "^0.48.1-next.
|
|
28
|
+
"@rango-dev/provider-all": "^0.48.1-next.2",
|
|
29
29
|
"@rango-dev/queue-manager-core": "^0.30.1-next.0",
|
|
30
|
-
"@rango-dev/queue-manager-rango-preset": "^0.47.1-next.
|
|
30
|
+
"@rango-dev/queue-manager-rango-preset": "^0.47.1-next.2",
|
|
31
31
|
"@rango-dev/queue-manager-react": "^0.30.1-next.0",
|
|
32
32
|
"@rango-dev/signer-solana": "^0.41.1-next.0",
|
|
33
|
-
"@rango-dev/ui": "^0.48.1-next.
|
|
34
|
-
"@rango-dev/wallets-core": "^0.45.1-next.
|
|
35
|
-
"@rango-dev/wallets-react": "^0.32.1-next.
|
|
36
|
-
"@rango-dev/wallets-shared": "^0.46.1-next.
|
|
33
|
+
"@rango-dev/ui": "^0.48.1-next.3",
|
|
34
|
+
"@rango-dev/wallets-core": "^0.45.1-next.2",
|
|
35
|
+
"@rango-dev/wallets-react": "^0.32.1-next.2",
|
|
36
|
+
"@rango-dev/wallets-shared": "^0.46.1-next.2",
|
|
37
37
|
"bignumber.js": "^9.1.1",
|
|
38
38
|
"copy-to-clipboard": "^3.3.3",
|
|
39
39
|
"dayjs": "^1.11.7",
|
|
@@ -32,26 +32,3 @@ export const SlippageChip = styled(Chip, {
|
|
|
32
32
|
width: '61px',
|
|
33
33
|
flexShrink: 0,
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
export const SlippageTextFieldContainer = styled('div', {
|
|
37
|
-
outlineWidth: 1,
|
|
38
|
-
outlineStyle: 'solid',
|
|
39
|
-
borderRadius: '$xs',
|
|
40
|
-
flex: 1,
|
|
41
|
-
variants: {
|
|
42
|
-
status: {
|
|
43
|
-
safe: {
|
|
44
|
-
outlineColor: '$secondary500',
|
|
45
|
-
},
|
|
46
|
-
error: {
|
|
47
|
-
outlineColor: '$error500',
|
|
48
|
-
},
|
|
49
|
-
warning: {
|
|
50
|
-
outlineColor: '$warning500',
|
|
51
|
-
},
|
|
52
|
-
empty: {
|
|
53
|
-
outlineWidth: 0,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
});
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
Head,
|
|
22
22
|
SlippageChip,
|
|
23
23
|
SlippageChipsContainer,
|
|
24
|
-
SlippageTextFieldContainer,
|
|
25
24
|
} from './Slippage.styles';
|
|
26
25
|
import { SlippageTooltipContent } from './SlippageTooltipContent';
|
|
27
26
|
|
|
@@ -92,32 +91,31 @@ export function Slippage() {
|
|
|
92
91
|
/>
|
|
93
92
|
);
|
|
94
93
|
})}
|
|
95
|
-
|
|
94
|
+
|
|
95
|
+
<TextField
|
|
96
|
+
type="number"
|
|
97
|
+
min="0.01"
|
|
98
|
+
max="30"
|
|
99
|
+
step="0.01"
|
|
96
100
|
status={
|
|
97
|
-
slippageValidation?.type || (customSlippage ? '
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</Typography>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
placeholder={i18n.t('Custom')}
|
|
119
|
-
/>
|
|
120
|
-
</SlippageTextFieldContainer>
|
|
101
|
+
slippageValidation?.type || (customSlippage ? 'success' : 'default')
|
|
102
|
+
}
|
|
103
|
+
id="widget-slippage-chip-text-input"
|
|
104
|
+
onInput={onInput}
|
|
105
|
+
fullWidth
|
|
106
|
+
variant="contained"
|
|
107
|
+
value={customSlippage === null ? '' : customSlippage}
|
|
108
|
+
color="dark"
|
|
109
|
+
onChange={onSlippageValueChange}
|
|
110
|
+
suffix={
|
|
111
|
+
customSlippage && (
|
|
112
|
+
<Typography variant="body" size="small">
|
|
113
|
+
%
|
|
114
|
+
</Typography>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
placeholder={i18n.t('Custom')}
|
|
118
|
+
/>
|
|
121
119
|
</SlippageChipsContainer>
|
|
122
120
|
|
|
123
121
|
{slippageValidation && (
|
|
@@ -100,7 +100,11 @@ export interface WalletsSlice {
|
|
|
100
100
|
namespaces?: Namespace[];
|
|
101
101
|
}
|
|
102
102
|
) => void;
|
|
103
|
-
addConnectedWallet: (
|
|
103
|
+
addConnectedWallet: (
|
|
104
|
+
accounts: Wallet[],
|
|
105
|
+
namespace?: Namespace,
|
|
106
|
+
derivationPath?: string
|
|
107
|
+
) => void;
|
|
104
108
|
setWalletsAsSelected: (
|
|
105
109
|
wallets: { walletType: string; chain: string }[]
|
|
106
110
|
) => void;
|
|
@@ -109,7 +113,8 @@ export interface WalletsSlice {
|
|
|
109
113
|
*/
|
|
110
114
|
newWalletConnected: (
|
|
111
115
|
accounts: Wallet[],
|
|
112
|
-
namespace?: Namespace
|
|
116
|
+
namespace?: Namespace,
|
|
117
|
+
derivationPath?: string
|
|
113
118
|
) => Promise<void>;
|
|
114
119
|
disconnectNamespaces: (walletType: string, namespaces: Namespace[]) => void;
|
|
115
120
|
/**
|
|
@@ -231,7 +236,7 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
|
|
|
231
236
|
};
|
|
232
237
|
});
|
|
233
238
|
},
|
|
234
|
-
addConnectedWallet: (accounts, namespace) => {
|
|
239
|
+
addConnectedWallet: (accounts, namespace, derivationPath) => {
|
|
235
240
|
/*
|
|
236
241
|
* When we are going to add a new account, there are two thing that can be happens:
|
|
237
242
|
* 1. Wallet hasn't add yet.
|
|
@@ -276,6 +281,7 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
|
|
|
276
281
|
walletType: account.walletType,
|
|
277
282
|
selected: shouldMarkWalletAsSelected,
|
|
278
283
|
namespace: namespace,
|
|
284
|
+
derivationPath: derivationPath,
|
|
279
285
|
loading: false,
|
|
280
286
|
error: false,
|
|
281
287
|
};
|
|
@@ -435,13 +441,13 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
|
|
|
435
441
|
connectedWallets: nextConnectedWalletsWithUpdatedSelectedStatus,
|
|
436
442
|
});
|
|
437
443
|
},
|
|
438
|
-
newWalletConnected: async (accounts, namespace) => {
|
|
444
|
+
newWalletConnected: async (accounts, namespace, derivationPath) => {
|
|
439
445
|
eventEmitter.emit(WidgetEvents.WalletEvent, {
|
|
440
446
|
type: WalletEventTypes.CONNECT,
|
|
441
447
|
payload: { walletType: accounts[0].walletType, accounts },
|
|
442
448
|
});
|
|
443
449
|
|
|
444
|
-
get().addConnectedWallet(accounts, namespace);
|
|
450
|
+
get().addConnectedWallet(accounts, namespace, derivationPath);
|
|
445
451
|
|
|
446
452
|
void get().fetchBalances(accounts);
|
|
447
453
|
},
|
package/src/types/wallets.ts
CHANGED
package/src/utils/swap.ts
CHANGED
|
@@ -534,13 +534,18 @@ export function getWalletsForNewSwap(selectedWallets: Wallet[]) {
|
|
|
534
534
|
const wallets = selectedWallets.reduce(
|
|
535
535
|
(
|
|
536
536
|
selectedWalletsMap: {
|
|
537
|
-
[p: string]: {
|
|
537
|
+
[p: string]: {
|
|
538
|
+
address: string;
|
|
539
|
+
walletType: WalletType;
|
|
540
|
+
derivationPath?: string;
|
|
541
|
+
};
|
|
538
542
|
},
|
|
539
543
|
selectedWallet
|
|
540
544
|
) => (
|
|
541
545
|
(selectedWalletsMap[selectedWallet.chain] = {
|
|
542
546
|
address: selectedWallet.address,
|
|
543
547
|
walletType: selectedWallet.walletType,
|
|
548
|
+
derivationPath: selectedWallet.derivationPath,
|
|
544
549
|
}),
|
|
545
550
|
selectedWalletsMap
|
|
546
551
|
),
|