@nexus-cross/connect-kit-core 1.3.3 → 1.3.4-beta.2
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/index.d.ts +37 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,14 @@ interface CrossConnectKitConfig {
|
|
|
214
214
|
* URL/provider 이름/secret은 노출하지 않는다.
|
|
215
215
|
*/
|
|
216
216
|
onRampEnabled?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* cross-auth KYC 표면(`useKyc` 훅) 활성화 토글. default false. true이면
|
|
219
|
+
* connect-kit이 `<KycProvider>`를 자동 마운트하고, 연결된 crossx 2.0 SDK
|
|
220
|
+
* 세션에서 access token을 실시간으로 읽어 `Authorization: Bearer`로 주입한다.
|
|
221
|
+
* DApp은 별도 토큰 배선 없이 `useKyc()`만 호출하면 된다. `X-Project-Id`는
|
|
222
|
+
* `embeddedProjectId`(미설정 시 `crossProjectId` fallback)를 사용한다.
|
|
223
|
+
*/
|
|
224
|
+
kycEnabled?: boolean;
|
|
217
225
|
/**
|
|
218
226
|
* When `true`, the kit switches the wallet to {@link defaultNetwork}
|
|
219
227
|
* exactly once right after a connection is established. External
|
|
@@ -234,6 +242,35 @@ interface CrossConnectKitConfig {
|
|
|
234
242
|
* Requires `defaultNetwork` to be set. Default: `false`.
|
|
235
243
|
*/
|
|
236
244
|
enforceDefaultNetworkOnConnect?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* When `true` (default), any wallet chain switch the kit performs *for
|
|
247
|
+
* an operation* is undone once that operation completes — the wallet is
|
|
248
|
+
* restored to the chain it was on before. This covers the bridge/swap
|
|
249
|
+
* flow (which switches to the source chain to submit the tx) and the
|
|
250
|
+
* Send screen (which switches to the token's chain to send).
|
|
251
|
+
*
|
|
252
|
+
* Rationale: the temporary switch is an implementation detail of the
|
|
253
|
+
* operation. Leaving the DApp's wallet stranded on, say, BSC after a
|
|
254
|
+
* BSC→CROSS bridge makes the rest of the app (and the developer's own
|
|
255
|
+
* flows) behave unexpectedly. app-launcher is a DApp-integration tool,
|
|
256
|
+
* so the friendly default is to hand the chain back.
|
|
257
|
+
*
|
|
258
|
+
* Semantics:
|
|
259
|
+
* - Best-effort: restore is fire-and-forget. A rejected switch-back
|
|
260
|
+
* (or an unconfigured chain) never turns a successful bridge/send
|
|
261
|
+
* into a failure.
|
|
262
|
+
* - Only after success. A failed/cancelled operation leaves the
|
|
263
|
+
* wallet on the operation chain so the user can retry without an
|
|
264
|
+
* extra switch round-trip.
|
|
265
|
+
* - No-op when no switch happened (e.g. already on the target chain,
|
|
266
|
+
* or the gasless permit bridge path that never switches).
|
|
267
|
+
*
|
|
268
|
+
* Unlike {@link enforceDefaultNetworkOnConnect} — which pins to a fixed
|
|
269
|
+
* canonical chain once at connect — this restores to whatever chain the
|
|
270
|
+
* user actually had before the operation. Set `false` to leave the
|
|
271
|
+
* wallet on the operation chain. Default: `true`.
|
|
272
|
+
*/
|
|
273
|
+
restoreChainAfterSwitch?: boolean;
|
|
237
274
|
}
|
|
238
275
|
interface AppMetadata {
|
|
239
276
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var f={CONNECTED:"connected",DISCONNECTED:"disconnected",CONNECTING:"connecting",RECONNECTING:"reconnecting"};function u(e,t){if(t&&typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return typeof e=="string"?e:e&&typeof e=="object"&&"mode"in e?e.mode??"dark":"dark"}function m(e,t,r=4){if(t<0||!Number.isInteger(t))throw new RangeError(`formatBalance: decimals must be a non-negative integer, got ${t}`);if(r<0||!Number.isInteger(r))throw new RangeError(`formatBalance: displayDecimals must be a non-negative integer, got ${r}`);let n=e<0n,i=n?-e:e;if(t===0){let o=i.toString();return n?`-${o}`:o}let
|
|
1
|
+
var f={CONNECTED:"connected",DISCONNECTED:"disconnected",CONNECTING:"connecting",RECONNECTING:"reconnecting"};function u(e,t){if(t&&typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return typeof e=="string"?e:e&&typeof e=="object"&&"mode"in e?e.mode??"dark":"dark"}function m(e,t,r=4){if(t<0||!Number.isInteger(t))throw new RangeError(`formatBalance: decimals must be a non-negative integer, got ${t}`);if(r<0||!Number.isInteger(r))throw new RangeError(`formatBalance: displayDecimals must be a non-negative integer, got ${r}`);let n=e<0n,i=n?-e:e;if(t===0){let o=i.toString();return n?`-${o}`:o}let l=10n**BigInt(t),s=i/l,g=i%l;if(r===0){let o=s.toString();return n?`-${o}`:o}let c=g.toString().padStart(t,"0").slice(0,r),a=c.length;for(;a>0&&c.charCodeAt(a-1)===48;)a--;let d=c.slice(0,a),p=d?`${s}.${d}`:s.toString();return n?`-${p}`:p}function y(e,t=4){return m(e,18,t)}import{OnRampError as M,normalizeDisallowReason as S}from"@nexus-cross/onramp";export{f as ConnectionStatus,M as OnRampError,m as formatBalance,y as formatWei,S as normalizeDisallowReason,u as resolveThemeMode};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexus-cross/connect-kit-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4-beta.2",
|
|
4
4
|
"description": "Core domain logic for @nexus-cross/connect-kit — types, ports, utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@nexus-cross/onramp": "1.3.
|
|
23
|
+
"@nexus-cross/onramp": "1.3.4-beta.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"tsup": "^8.4.0",
|