@nexus-cross/connect-kit-core 1.3.3-beta.9 → 1.3.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/index.d.ts CHANGED
@@ -214,6 +214,26 @@ interface CrossConnectKitConfig {
214
214
  * URL/provider 이름/secret은 노출하지 않는다.
215
215
  */
216
216
  onRampEnabled?: boolean;
217
+ /**
218
+ * When `true`, the kit switches the wallet to {@link defaultNetwork}
219
+ * exactly once right after a connection is established. External
220
+ * wallets (`cross_wallet`, `metamask`, …) connect on whatever chain
221
+ * they last held (e.g. Ethereum Mainnet); `defaultNetwork` only
222
+ * *defines* the kit's canonical chain, it does not move the wallet.
223
+ * This enforces it on connect.
224
+ *
225
+ * Semantics (deliberately a one-shot, not a reactive lock):
226
+ * - Fires once per connected session (connector + address). The
227
+ * user is free to switch chains manually afterwards — the kit
228
+ * will not yank them back.
229
+ * - No-op when already on `defaultNetwork` (no wallet prompt).
230
+ * - A rejected switch (or a wallet that can't add the chain) is
231
+ * respected — the kit does not nag.
232
+ * - Re-enforced once on the next connect after a disconnect.
233
+ *
234
+ * Requires `defaultNetwork` to be set. Default: `false`.
235
+ */
236
+ enforceDefaultNetworkOnConnect?: boolean;
217
237
  }
218
238
  interface AppMetadata {
219
239
  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 d=10n**BigInt(t),s=i/d,g=i%d;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 l=c.slice(0,a),p=l?`${s}.${l}`:s.toString();return n?`-${p}`:p}function y(e,t=4){return m(e,18,t)}import{OnRampError as S,normalizeDisallowReason as k}from"@nexus-cross/onramp";export{f as ConnectionStatus,S as OnRampError,m as formatBalance,y as formatWei,k as normalizeDisallowReason,u as resolveThemeMode};
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 d=10n**BigInt(t),s=i/d,g=i%d;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 l=c.slice(0,a),p=l?`${s}.${l}`:s.toString();return n?`-${p}`:p}function y(e,t=4){return m(e,18,t)}import{OnRampError as k,normalizeDisallowReason as S}from"@nexus-cross/onramp";export{f as ConnectionStatus,k 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-beta.9",
3
+ "version": "1.3.3",
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.3-beta.9"
23
+ "@nexus-cross/onramp": "1.3.3"
24
24
  },
25
25
  "devDependencies": {
26
26
  "tsup": "^8.4.0",