@nexus-cross/crossx-sdk-core 2.3.10-beta.7 → 2.3.11-beta.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/README.md +6 -6
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/types/chain.d.ts +5 -5
- package/dist/core/utils/walletBrowser.d.ts +7 -5
- package/dist/crossx.global +9 -9
- package/dist/index.cjs +11 -11
- package/dist/index.js +11 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ console.log(addr?.address);
|
|
|
50
50
|
|
|
51
51
|
// Sign a message (confirmation modal is shown automatically)
|
|
52
52
|
const { signature } = await sdk.signMessage(
|
|
53
|
-
ChainId.
|
|
53
|
+
ChainId.ONE_MAINNET,
|
|
54
54
|
'Hello CROSSx!',
|
|
55
55
|
);
|
|
56
56
|
```
|
|
@@ -105,11 +105,11 @@ const addrs = await sdk.getAddresses(); // [{ address, index, name? }]
|
|
|
105
105
|
const selected = await sdk.selectWallet();
|
|
106
106
|
|
|
107
107
|
// Native balance
|
|
108
|
-
const { wei, formatted } = await sdk.getBalance(ChainId.
|
|
108
|
+
const { wei, formatted } = await sdk.getBalance(ChainId.ONE_MAINNET);
|
|
109
109
|
console.log(formatted); // "1.234567 CROSS"
|
|
110
110
|
|
|
111
111
|
// Nonce
|
|
112
|
-
const nonce = await sdk.getNonce(ChainId.
|
|
112
|
+
const nonce = await sdk.getNonce(ChainId.ONE_MAINNET);
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
### Signing
|
|
@@ -154,7 +154,7 @@ Every `signTransaction`, `sendTransaction`, and `signMessage` call automatically
|
|
|
154
154
|
import { CROSSxError, ErrorCode } from '@nexus-cross/crossx-sdk-core';
|
|
155
155
|
|
|
156
156
|
try {
|
|
157
|
-
await sdk.sendTransaction(ChainId.
|
|
157
|
+
await sdk.sendTransaction(ChainId.ONE_MAINNET, tx);
|
|
158
158
|
} catch (error) {
|
|
159
159
|
if (error instanceof CROSSxError && error.code === ErrorCode.USER_REJECTED) {
|
|
160
160
|
console.log('User cancelled');
|
|
@@ -303,8 +303,8 @@ Override individual semantic color tokens per mode. Unspecified tokens retain th
|
|
|
303
303
|
```ts
|
|
304
304
|
import { ChainId } from '@nexus-cross/crossx-sdk-core';
|
|
305
305
|
|
|
306
|
-
ChainId.
|
|
307
|
-
ChainId.
|
|
306
|
+
ChainId.ONE_MAINNET // 'eip155:612055'
|
|
307
|
+
ChainId.ONE_TESTNET // 'eip155:612044'
|
|
308
308
|
ChainId.BSC_MAINNET // 'eip155:56'
|
|
309
309
|
ChainId.BSC_TESTNET // 'eip155:97'
|
|
310
310
|
ChainId.RONIN_MAINNET // 'eip155:2020'
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const CHAIN_FALLBACK_RETRY_MS: number;
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const MNEMONIC_ADDRESS_LIMIT = 100;
|
|
39
39
|
/** Token History API clientVersion (registerTokenHistory 호출 시 전송) */
|
|
40
|
-
export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.
|
|
40
|
+
export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.11-beta.1";
|
|
41
41
|
/**
|
|
42
42
|
* 사용자에게 노출되는 지갑 브랜드명 — 단일 소스(Single Source of Truth).
|
|
43
43
|
*
|
|
@@ -47,4 +47,4 @@ export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.10-beta.7";
|
|
|
47
47
|
* 주의: connector `id`('crossx')·class명(`CROSSxSDK`) 등 내부 식별자는 별개이며
|
|
48
48
|
* 여기서 바꾸지 않습니다.
|
|
49
49
|
*/
|
|
50
|
-
export declare const WALLET_BRAND_NAME = "
|
|
50
|
+
export declare const WALLET_BRAND_NAME = "ONEpocket";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* 권장 사용법:
|
|
9
9
|
* import { ChainId } from '@nexus-cross/crossx-sdk-core';
|
|
10
|
-
* sdk.signMessage(ChainId.
|
|
10
|
+
* sdk.signMessage(ChainId.ONE_MAINNET, message);
|
|
11
11
|
*/
|
|
12
12
|
export interface ChainMeta {
|
|
13
13
|
caipId: string;
|
|
@@ -22,17 +22,17 @@ export interface ChainMeta {
|
|
|
22
22
|
testnet?: boolean;
|
|
23
23
|
}
|
|
24
24
|
export declare const CHAIN_REGISTRY: {
|
|
25
|
-
readonly
|
|
25
|
+
readonly ONE_MAINNET: {
|
|
26
26
|
readonly caipId: "eip155:612055";
|
|
27
27
|
readonly chainId: 612055;
|
|
28
|
-
readonly name: "
|
|
28
|
+
readonly name: "ONEchain Mainnet";
|
|
29
29
|
readonly nativeCurrency: {
|
|
30
|
-
readonly symbol: "
|
|
30
|
+
readonly symbol: "ONE";
|
|
31
31
|
readonly decimals: 18;
|
|
32
32
|
};
|
|
33
33
|
readonly rpcUrl: "https://mainnet.crosstoken.io:22001";
|
|
34
34
|
};
|
|
35
|
-
readonly
|
|
35
|
+
readonly ONE_TESTNET: {
|
|
36
36
|
readonly caipId: "eip155:612044";
|
|
37
37
|
readonly chainId: 612044;
|
|
38
38
|
readonly name: "ONEchain Testnet";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 지갑(
|
|
2
|
+
* 지갑(ONEpocket) 인앱 브라우저 판별.
|
|
3
3
|
*
|
|
4
4
|
* 지갑 앱이 웹뷰 메인 프레임에 주입하는 환경 마커를 1순위로 본다. 지갑팀이
|
|
5
|
-
* 공식 판별 수단으로 안내한 값이며, 브랜드명이 CROSSx → ONEwallet+
|
|
6
|
-
* **JS 전역 이름(`__crossx` / `__CROSSX_*`)은 유지**된다.
|
|
5
|
+
* 공식 판별 수단으로 안내한 값이며, 브랜드명이 CROSSx → ONEwallet+ → ONEpocket
|
|
6
|
+
* 으로 바뀌어도 **JS 전역 이름(`__crossx` / `__CROSSX_*`)은 유지**된다.
|
|
7
7
|
*
|
|
8
8
|
* ## UA로 판별하지 않는 이유
|
|
9
9
|
*
|
|
10
10
|
* iOS는 `applicationNameForUserAgent`로 앱 토큰을 붙이는데 그 문자열이 빌드
|
|
11
|
-
* 스킴마다 다르고(prod `
|
|
12
|
-
* dev `
|
|
11
|
+
* 스킴마다 다르고(prod `ONEpocket/3.0.0`, stage `ONEpocket:stage/3.0.0`,
|
|
12
|
+
* dev `ONEpocket:dev/3.0.0`), 플랫폼 간에도 다르다(Android는 `CROSSx/<v>`).
|
|
13
|
+
* 게다가 브랜드가 바뀌어도 구버전 빌드는 옛 표기(`ONEwallet+/2.3.2`, `CROSSx/<v>`)
|
|
14
|
+
* 그대로 필드에 남는다.
|
|
13
15
|
* 실제로 `CROSSx/` 하나만 보던 코드가 앱 리브랜딩 직후 구버전 빌드를 놓쳐,
|
|
14
16
|
* OAuth 결과를 되돌릴 주소(redirectUrl)를 붙이지 못하고 로그인이 dead end로
|
|
15
17
|
* 끝나는 사고가 났다. UA는 마커/브리지가 모두 없을 때의 마지막 보조 신호로만
|