@stridge/kit 0.1.0-alpha.27 → 0.1.0-alpha.28
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/KitProvider.d.ts +9 -0
- package/dist/KitProvider.js +1 -1
- package/dist/flows/deposit/orchestrator/controller.js +1 -1
- package/dist/flows/deposit/orchestrator/types.d.ts +27 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +7 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +7 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +1 -1
- package/dist/flows/withdraw/orchestrator/types.d.ts +1 -2
- package/dist/index.d.ts +4 -4
- package/dist/package.js +1 -1
- package/dist/stridge/StridgeProvider.d.ts +37 -1
- package/dist/stridge/StridgeProvider.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/KitProvider.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DepositDriver } from "./flows/deposit/driver/types.js";
|
|
2
|
+
import { DepositMethodsConfig } from "./flows/deposit/orchestrator/types.js";
|
|
2
3
|
import { WithdrawDriver } from "./flows/withdraw/driver/types.js";
|
|
3
4
|
import { KitScope } from "./scope/KitScope.js";
|
|
4
5
|
import { KitI18nConfig } from "./shared/i18n/createKitI18n.js";
|
|
@@ -47,6 +48,7 @@ declare function KitProvider({
|
|
|
47
48
|
i18n,
|
|
48
49
|
direction,
|
|
49
50
|
deposit,
|
|
51
|
+
depositMethods,
|
|
50
52
|
withdraw,
|
|
51
53
|
storage,
|
|
52
54
|
storageNamespace,
|
|
@@ -70,6 +72,13 @@ declare namespace KitProvider {
|
|
|
70
72
|
* `@stridge/kit/deposit/dialog` read from it.
|
|
71
73
|
*/
|
|
72
74
|
deposit?: DepositDriver;
|
|
75
|
+
/**
|
|
76
|
+
* Per-method host disable lever for the deposit-method picker. Lets the host mark Wallet
|
|
77
|
+
* or Transfer Crypto unavailable for the current user (embedded-wallet hosts, KYC gates,
|
|
78
|
+
* regional restrictions, …) without removing the option from the picker. Surfaced as a
|
|
79
|
+
* muted tile with an optional `disabledHint` tooltip.
|
|
80
|
+
*/
|
|
81
|
+
depositMethods?: DepositMethodsConfig;
|
|
73
82
|
/**
|
|
74
83
|
* Host-supplied {@link WithdrawDriver} — source of reactive data + imperative actions for
|
|
75
84
|
* the withdraw flow. When supplied, the provider mounts the withdraw driver context and
|
package/dist/KitProvider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{KitStorageProvider as e}from"./storage/context.js";import"./storage/index.js";import{DepositDriverProvider as t}from"./flows/deposit/driver/context.js";import{getLocaleDirection as n}from"./shared/i18n/getLocaleDirection.js";import{KitI18nProvider as r}from"./shared/i18n/KitI18nProvider.js";import"./i18n/index.js";import{GatewayController as i}from"./flows/deposit/orchestrator/controller.js";import{WithdrawBindingsProvider as a}from"./flows/withdraw/bindings/WithdrawBindings.js";import"./flows/withdraw/bindings/index.js";import{WithdrawDriverProvider as o}from"./flows/withdraw/driver/context.js";import{WithdrawControllerProvider as s}from"./flows/withdraw/orchestrator/controller.js";import{KitScope as c}from"./scope/KitScope.js";import"./scope/index.js";import{SupportConfigContext as l}from"./shared/support/SupportConfigContext.js";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{LazyMotion as f,domMax as p}from"motion/react";function m({children:m,i18n:h,direction:g,deposit:_,
|
|
1
|
+
"use client";import{KitStorageProvider as e}from"./storage/context.js";import"./storage/index.js";import{DepositDriverProvider as t}from"./flows/deposit/driver/context.js";import{getLocaleDirection as n}from"./shared/i18n/getLocaleDirection.js";import{KitI18nProvider as r}from"./shared/i18n/KitI18nProvider.js";import"./i18n/index.js";import{GatewayController as i}from"./flows/deposit/orchestrator/controller.js";import{WithdrawBindingsProvider as a}from"./flows/withdraw/bindings/WithdrawBindings.js";import"./flows/withdraw/bindings/index.js";import{WithdrawDriverProvider as o}from"./flows/withdraw/driver/context.js";import{WithdrawControllerProvider as s}from"./flows/withdraw/orchestrator/controller.js";import{KitScope as c}from"./scope/KitScope.js";import"./scope/index.js";import{SupportConfigContext as l}from"./shared/support/SupportConfigContext.js";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{LazyMotion as f,domMax as p}from"motion/react";function m({children:m,i18n:h,direction:g,deposit:_,depositMethods:v,withdraw:y,storage:b,storageNamespace:x,support:S,merchantContext:C,attribution:w=`visible`,...T}){let E=n(h?.locale),D=m;y&&(D=d(a,{children:d(o,{driver:y,children:d(s,{children:D})})})),_&&(D=d(t,{driver:_,children:d(i,{methodsConfig:v,children:D})}));let O=u(()=>({config:S,merchantContext:C??null}),[S,C]),k=S!==void 0||C!==void 0,A=d(r,{locale:h?.locale,messages:h?.messages,children:d(c,{...T,direction:g??E,locale:h?.locale,attribution:w,children:d(e,{storage:b,namespace:x,children:D})})});return d(f,{features:p,children:k?d(l.Provider,{value:O,children:A}):A})}export{m as KitProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositDriverInstance as e}from"../driver/context.js";import{useLingui as t}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as n}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as r}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as i}from"../../../shared/orchestrator/useEffectiveState.js";import{isUserRejectionFailure as a}from"../../../shared/orchestrator/userRejection.js";import{useSettlementWatcher as o}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{initialState as s,reducer as c}from"./reducer.js";import{resolveAssetById as l}from"./resolveAssetById.js";import{createContext as u,use as d,useCallback as f,useEffect as p,useMemo as m,useReducer as h,useRef as g}from"react";import{jsx as _}from"react/jsx-runtime";const v={id:`ELhVSL`,message:`Failed to submit deposit.`},y={id:`Ej5HL9`,message:`Signature declined. Please try again.`},b=u(null);b.displayName=`GatewayControllerContext`;function x(){let e=d(b);if(!e)throw Error(`useDeposit / GatewayController must be used inside <KitProvider deposit={…} />. Mount KitProvider once at the host's app root.`);return e}function S(){return d(b)}function C(){return x().state}function
|
|
1
|
+
"use client";import{useDepositDriverInstance as e}from"../driver/context.js";import{useLingui as t}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as n}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as r}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as i}from"../../../shared/orchestrator/useEffectiveState.js";import{isUserRejectionFailure as a}from"../../../shared/orchestrator/userRejection.js";import{useSettlementWatcher as o}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{initialState as s,reducer as c}from"./reducer.js";import{resolveAssetById as l}from"./resolveAssetById.js";import{createContext as u,use as d,useCallback as f,useEffect as p,useMemo as m,useReducer as h,useRef as g}from"react";import{jsx as _}from"react/jsx-runtime";const v={id:`ELhVSL`,message:`Failed to submit deposit.`},y={id:`Ej5HL9`,message:`Signature declined. Please try again.`},b=u(null);b.displayName=`GatewayControllerContext`;function x(){let e=d(b);if(!e)throw Error(`useDeposit / GatewayController must be used inside <KitProvider deposit={…} />. Mount KitProvider once at the host's app root.`);return e}function S(){return d(b)}const C=u(void 0);C.displayName=`DepositMethodsConfigContext`;function w(){return d(C)}function T(){return x().state}function E(){return x().effectiveState}function D(){return x().actions}function O({methodsConfig:t,children:n}){let r=e(),[a,o]=h(c,s),l=A(a,o,r);j(a,o,r),M(a,o,r);let u=i(a),d=k(a,o,r,l,t);return _(C,{value:t,children:_(b,{value:m(()=>({state:a,effectiveState:u,dispatch:o,controller:d,actions:l}),[a,u,d,l]),children:n})})}function k(e,t,n,r,i){let a=g(n);a.current=n;let o=g(i);o.current=i;let s=f(e=>{if(!e)return t({type:`OPEN`,input:void 0}),!0;if(o.current?.[e.method]?.disabled)return!1;if(e.method===`transfer`)return t({type:`OPEN`,input:{method:`transfer`}}),!0;if(e.method===`wallet`&&e.assetId!==void 0){let n=l(a.current.getSnapshot(),e.assetId);return n?(t({type:`OPEN`,input:{method:`wallet`,asset:n}}),!0):!1}return t({type:`OPEN`,input:{method:`wallet`}}),!0},[t]),c=f(()=>{t({type:`CLOSE`})},[t]);return m(()=>({open:s,close:c,actions:r}),[s,c,r])}function A(e,r,i){let o=g(e);o.current=e;let s=g(i);s.current=i;let c=g(r);c.current=r;let{i18n:l}=t(),u=g(l);u.current=l;let d=f((e,t)=>{let r=s.current,i=new AbortController,o=P(e,t);r.submitDeposit(o,i.signal).then(e=>{i.signal.aborted||c.current({type:`DEPOSIT_SUBMITTED`,tx:e})}).catch(e=>{if(i.signal.aborted)return;let t=n(e,u.current._(v));if(a(t)){c.current({type:`DEPOSIT_SIGNATURE_DECLINED`,notice:u.current._(y)});return}c.current({type:`DEPOSIT_SUBMISSION_FAILED`,failure:t})})},[]),p=f(e=>{c.current({type:`DEPOSIT_METHOD_SELECTED`,method:e})},[]),h=f(e=>{c.current({type:`ASSET_CONFIRMED`,asset:e})},[]),_=f(e=>{o.current.name===`amountEntry`&&c.current({type:`AMOUNT_CONFIRMED`,amount:e})},[]),b=f(()=>{let e=o.current;if(e.name!==`confirmDeposit`)return;let t=e.ctx.phase;if(t.kind===`failed`){c.current({type:`QUOTE_RETRY`});return}if(t.kind!==`ready`)return;let{asset:n,amount:r}=e.ctx;c.current({type:`DEPOSIT_CONFIRMED`}),d(n,r)},[d]),x=f(()=>{c.current({type:`BACK`})},[]),S=f(()=>{c.current({type:`CLOSE`})},[]),C=f(()=>{c.current({type:`SUCCESS_DONE`})},[]),w=f(()=>{c.current({type:`ERROR_TRY_AGAIN`})},[]),T=f((e,t)=>{c.current({type:`RESUME_TO_PROCESSING`,method:e,tx:t})},[]),E=f((e,t)=>{c.current({type:`RESUME_TO_SUCCESS`,method:e,tx:t})},[]),D=f(e=>{c.current({type:`RESUME_TO_ERROR`,...e?{tx:e}:{}})},[]);return m(()=>({selectMethod:p,confirmAsset:h,confirmAmount:_,confirmDeposit:b,back:x,close:S,successDone:C,tryAgain:w,resumeToProcessing:T,resumeToSuccess:E,resumeToError:D}),[p,h,_,b,x,S,C,w,T,E,D])}function j(e,t,r){p(()=>{if(e.name!==`confirmDeposit`||e.ctx.phase.kind!==`loading`&&e.ctx.phase.kind!==`regenerating`)return;let i=new AbortController,a=N(e.ctx.asset,e.ctx.amount);return r.requestQuote(a,i.signal).catch(e=>{i.signal.aborted||t({type:`QUOTE_FAILED`,failure:n(e,`Failed to fetch quote.`)})}),()=>i.abort()},[e.name,e.name===`confirmDeposit`?e.ctx.phase.kind:void 0,e.name===`confirmDeposit`?e.ctx.asset:void 0,e.name===`confirmDeposit`?e.ctx.amount:void 0,r,t]),p(()=>{if(e.name!==`confirmDeposit`||e.ctx.phase.kind!==`ready`)return;let n=e.ctx.phase.quoteExpiresAt,r=Math.max(0,n-Date.now()),i=setTimeout(()=>{t({type:`QUOTE_EXPIRED`})},r);return()=>clearTimeout(i)},[e.name,e.name===`confirmDeposit`&&e.ctx.phase.kind===`ready`?e.ctx.phase.quoteExpiresAt:void 0,t])}function M(e,t,n){let i=e.name===`processing`?e.ctx.tx:void 0;o(n,i?{tx:i}:void 0,i?.hash),p(()=>{if(e.name!==`transferCrypto`||!n.watchSourceTx)return;let t=new AbortController,r;return n.watchSourceTx({},e=>{t.signal.aborted||r||(r=new AbortController,n.watchSettlement({tx:e},()=>{},r.signal))},t.signal),()=>{t.abort(),r?.abort()}},[e.name,n]),p(()=>{if(e.name===`closed`||e.name===`transferCrypto`||e.name===`processing`||!n.fetchActiveSettlement)return;let t=new AbortController,r,i,a=!1,o=async()=>{try{let e=await n.fetchActiveSettlement({},t.signal);if(a)return;if(e&&!r&&e.payload.kind===`pending`){let t=e.payload.txHash?.value;t&&(r=new AbortController,n.watchSettlement({tx:{hash:t}},()=>{},r.signal))}}catch{}a||(i=setTimeout(o,5e3))};return o(),()=>{a=!0,t.abort(),r?.abort(),i&&clearTimeout(i)}},[e.name,n]);let a=g(e);a.current=e,r(n,e=>{a.current.name===`processing`&&(e===`succeeded`?t({type:`PROCESSING_SUCCEEDED`}):e===`failed`&&t({type:`PROCESSING_FAILED`}))});let s=g(null);p(()=>{let e=()=>{let e=n.getSnapshot(),r=a.current,i=e.quote;i.status!==s.current&&(s.current=i.status,i.status===`ready`&&r.name===`confirmDeposit`?(r.ctx.phase.kind===`loading`||r.ctx.phase.kind===`regenerating`)&&t({type:`QUOTE_RESOLVED`,expiresAt:i.payload.expiresAt}):i.status===`error`&&r.name===`confirmDeposit`&&(r.ctx.phase.kind===`loading`||r.ctx.phase.kind===`regenerating`)&&t({type:`QUOTE_FAILED`,failure:{reason:i.error.message,code:i.error.name}}))},r=n.subscribe(e);return e(),r},[n,t])}function N(e,t){let n=e.eip155Id;if(!n)throw Error(`Asset ${e.symbol} is missing eip155Id; cannot build quote input.`);return{sourceChainId:Number(n),sourceTokenAddress:e.address,sourceTokenDecimals:e.decimals,sourceTokenSymbol:e.symbol,sourceIsNative:e.isNative,amount:t,...e.priceUsd===void 0?{}:{sourcePriceUsd:e.priceUsd}}}function P(e,t){let n=e.eip155Id;if(!n)throw Error(`Asset ${e.symbol} is missing eip155Id; cannot build submit input.`);return{sourceChainId:Number(n),sourceTokenAddress:e.address,sourceTokenDecimals:e.decimals,sourceIsNative:e.isNative,amount:t}}export{O as GatewayController,x as useControllerContext,D as useDepositActions,E as useDepositEffectiveState,w as useDepositMethodsConfig,T as useDepositState,S as useOptionalControllerContext};
|
|
@@ -9,6 +9,32 @@ import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
|
9
9
|
* (transfer-crypto → process).
|
|
10
10
|
*/
|
|
11
11
|
type DepositMethod = "wallet" | "transfer";
|
|
12
|
+
/**
|
|
13
|
+
* Host-supplied disable lever for a single payment method on the deposit-method picker. The host
|
|
14
|
+
* decides eligibility — the kit ships no per-host inference (embedded vs. external wallet,
|
|
15
|
+
* region, KYC tier, …). When `disabled` is true the tile stays in the picker (preserves
|
|
16
|
+
* discoverability) but is rendered muted, can't be selected, and surfaces `disabledHint` on
|
|
17
|
+
* hover/focus and to assistive tech.
|
|
18
|
+
*/
|
|
19
|
+
interface DepositMethodConfig {
|
|
20
|
+
/** When true, the method is rendered visually muted and can't be selected. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Plain-text hint shown when the user hovers, focuses, or taps a disabled tile. Also folded
|
|
24
|
+
* into the tile's accessible name so screen readers convey the reason. Ignored when
|
|
25
|
+
* `disabled` is falsy.
|
|
26
|
+
*/
|
|
27
|
+
disabledHint?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Per-method host configuration for the deposit picker. Omitting a method (or the whole object)
|
|
31
|
+
* keeps default behavior; supply `{ disabled: true, disabledHint: "…" }` to mark an option as
|
|
32
|
+
* unavailable for the current user.
|
|
33
|
+
*/
|
|
34
|
+
interface DepositMethodsConfig {
|
|
35
|
+
wallet?: DepositMethodConfig;
|
|
36
|
+
transfer?: DepositMethodConfig;
|
|
37
|
+
}
|
|
12
38
|
/**
|
|
13
39
|
* Confirm-deposit phase sub-union. Drives the confirm-deposit widget's hero / footer chrome.
|
|
14
40
|
* Phase data is pure navigation; the actual quote payload comes from the driver's `quote` entity.
|
|
@@ -263,4 +289,4 @@ interface DepositActions {
|
|
|
263
289
|
resumeToError(tx?: TxRef): void;
|
|
264
290
|
}
|
|
265
291
|
//#endregion
|
|
266
|
-
export { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec };
|
|
292
|
+
export { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositMethodConfig, DepositMethodsConfig, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{QrCodeIcon as
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r,useDepositMethodsConfig as i}from"../../orchestrator/controller.js";import{QrCodeIcon as a}from"../../../../shared/icons/QrCodeIcon.js";import{WalletIcon as o}from"../../../../shared/icons/WalletIcon.js";import"../../../../icons/index.js";import{DialogShell as s}from"../../../../shared/dialog/DialogShell.js";import{Image as c}from"../../../../shared/ui/Image/Image.js";import{Skeleton as l}from"../../../../shared/ui/Skeleton/Skeleton.js";import"../../../../shared/ui/Skeleton/index.js";import{TokenLogo as u}from"../../../../shared/ui/TokenLogo/TokenLogo.js";import"../../../../shared/ui/TokenLogo/index.js";import"../../../../ui/index.js";import{Deposit as d}from"./compound/Deposit.js";import"./compound/index.js";import{useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={width:18,height:18,"aria-hidden":!0};function g(s){let c=e(),u=r().name,{selectMethod:g}=n(),v=i(),{_:y}=t(),b=c.wallet,x=b.status===`ready`||b.status===`stale`?b.payload:void 0,S=x!==void 0,C=c.brand,w=C.status===`ready`||C.status===`stale`?C.payload:void 0,T=c.addresses,E=T.status===`ready`||T.status===`stale`?T.payload:[],D=c.balances.status===`error`,O=!x?.balanceTotalUsd?.formatted&&!D,k=!!c.brand,A=w?.name?y({id:`ogD_nm`,message:`Deposit to {0}`,values:{0:w.name}}):void 0,j=f(()=>_(E),[E]),M=v?.wallet,N=v?.transfer,P=f(()=>{let e=S?x?.balanceTotalUsd?.formatted?x.balanceTotalUsd.formatted:D?void 0:p(l,{width:56,height:12}):y({id:`5AApJw`,message:`Connect a wallet to continue`}),t=!S||O,n=M?.disabled??!1,r=t||n,i=n?M?.disabledHint:void 0,s=[{id:`wallet`,title:y({id:`sb9Y58`,message:`Wallet`}),icon:p(o,{...h}),...x?{titleAdornment:x.address.formatted}:{},meta:e,recommended:!0,disabled:r,...i?{disabledHint:i}:{},onSelect:r?void 0:()=>g(`wallet`)}];if(k){let e=N?.disabled??!1,t=e?N?.disabledHint:void 0;s.push({id:`transfer`,title:y({id:`3dqPLT`,message:`Transfer Crypto`}),icon:p(a,{...h}),meta:[y({id:`qtoOYG`,message:`No limit`}),y({id:`D79cZK`,message:`Instant`})],...j?{trailing:j}:{},disabled:e,...t?{disabledHint:t}:{},onSelect:e?void 0:()=>g(`transfer`)})}return s},[x,D,O,S,k,j,M,N,g,y]);return u===`deposit`?m(d,{...s,...A?{title:A}:{},methods:P,children:[p(d.Header,{}),p(d.Body,{children:p(d.Methods,{})})]}):null}function _(e){if(e.length!==0)return p(c.Group,{max:4,overflow:Math.max(0,e.length-4),size:`md`,children:e.map(e=>p(u,{isNative:!0,symbol:e.networkName,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},...e.chainLogoUrl?{logoUrl:e.chainLogoUrl}:{},hideChainBadge:!0},e.eip155Id??e.networkName))})}function v({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return p(s,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:p(g,{...i})})}(function(e){e.Dialog=v})(g||={});export{g as Deposit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={root:{"Deposit__styles.root":`Deposit__styles.root`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x17fpy1y`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:17`},header:{"Deposit__styles.header":`Deposit__styles.header`,"justifyContent-kjj79g":`x1qughib`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:25`},closeIcon:{"Deposit__styles.closeIcon":`Deposit__styles.closeIcon`,"color-kMwMTN":`xdksllq`,"strokeWidth-kfJifR":`x1k315e8`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:28`},section:{"Deposit__styles.section":`Deposit__styles.section`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x883omv`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:33`},sectionMethods:{"Deposit__styles.sectionMethods":`Deposit__styles.sectionMethods`,"paddingTop-kLKAdn":`x1cnzs8`,"paddingBottom-kGO01o":`x1t4gjm`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:40`},methodsList:{"Deposit__styles.methodsList":`Deposit__styles.methodsList`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x167g77z`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:45`},methodRow:{"Deposit__styles.methodRow":`Deposit__styles.methodRow`,"gap-kOIVth":`x1af02g3`,"paddingInlineStart-kZCmMZ":`xwn43p0`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:56`},methodIconSlot:{"Deposit__styles.methodIconSlot":`Deposit__styles.methodIconSlot`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"width-kzqmXN":`x14qfxbe`,"height-kZKoxP":`xc9qbxq`,"flexShrink-kmuXW":`x2lah0s`,"borderRadius-kaIpWk":`xi9trdq`,"backgroundColor-kWkggS":`xp5aqsh`,"borderWidth-kMzoRj":`xmkeg23`,"borderStyle-ksu8eU":`x1y0btm7`,"borderColor-kVAM5u":`x1bue7yx`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:
|
|
1
|
+
const e={root:{"Deposit__styles.root":`Deposit__styles.root`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x17fpy1y`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:17`},header:{"Deposit__styles.header":`Deposit__styles.header`,"justifyContent-kjj79g":`x1qughib`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:25`},closeIcon:{"Deposit__styles.closeIcon":`Deposit__styles.closeIcon`,"color-kMwMTN":`xdksllq`,"strokeWidth-kfJifR":`x1k315e8`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:28`},section:{"Deposit__styles.section":`Deposit__styles.section`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x883omv`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:33`},sectionMethods:{"Deposit__styles.sectionMethods":`Deposit__styles.sectionMethods`,"paddingTop-kLKAdn":`x1cnzs8`,"paddingBottom-kGO01o":`x1t4gjm`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:40`},methodsList:{"Deposit__styles.methodsList":`Deposit__styles.methodsList`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x167g77z`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:45`},methodRow:{"Deposit__styles.methodRow":`Deposit__styles.methodRow`,"gap-kOIVth":`x1af02g3`,"paddingInlineStart-kZCmMZ":`xwn43p0`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:56`},methodRowMuted:{"Deposit__styles.methodRowMuted":`Deposit__styles.methodRowMuted`,"opacity-kSiTet":`xbyyjgo`,"cursor-kkrTdU":`x1h6gzvc`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:68`},methodIconSlot:{"Deposit__styles.methodIconSlot":`Deposit__styles.methodIconSlot`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"width-kzqmXN":`x14qfxbe`,"height-kZKoxP":`xc9qbxq`,"flexShrink-kmuXW":`x2lah0s`,"borderRadius-kaIpWk":`xi9trdq`,"backgroundColor-kWkggS":`xp5aqsh`,"borderWidth-kMzoRj":`xmkeg23`,"borderStyle-ksu8eU":`x1y0btm7`,"borderColor-kVAM5u":`x1bue7yx`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:72`},methodText:{"Deposit__styles.methodText":`Deposit__styles.methodText`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flexBasis-kCS8Yb":`x1r8uery`,"flexGrow-kzQI83":`x1iyjqo2`,"flexShrink-kmuXW":`xs83m0k`,"gap-kOIVth":`x1ed6fcf`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:86`},methodTitleRow:{"Deposit__styles.methodTitleRow":`Deposit__styles.methodTitleRow`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x167g77z`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:95`},methodMeta:{"Deposit__styles.methodMeta":`Deposit__styles.methodMeta`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:101`},methodMetaItem:{"Deposit__styles.methodMetaItem":`Deposit__styles.methodMetaItem`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"whiteSpace-khDVqt":`xuxw1ft`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:107`},methodTrailing:{"Deposit__styles.methodTrailing":`Deposit__styles.methodTrailing`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:112`},methodChevron:{"Deposit__styles.methodChevron":`Deposit__styles.methodChevron`,"width-kzqmXN":`x6jxa94`,"height-kZKoxP":`x1v9usgg`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`xdksllq`,"strokeWidth-kfJifR":`x1k315e8`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:117`},methodRecommendedBar:{"Deposit__styles.methodRecommendedBar":`Deposit__styles.methodRecommendedBar`,"position-kVAEAm":`x10l6tqk`,"top-k87sOh":`xuivejd`,"bottom-krVfgx":`xmbx2d0`,"insetInlineStart-kLqNvP":`x1o0tod`,"width-kzqmXN":`xfo62xy`,"borderStartEndRadius-kfmiAY":`x1e4oeot`,"borderEndEndRadius-kT0f0o":`x1ui04y5`,"backgroundColor-kWkggS":`xdmxa9o`,$$css:`@stridge/kit:src/flows/deposit/widgets/deposit/compound/Deposit.styles.ts:124`}};export{e as styles};
|
|
@@ -17,6 +17,12 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
17
17
|
* `SelectableTile` primitive — see `ui/SelectableTile`. The row only contributes its
|
|
18
18
|
* own gap, leading-edge padding (so the recommended bar lands flush), and inner
|
|
19
19
|
* children layout.
|
|
20
|
+
*
|
|
21
|
+
* When the row is `disabled` and a `disabledHint` is supplied, the tile renders in a
|
|
22
|
+
* "soft-disabled" mode — visually muted via a local opacity rule, clicks intercepted to
|
|
23
|
+
* no-op, `aria-disabled` set for assistive tech, and the whole thing wrapped in a kit
|
|
24
|
+
* `Tooltip` so hover/focus surface the hint. The native `disabled` attribute is NOT
|
|
25
|
+
* set in that branch because `pointer-events: none` would suppress the hover trigger.
|
|
20
26
|
*/
|
|
21
27
|
declare function DepositMethod({
|
|
22
28
|
title,
|
|
@@ -26,6 +32,7 @@ declare function DepositMethod({
|
|
|
26
32
|
trailing,
|
|
27
33
|
recommended,
|
|
28
34
|
disabled,
|
|
35
|
+
disabledHint,
|
|
29
36
|
onSelect
|
|
30
37
|
}: DepositMethodProps): _$react_jsx_runtime0.JSX.Element;
|
|
31
38
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{ChevronRightIcon as e}from"../../../../../../shared/icons/ChevronRightIcon.js";import"../../../../../../icons/index.js";import{SelectableTile as t}from"../../../../../../shared/ui/SelectableTile/SelectableTile.js";import"../../../../../../shared/ui/SelectableTile/index.js";import{text as n}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{DEPOSIT_SLOTS as
|
|
1
|
+
"use client";import{ChevronRightIcon as e}from"../../../../../../shared/icons/ChevronRightIcon.js";import"../../../../../../icons/index.js";import{SelectableTile as t}from"../../../../../../shared/ui/SelectableTile/SelectableTile.js";import"../../../../../../shared/ui/SelectableTile/index.js";import{text as n}from"../../../../../../shared/ui/Text/Text.js";import{Tooltip as r}from"../../../../../../shared/ui/Tooltip/Tooltip.js";import"../../../../../../shared/ui/Tooltip/index.js";import"../../../../../../ui/index.js";import{DEPOSIT_SLOTS as i}from"../Deposit.slots.js";import{styles as a}from"../Deposit.styles.js";import{Fragment as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@stylexjs/stylex";function u({title:o,titleAdornment:u,meta:f,icon:p,trailing:m,recommended:h=!1,disabled:g=!1,disabledHint:_,onSelect:v}){let y=g&&typeof _==`string`&&_.length>0,b=g?g?e=>{e.preventDefault()}:void 0:v,x=y?`${o} — ${_}`:o,S=c(t,{shape:`card`,onClick:b,disabled:g&&!y,"aria-label":x,"aria-disabled":g||void 0,"data-stridge-slot":i.method,"data-recommended":h||void 0,"data-disabled":g||void 0,...l.props(a.methodRow,y&&a.methodRowMuted),children:[h?s(`span`,{"aria-hidden":!0,...l.props(a.methodRecommendedBar)}):null,s(`span`,{...l.props(a.methodIconSlot),children:p}),c(`span`,{...l.props(a.methodText),children:[c(`span`,{...l.props(a.methodTitleRow),children:[s(n.span,{size:`sm`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,truncate:!0,children:o}),u?s(n.span,{size:`xs`,leading:`tight`,tracking:`wide`,color:`subdued`,font:`mono`,style:{flexShrink:0},children:u}):null]}),f?s(d,{meta:f}):null]}),s(`span`,{...l.props(a.methodTrailing),children:m??s(e,{"aria-hidden":!0,...l.props(a.methodChevron)})})]});return y?c(r.Root,{children:[s(r.Trigger,{render:S}),s(r.Content,{children:_})]}):S}function d({meta:e}){return Array.isArray(e)?s(n.span,{size:`xs`,leading:`tight`,color:`subdued`,...l.props(a.methodMeta),children:e.map((e,t)=>c(o,{children:[t>0?s(`span`,{...l.props(a.methodMetaItem),children:`·`}):null,s(n.span,{size:`xs`,leading:`tight`,fontWeight:t===0?`medium`:`normal`,color:t===0?`default`:`inherit`,...l.props(a.methodMetaItem),children:e})]},t))}):s(n.span,{size:`xs`,leading:`tight`,color:`subdued`,...l.props(a.methodMeta),children:e})}export{u as DepositMethod};
|
|
@@ -41,6 +41,13 @@ interface DepositMethodOption {
|
|
|
41
41
|
* but click is a no-op.
|
|
42
42
|
*/
|
|
43
43
|
disabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Plain-text hint surfaced when the user hovers, focuses, or taps a
|
|
46
|
+
* disabled row. Rendered via the kit's `Tooltip` primitive and also
|
|
47
|
+
* folded into the tile's accessible name so screen readers convey the
|
|
48
|
+
* reason. Ignored when `disabled` is falsy.
|
|
49
|
+
*/
|
|
50
|
+
disabledHint?: string;
|
|
44
51
|
}
|
|
45
52
|
/**
|
|
46
53
|
* A single method entry passed to the `Deposit` root via the `methods`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TxRef } from "../../../shared/driver/types.js";
|
|
2
|
+
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
2
3
|
import { WithdrawalQuotePayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "../driver/payloads.js";
|
|
3
4
|
import { PrepareWithdrawalInput } from "../driver/types.js";
|
|
4
|
-
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
5
5
|
import { WithdrawStateName, WithdrawSubmitCallback } from "../orchestrator/types.js";
|
|
6
6
|
import { WithdrawBalanceInput, WithdrawSuggestedRecipient } from "../bindings/WithdrawBindings.js";
|
|
7
7
|
import { WithdrawFormEventCallbacks } from "./WithdrawDialogEventsContext.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TxRef } from "../../../shared/driver/types.js";
|
|
2
|
+
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
2
3
|
import { WithdrawalQuotePayload } from "../driver/payloads.js";
|
|
3
4
|
import { WithdrawPreparation } from "../driver/types.js";
|
|
4
|
-
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
5
|
-
|
|
6
5
|
//#region src/flows/withdraw/orchestrator/types.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Form values captured at submit time. The orchestrator carries this snapshot through every
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TxRef } from "./shared/driver/types.js";
|
|
2
2
|
import { DepositSnapshot } from "./flows/deposit/driver/types.js";
|
|
3
3
|
import { useDepositSnapshot } from "./flows/deposit/driver/context.js";
|
|
4
|
+
import { FailureInfo } from "./shared/orchestrator/types.js";
|
|
5
|
+
import { DepositActions, DepositController, DepositMethod, DepositMethodConfig, DepositMethodsConfig, DepositState, DepositStateName, OpenInput } from "./flows/deposit/orchestrator/types.js";
|
|
4
6
|
import { ChainType, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, toChainType } from "./shared/chains/index.js";
|
|
5
7
|
import { WithdrawSnapshot } from "./flows/withdraw/driver/types.js";
|
|
6
8
|
import { useWithdrawSnapshot } from "./flows/withdraw/driver/context.js";
|
|
@@ -12,8 +14,6 @@ import { createLocalStorageAdapter, createMemoryStorageAdapter, createSessionSto
|
|
|
12
14
|
import { createKitStorage } from "./storage/createKitStorage.js";
|
|
13
15
|
import { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue } from "./storage/context.js";
|
|
14
16
|
import { StridgeEnvironment } from "./drivers/stridge/types.js";
|
|
15
|
-
import { FailureInfo } from "./shared/orchestrator/types.js";
|
|
16
|
-
import { DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, OpenInput } from "./flows/deposit/orchestrator/types.js";
|
|
17
17
|
import { WithdrawActions, WithdrawController, WithdrawState, WithdrawStateName, WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput, WithdrawalFormSnapshot } from "./flows/withdraw/orchestrator/types.js";
|
|
18
18
|
import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings } from "./flows/withdraw/bindings/WithdrawBindings.js";
|
|
19
19
|
import { ChainLogoMeta } from "./shared/utils/logos/chains.js";
|
|
@@ -25,5 +25,5 @@ import { useDeposit, useOptionalDeposit } from "./flows/deposit/orchestrator/use
|
|
|
25
25
|
import { useWithdrawState } from "./flows/withdraw/orchestrator/controller.js";
|
|
26
26
|
import { useOptionalWithdraw, useWithdraw } from "./flows/withdraw/orchestrator/useWithdraw.js";
|
|
27
27
|
import { useOptionalStridge, useStridge } from "./stridge/StridgeContext.js";
|
|
28
|
-
import { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeFlowOwner, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig } from "./stridge/StridgeProvider.js";
|
|
29
|
-
export { type BannerAckBucket, type ChainLogoInput, type ChainLogoMeta, type ChainType, DEFAULT_KIT_STORAGE_NAMESPACE, type DepositActions, type DepositController, type DepositMethod, type OpenInput as DepositOpenInput, type DepositSnapshot, type DepositState, type DepositStateName, type FailureInfo, type IntercomMerchantContext, KitPortalScope, KitStorageProvider, type LogosNamespace, type StridgeAppearance, type StridgeAsset, type StridgeDepositDestination, type StridgeDepositFlowConfig, type StridgeEnvironment, type StridgeFlowOwner, StridgeProvider, type StridgeStorageConfig, type StridgeWithdrawFlowConfig, type SupportConfig, type SupportOpenContext, type TokenLogoInput, type TxRef, type WithdrawActions, type WithdrawBalanceInput, type WithdrawBindings, type WithdrawController, type WithdrawSnapshot, type WithdrawState, type WithdrawStateName, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient, type WithdrawalFormSnapshot, bannerAckStorageKey, bucketFromSettlement, createKitStorage, createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, logos, resolveStorageAdapter, toChainType, useBannerAck, useBannerAckForSettlement, useDeposit, useDepositSnapshot, useDepositState, useKitConfig, useKitStorage, useKitStorageValue, useOptionalDeposit, useOptionalStridge, useOptionalWithdraw, useStridge, useWithdraw, useWithdrawBindings, useWithdrawSnapshot, useWithdrawState };
|
|
28
|
+
import { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeDepositMethodConfig, StridgeDepositMethodsConfig, StridgeFlowOwner, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig } from "./stridge/StridgeProvider.js";
|
|
29
|
+
export { type BannerAckBucket, type ChainLogoInput, type ChainLogoMeta, type ChainType, DEFAULT_KIT_STORAGE_NAMESPACE, type DepositActions, type DepositController, type DepositMethod, type DepositMethodConfig, type DepositMethodsConfig, type OpenInput as DepositOpenInput, type DepositSnapshot, type DepositState, type DepositStateName, type FailureInfo, type IntercomMerchantContext, KitPortalScope, KitStorageProvider, type LogosNamespace, type StridgeAppearance, type StridgeAsset, type StridgeDepositDestination, type StridgeDepositFlowConfig, type StridgeDepositMethodConfig, type StridgeDepositMethodsConfig, type StridgeEnvironment, type StridgeFlowOwner, StridgeProvider, type StridgeStorageConfig, type StridgeWithdrawFlowConfig, type SupportConfig, type SupportOpenContext, type TokenLogoInput, type TxRef, type WithdrawActions, type WithdrawBalanceInput, type WithdrawBindings, type WithdrawController, type WithdrawSnapshot, type WithdrawState, type WithdrawStateName, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient, type WithdrawalFormSnapshot, bannerAckStorageKey, bucketFromSettlement, createKitStorage, createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, logos, resolveStorageAdapter, toChainType, useBannerAck, useBannerAckForSettlement, useDeposit, useDepositSnapshot, useDepositState, useKitConfig, useKitStorage, useKitStorageValue, useOptionalDeposit, useOptionalStridge, useOptionalWithdraw, useStridge, useWithdraw, useWithdrawBindings, useWithdrawSnapshot, useWithdrawState };
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.1.0-alpha.
|
|
1
|
+
var e=`0.1.0-alpha.28`;export{e as version};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DepositMethodConfig, DepositMethodsConfig } from "../flows/deposit/orchestrator/types.js";
|
|
1
2
|
import { KitI18nConfig } from "../shared/i18n/createKitI18n.js";
|
|
2
3
|
import { SupportConfig } from "../shared/support/types.js";
|
|
3
4
|
import { StridgeEnvironment } from "../drivers/stridge/types.js";
|
|
@@ -71,7 +72,42 @@ interface StridgeDepositFlowConfig {
|
|
|
71
72
|
* and webhook payloads. Treat as untrusted display data.
|
|
72
73
|
*/
|
|
73
74
|
metadata?: Record<string, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* Per-method host disable lever for the deposit-method picker. The kit ships no built-in
|
|
77
|
+
* inference (embedded-wallet detection, KYC tier, region, …) — the host decides eligibility
|
|
78
|
+
* and passes `{ disabled: true, disabledHint: "…" }` per method. Disabled tiles stay in the
|
|
79
|
+
* picker (preserves "I can see my options" UX), render visually muted, surface the hint on
|
|
80
|
+
* hover/focus, and can't be selected. Omitting the field keeps both methods enabled.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <StridgeProvider
|
|
85
|
+
* flows={{
|
|
86
|
+
* deposit: {
|
|
87
|
+
* destination: { address: treasuryAddress },
|
|
88
|
+
* methods: {
|
|
89
|
+
* wallet: isEmbeddedWallet
|
|
90
|
+
* ? { disabled: true, disabledHint: "Connect an external wallet to pay from your balance. Use Transfer Crypto to send funds from an exchange." }
|
|
91
|
+
* : undefined,
|
|
92
|
+
* },
|
|
93
|
+
* },
|
|
94
|
+
* }}
|
|
95
|
+
* >
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
methods?: StridgeDepositMethodsConfig;
|
|
74
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Host-supplied disable lever for a single payment method on the deposit-method picker. Identical
|
|
102
|
+
* shape to the kit-internal {@link DepositMethodConfig} — re-exported under a Stridge-prefixed
|
|
103
|
+
* name so all `flows.deposit.*` types live alongside the provider.
|
|
104
|
+
*/
|
|
105
|
+
type StridgeDepositMethodConfig = DepositMethodConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Per-method host configuration for the deposit picker. Omitting a method keeps default behavior.
|
|
108
|
+
* Re-export of {@link DepositMethodsConfig} under a Stridge-prefixed name.
|
|
109
|
+
*/
|
|
110
|
+
type StridgeDepositMethodsConfig = DepositMethodsConfig;
|
|
75
111
|
/**
|
|
76
112
|
* Per-flow withdraw tuning.
|
|
77
113
|
*/
|
|
@@ -239,4 +275,4 @@ declare function StridgeProvider({
|
|
|
239
275
|
children
|
|
240
276
|
}: StridgeProvider.Props): _$react_jsx_runtime0.JSX.Element;
|
|
241
277
|
//#endregion
|
|
242
|
-
export { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeFlowOwner, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig };
|
|
278
|
+
export { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeDepositMethodConfig, StridgeDepositMethodsConfig, StridgeFlowOwner, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createKitI18n as e}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as t}from"./StridgeContext.js";import{createStridgeDepositDriver as n}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as r}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{KitProvider as i}from"../KitProvider.js";import{resolveSupport as a}from"../shared/support/resolveSupport.js";import{useIntercomMerchantContext as o}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as s}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useOptionalWagmi as c}from"./optionalWagmi.js";import{createStubDepositDriver as l,createStubWithdrawDriver as u}from"./stubs.js";import{useMemo as d,useRef as f,useSyncExternalStore as p}from"react";import{jsx as m}from"react/jsx-runtime";function h({gatewayKey:h,environment:g,asset:_,flows:v,appearance:y,i18n:b,storage:x,dev:S,support:C,className:w,children:T}){if(!v.deposit&&!v.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!_)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:E,address:D}=c(),O=d(()=>e(b??{}),[b?.locale,b?.messages]),k=f(O);k.current=O;let A=_.networkId,j=_.symbol,M=v.deposit,N=v.withdraw,P=M?.owner?.address??D??S?.userAddressOverride,F=N?.owner.address,I=d(()=>{if(!(!M||!P))return n({userAddress:P,projectKey:h,destination:{network_id:A,asset_symbol:j,to_address:M.destination.address},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...M.minDepositUsd===void 0?{}:{minDepositUsd:M.minDepositUsd},...M.metadata?{metadata:M.metadata}:{}})},[M,P,h,g,A,j,E]),L=d(()=>l(),[]),R=M?I??L:void 0,z=d(()=>{if(!(!N||!F))return r({userAddress:F,projectKey:h,currency:{networkId:A,assetSymbol:j},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...N.metadata?{metadata:N.metadata}:{}})},[N,F,h,g,A,j,E]),B=d(()=>u(),[]),V=N?z??B:void 0,H=I??z,U=p(e=>H?.subscribe(e)??(()=>{}),()=>{if(I){let e=I.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return z?z.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),W=P??F,G=s({gatewayKey:h,environment:g??`production`,assetChain:A,assetSymbol:j,...W?{userAddress:W}:{},...I?{depositDriver:I}:{}});return o(a(C).kind===`stridge`?G:null),m(t,{value:d(()=>({isReady:U,driver:I}),[U,I]),children:m(i,{theme:y?.theme,accent:y?.accent,radius:y?.radius,direction:y?.direction,attribution:y?.attribution,i18n:b,storage:x?.driver,storageNamespace:x?.namespace,className:w,support:C,merchantContext:G,...R?{deposit:R}:{},...V?{withdraw:V}:{},children:T})})}export{h as StridgeProvider};
|
|
1
|
+
"use client";import{createKitI18n as e}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as t}from"./StridgeContext.js";import{createStridgeDepositDriver as n}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as r}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{KitProvider as i}from"../KitProvider.js";import{resolveSupport as a}from"../shared/support/resolveSupport.js";import{useIntercomMerchantContext as o}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as s}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useOptionalWagmi as c}from"./optionalWagmi.js";import{createStubDepositDriver as l,createStubWithdrawDriver as u}from"./stubs.js";import{useMemo as d,useRef as f,useSyncExternalStore as p}from"react";import{jsx as m}from"react/jsx-runtime";function h({gatewayKey:h,environment:g,asset:_,flows:v,appearance:y,i18n:b,storage:x,dev:S,support:C,className:w,children:T}){if(!v.deposit&&!v.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!_)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:E,address:D}=c(),O=d(()=>e(b??{}),[b?.locale,b?.messages]),k=f(O);k.current=O;let A=_.networkId,j=_.symbol,M=v.deposit,N=v.withdraw,P=M?.owner?.address??D??S?.userAddressOverride,F=N?.owner.address,I=d(()=>{if(!(!M||!P))return n({userAddress:P,projectKey:h,destination:{network_id:A,asset_symbol:j,to_address:M.destination.address},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...M.minDepositUsd===void 0?{}:{minDepositUsd:M.minDepositUsd},...M.metadata?{metadata:M.metadata}:{}})},[M,P,h,g,A,j,E]),L=d(()=>l(),[]),R=M?I??L:void 0,z=d(()=>{if(!(!N||!F))return r({userAddress:F,projectKey:h,currency:{networkId:A,assetSymbol:j},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...N.metadata?{metadata:N.metadata}:{}})},[N,F,h,g,A,j,E]),B=d(()=>u(),[]),V=N?z??B:void 0,H=I??z,U=p(e=>H?.subscribe(e)??(()=>{}),()=>{if(I){let e=I.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return z?z.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),W=P??F,G=s({gatewayKey:h,environment:g??`production`,assetChain:A,assetSymbol:j,...W?{userAddress:W}:{},...I?{depositDriver:I}:{}});return o(a(C).kind===`stridge`?G:null),m(t,{value:d(()=>({isReady:U,driver:I}),[U,I]),children:m(i,{theme:y?.theme,accent:y?.accent,radius:y?.radius,direction:y?.direction,attribution:y?.attribution,i18n:b,storage:x?.driver,storageNamespace:x?.namespace,className:w,support:C,merchantContext:G,...R?{deposit:R}:{},...M?.methods?{depositMethods:M.methods}:{},...V?{withdraw:V}:{},children:T})})}export{h as StridgeProvider};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Entity, SettlementFailureKind, TxRef } from "./shared/driver/types.js";
|
|
2
2
|
import { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload } from "./flows/deposit/driver/payloads.js";
|
|
3
3
|
import { DepositSnapshot } from "./flows/deposit/driver/types.js";
|
|
4
|
+
import { FailureInfo } from "./shared/orchestrator/types.js";
|
|
5
|
+
import { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec } from "./flows/deposit/orchestrator/types.js";
|
|
4
6
|
import { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse } from "./flows/withdraw/driver/dto.js";
|
|
5
7
|
import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "./flows/withdraw/driver/payloads.js";
|
|
6
8
|
import { WithdrawSnapshot } from "./flows/withdraw/driver/types.js";
|
|
7
9
|
import { KitConfig, KitDirection, KitRadius, KitTarget, KitTheme } from "./scope/context.js";
|
|
8
10
|
import { KitStorageAdapter, KitStoragePersistence } from "./storage/types.js";
|
|
9
11
|
import { KitStorage } from "./storage/createKitStorage.js";
|
|
10
|
-
import { FailureInfo } from "./shared/orchestrator/types.js";
|
|
11
|
-
import { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec } from "./flows/deposit/orchestrator/types.js";
|
|
12
12
|
import { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput, WithdrawalFormSnapshot } from "./flows/withdraw/orchestrator/types.js";
|
|
13
13
|
import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient } from "./flows/withdraw/bindings/WithdrawBindings.js";
|
|
14
14
|
import { BannerAckBucket } from "./banners/useBannerAck.js";
|