@openfort/react 1.6.0 → 1.6.1
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/build/components/Common/Modal/index.js +14 -0
- package/build/components/Common/Modal/index.js.map +1 -1
- package/build/components/Openfort/types.d.ts +1 -1
- package/build/components/Pages/AssetInventory/SolanaAssetInventory.js +7 -7
- package/build/components/Pages/DepositWallet/index.js +15 -10
- package/build/components/Pages/DepositWallet/index.js.map +1 -1
- package/build/components/Pages/ExportKey/index.js +44 -4
- package/build/components/Pages/ExportKey/index.js.map +1 -1
- package/build/components/Pages/ExportKey/styles.d.ts +5 -0
- package/build/components/Pages/ExportKey/styles.js +47 -0
- package/build/components/Pages/ExportKey/styles.js.map +1 -0
- package/build/components/Pages/Receive/index.js +2 -2
- package/build/components/Pages/SelectToken/SolanaSelectToken.js +7 -7
- package/build/components/Pages/SelectToken/index.js +7 -3
- package/build/components/Pages/SelectToken/index.js.map +1 -1
- package/build/components/Pages/Send/EthereumSend.js +25 -5
- package/build/components/Pages/Send/EthereumSend.js.map +1 -1
- package/build/components/Pages/Send/SolanaSend.js +23 -4
- package/build/components/Pages/Send/SolanaSend.js.map +1 -1
- package/build/components/Pages/Send/styles.d.ts +17 -11
- package/build/components/Pages/Send/styles.js +104 -49
- package/build/components/Pages/Send/styles.js.map +1 -1
- package/build/components/Pages/SendConfirmation/ConfirmationSummary.d.ts +3 -1
- package/build/components/Pages/SendConfirmation/ConfirmationSummary.js +2 -2
- package/build/components/Pages/SendConfirmation/EstimatedFees.d.ts +3 -1
- package/build/components/Pages/SendConfirmation/EstimatedFees.js +22 -15
- package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -1
- package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +17 -5
- package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js.map +1 -1
- package/build/components/Pages/SendConfirmation/index.js +11 -5
- package/build/components/Pages/SendConfirmation/index.js.map +1 -1
- package/build/components/Pages/SendConfirmation/styles.d.ts +3 -1
- package/build/components/Pages/SendConfirmation/styles.js +20 -6
- package/build/components/Pages/SendConfirmation/styles.js.map +1 -1
- package/build/components/Pages/SignMessage/index.js +44 -19
- package/build/components/Pages/SignMessage/index.js.map +1 -1
- package/build/components/Pages/SignMessage/styles.d.ts +2 -3
- package/build/components/Pages/SignMessage/styles.js +19 -2
- package/build/components/Pages/SignMessage/styles.js.map +1 -1
- package/build/hooks/openfort/useSignMessage.d.ts +2 -2
- package/build/hooks/openfort/useUI.js +4 -2
- package/build/hooks/openfort/useUI.js.map +1 -1
- package/build/solana/transfer.d.ts +12 -0
- package/build/solana/transfer.js +29 -1
- package/build/solana/transfer.js.map +1 -1
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare const SignContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export declare const Subtitle: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
3
|
-
export declare const MessageBox: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
-
|
|
5
|
-
}, never>;
|
|
3
|
+
export declare const MessageBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const Footer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
5
|
export declare const DataList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
7
6
|
export declare const DataItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
8
7
|
export declare const DataKey: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -4,8 +4,15 @@ const SignContent = styled.div `
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
gap: 16px;
|
|
7
|
+
min-height: 0;
|
|
8
|
+
/* Cap to the modal viewport (InnerContainer caps at 88vh) so the message body
|
|
9
|
+
is the only part that scrolls and the Sign button stays pinned and reachable
|
|
10
|
+
on small screens. 112px ≈ PageContent top padding + PageContents padding,
|
|
11
|
+
mirroring DepositWallet's Layout. */
|
|
12
|
+
max-height: calc(88vh - 112px);
|
|
7
13
|
`;
|
|
8
14
|
const Subtitle = styled.p `
|
|
15
|
+
flex-shrink: 0;
|
|
9
16
|
margin: 0;
|
|
10
17
|
text-align: center;
|
|
11
18
|
font-size: 15px;
|
|
@@ -13,6 +20,11 @@ const Subtitle = styled.p `
|
|
|
13
20
|
color: var(--ck-body-color-muted, #999);
|
|
14
21
|
`;
|
|
15
22
|
const MessageBox = styled.div `
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
min-height: 0;
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
-webkit-overflow-scrolling: touch;
|
|
27
|
+
overscroll-behavior: contain;
|
|
16
28
|
padding: 16px;
|
|
17
29
|
border-radius: 12px;
|
|
18
30
|
background: var(--ck-body-background-secondary, rgba(0, 0, 0, 0.04));
|
|
@@ -22,7 +34,12 @@ const MessageBox = styled.div `
|
|
|
22
34
|
text-align: left;
|
|
23
35
|
word-break: break-word;
|
|
24
36
|
white-space: pre-wrap;
|
|
25
|
-
|
|
37
|
+
`;
|
|
38
|
+
const Footer = styled.div `
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: 12px;
|
|
26
43
|
`;
|
|
27
44
|
const DataList = styled.ul `
|
|
28
45
|
margin: 0;
|
|
@@ -78,5 +95,5 @@ const SignaturePreview = styled.code `
|
|
|
78
95
|
text-align: center;
|
|
79
96
|
`;
|
|
80
97
|
|
|
81
|
-
export { CopyRow, DataItem, DataKey, DataList, ErrorText, MessageBox, SignContent, SignaturePreview, Subtitle, SuccessCircle, SuccessTitle, SuccessWrap };
|
|
98
|
+
export { CopyRow, DataItem, DataKey, DataList, ErrorText, Footer, MessageBox, SignContent, SignaturePreview, Subtitle, SuccessCircle, SuccessTitle, SuccessWrap };
|
|
82
99
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -21,7 +21,7 @@ import { type SignTypedDataPayload } from '../../components/Openfort/types';
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export declare function useSignMessage(): {
|
|
24
|
-
signMessage: (message: string) => Promise
|
|
25
|
-
signTypedData: (typedData: SignTypedDataPayload) => Promise
|
|
24
|
+
signMessage: (message: string) => Promise<string>;
|
|
25
|
+
signTypedData: (typedData: SignTypedDataPayload) => Promise<string>;
|
|
26
26
|
isPending: boolean;
|
|
27
27
|
};
|
|
@@ -22,7 +22,9 @@ const safeRoutes = {
|
|
|
22
22
|
routes.PROVIDERS,
|
|
23
23
|
routes.PROFILE,
|
|
24
24
|
routes.SEND,
|
|
25
|
+
routes.SOL_SEND,
|
|
25
26
|
routes.RECEIVE,
|
|
27
|
+
routes.SOL_RECEIVE,
|
|
26
28
|
routes.DEPOSIT,
|
|
27
29
|
routes.BUY,
|
|
28
30
|
routes.EXPORT_KEY,
|
|
@@ -133,8 +135,8 @@ function useUI() {
|
|
|
133
135
|
openSwitchNetworks: () => gotoAndOpen(routes.ETH_SWITCH_NETWORK),
|
|
134
136
|
openProviders: () => gotoAndOpen(routes.PROVIDERS),
|
|
135
137
|
openWallets: () => gotoAndOpen({ route: routes.CONNECTORS, connectType: 'linkIfUserConnectIfNoUser' }),
|
|
136
|
-
openSend: (tx) => tx ? openSendPreview(tx) : gotoAndOpen(routes.SEND),
|
|
137
|
-
openReceive: () => gotoAndOpen(routes.RECEIVE),
|
|
138
|
+
openSend: (tx) => tx ? openSendPreview(tx) : gotoAndOpen(chainType === ChainTypeEnum.SVM ? routes.SOL_SEND : routes.SEND),
|
|
139
|
+
openReceive: () => gotoAndOpen(chainType === ChainTypeEnum.SVM ? routes.SOL_RECEIVE : routes.RECEIVE),
|
|
138
140
|
openFunding: () => gotoAndOpen(routes.DEPOSIT),
|
|
139
141
|
openBuy: () => gotoAndOpen(routes.BUY),
|
|
140
142
|
openExportKey: () => gotoAndOpen(routes.EXPORT_KEY),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUI.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -58,4 +58,16 @@ type SendSplTokenGaslessParams = {
|
|
|
58
58
|
};
|
|
59
59
|
/** Send an SPL token transfer with fees sponsored by the Openfort paymaster (Kora). */
|
|
60
60
|
export declare function sendSplTokenGasless({ from, to, mint, amount, provider, cluster, publishableKey, }: SendSplTokenGaslessParams): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Read the network fee (in lamports) for a single-signer transfer from the RPC
|
|
63
|
+
* via `getFeeForMessage`. Returns null on any failure so callers can fall back to
|
|
64
|
+
* a neutral "--" rather than a fabricated number. The base fee is per-signature
|
|
65
|
+
* and identical for native and SPL transfers (a single fee-payer signature), so a
|
|
66
|
+
* representative SOL transfer message is enough to price it.
|
|
67
|
+
*/
|
|
68
|
+
export declare function estimateSolanaTransferFeeLamports({ from, to, rpcUrl, }: {
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
rpcUrl: string;
|
|
72
|
+
}): Promise<bigint | null>;
|
|
61
73
|
export {};
|
package/build/solana/transfer.js
CHANGED
|
@@ -214,6 +214,34 @@ async function sendSplTokenGasless({ from, to, mint, amount, provider, cluster,
|
|
|
214
214
|
publishableKey,
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Read the network fee (in lamports) for a single-signer transfer from the RPC
|
|
219
|
+
* via `getFeeForMessage`. Returns null on any failure so callers can fall back to
|
|
220
|
+
* a neutral "--" rather than a fabricated number. The base fee is per-signature
|
|
221
|
+
* and identical for native and SPL transfers (a single fee-payer signature), so a
|
|
222
|
+
* representative SOL transfer message is enough to price it.
|
|
223
|
+
*/
|
|
224
|
+
async function estimateSolanaTransferFeeLamports({ from, to, rpcUrl, }) {
|
|
225
|
+
try {
|
|
226
|
+
const kit = await import('@solana/kit');
|
|
227
|
+
const { getTransferSolInstruction } = await import('@solana-program/system');
|
|
228
|
+
const fromAddress = kit.address(from);
|
|
229
|
+
const rpc = kit.createSolanaRpc(rpcUrl);
|
|
230
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
231
|
+
const message = kit.pipe(kit.createTransactionMessage({ version: 0 }), (tx) => kit.setTransactionMessageFeePayer(fromAddress, tx), (tx) => kit.setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => kit.appendTransactionMessageInstruction(getTransferSolInstruction({
|
|
232
|
+
source: kit.createNoopSigner(fromAddress),
|
|
233
|
+
destination: kit.address(to),
|
|
234
|
+
amount: kit.lamports(BigInt(1)),
|
|
235
|
+
}), tx));
|
|
236
|
+
const compiled = kit.compileTransactionMessage(message);
|
|
237
|
+
const base64Message = kit.getBase64Decoder().decode(kit.getCompiledTransactionMessageEncoder().encode(compiled));
|
|
238
|
+
const { value } = await rpc.getFeeForMessage(base64Message).send();
|
|
239
|
+
return value == null ? null : BigInt(value);
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
217
245
|
|
|
218
|
-
export { sendSol, sendSolGasless, sendSplToken, sendSplTokenGasless };
|
|
246
|
+
export { estimateSolanaTransferFeeLamports, sendSol, sendSolGasless, sendSplToken, sendSplTokenGasless };
|
|
219
247
|
//# sourceMappingURL=transfer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENFORT_VERSION = "1.6.
|
|
1
|
+
export declare const OPENFORT_VERSION = "1.6.1";
|
package/build/version.js
CHANGED