@pollar/react 0.12.1-rc.5 → 0.12.1-rc.6
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 -2
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@ Stellar and Solana applications.
|
|
|
6
6
|
> **0.12.1** (requires `@pollar/core@^0.12.1`). Every modal and exported template speaks English, Spanish and
|
|
7
7
|
> Portuguese (see [Language](#language)). `<SwapModal>` swaps on Solana too, with a Network selector when the app has
|
|
8
8
|
> venues on both chains. `<SendModal>` offers a Hash memo next to Text and ID. `<ConfirmModal>` shows a Soroban token
|
|
9
|
-
> transfer (`kind: 'sign_auth_entry'`) with its destination, amount and asset. `<
|
|
9
|
+
> transfer (`kind: 'sign_auth_entry'`) with its destination, amount and asset. `<ConfirmModal>`, `<CosignModal>` and
|
|
10
|
+
> every transaction status view share one review: what moves, a fee badge when who pays is known, and "Show details"
|
|
11
|
+
> with the addresses, network, fee, raw transaction and hash. `<RequirementFormModal>` asks a field
|
|
10
12
|
> with `showIf` only while the answer it depends on matches. `<CardModal>` copies the number, expiry date and CVC,
|
|
11
13
|
> offers a network picker when the user holds a wallet on Stellar and Solana, and funds the card from a co-signed
|
|
12
14
|
> wallet too. The email code input takes an autofilled one-time code. The ramp widget says a route's minimum or
|
|
@@ -407,7 +409,9 @@ you want to swap the chrome but keep the data wiring from `usePollar()`. (`<Earn
|
|
|
407
409
|
| `<CustodyMigrationModal>` | `<CustodyMigrationModalTemplate>` |
|
|
408
410
|
|
|
409
411
|
`<TxStatusView>` is the shared status component (build -> sign -> success/error) reused by `TransactionModal` and
|
|
410
|
-
`SendModal`; it's exported on its own for consumers that want to embed the lifecycle elsewhere.
|
|
412
|
+
`SendModal`; it's exported on its own for consumers that want to embed the lifecycle elsewhere. It shows the same
|
|
413
|
+
review as `<ConfirmModal>` and `<CosignModal>`: the asset and chain logos with the sender and recipient, the fee badge
|
|
414
|
+
once the platform reports who paid, and "Show details".
|
|
411
415
|
|
|
412
416
|
> `onWalletConnect` is **optional** on `<LoginModalTemplate>` (defaults to a no-op).
|
|
413
417
|
|
package/dist/index.js
CHANGED
|
@@ -1272,7 +1272,7 @@ var PollarModalFooter = ({ language: languageProp }) => {
|
|
|
1272
1272
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: LOGO_POLLAR_WORDMARK_ON_DARK, alt: "Pollar", className: "pollar-footer-logo pollar-logo-on-dark" }),
|
|
1273
1273
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-footer-version", children: [
|
|
1274
1274
|
"v",
|
|
1275
|
-
"0.12.1-rc.
|
|
1275
|
+
"0.12.1-rc.6"
|
|
1276
1276
|
] })
|
|
1277
1277
|
] });
|
|
1278
1278
|
};
|
|
@@ -10258,6 +10258,9 @@ var REVEAL_MS = 3e4;
|
|
|
10258
10258
|
var TX_LIMIT = 10;
|
|
10259
10259
|
var FUNDING_POLL_MS = 5e3;
|
|
10260
10260
|
var FUNDING_INFLIGHT = /* @__PURE__ */ new Set(["CREATED", "SENT", "BURNED", "ATTESTED", "MINTED"]);
|
|
10261
|
+
function newFundingKey() {
|
|
10262
|
+
return `fund-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
10263
|
+
}
|
|
10261
10264
|
var FUNDING_STEPS = {
|
|
10262
10265
|
STELLAR: ["CREATED", "BURNED", "ATTESTED", "MINTED"],
|
|
10263
10266
|
SOLANA: ["CREATED", "SENT"]
|
|
@@ -10325,6 +10328,7 @@ function CardModal({ onClose }) {
|
|
|
10325
10328
|
const [deposit, setDeposit] = react.useState(null);
|
|
10326
10329
|
const [fundings, setFundings] = react.useState(null);
|
|
10327
10330
|
const [fundAmount, setFundAmount] = react.useState("");
|
|
10331
|
+
const fundKey = react.useRef(null);
|
|
10328
10332
|
const [fundChain, setFundChain] = react.useState(null);
|
|
10329
10333
|
const [showManual, setShowManual] = react.useState(false);
|
|
10330
10334
|
const [occupations, setOccupations] = react.useState([]);
|
|
@@ -10506,7 +10510,19 @@ function CardModal({ onClose }) {
|
|
|
10506
10510
|
const fund = () => run(
|
|
10507
10511
|
"fund-send",
|
|
10508
10512
|
async () => {
|
|
10509
|
-
|
|
10513
|
+
fundKey.current ?? (fundKey.current = newFundingKey());
|
|
10514
|
+
let outcome;
|
|
10515
|
+
try {
|
|
10516
|
+
outcome = await getClient().fundCard({
|
|
10517
|
+
amount: fundAmount.trim(),
|
|
10518
|
+
chain: selectedFundChain,
|
|
10519
|
+
idempotencyKey: fundKey.current
|
|
10520
|
+
});
|
|
10521
|
+
} catch (e) {
|
|
10522
|
+
if (core.isPollarApiError(e)) fundKey.current = null;
|
|
10523
|
+
throw e;
|
|
10524
|
+
}
|
|
10525
|
+
fundKey.current = null;
|
|
10510
10526
|
if (outcome.status === "cancelled") {
|
|
10511
10527
|
setError(copy.notSigned);
|
|
10512
10528
|
return;
|