@nexus-cross/crossx-sdk-core 2.3.10-beta.7 → 2.3.10
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 +1 -1
- package/dist/core/types/chain.d.ts +5 -5
- package/dist/crossx.global +9 -9
- package/dist/index.cjs +11 -11
- package/dist/index.js +9 -9
- 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.10
|
|
40
|
+
export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.10";
|
|
41
41
|
/**
|
|
42
42
|
* 사용자에게 노출되는 지갑 브랜드명 — 단일 소스(Single Source of Truth).
|
|
43
43
|
*
|
|
@@ -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";
|