wative-core 2.5.4 → 2.5.5
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/CHANGELOG.md +10 -0
- package/dist/artifacts/evm/index.cjs +1 -1
- package/dist/artifacts/evm/index.d.cts +2 -2
- package/dist/artifacts/evm/index.d.ts +2 -2
- package/dist/artifacts/evm/index.js +1 -1
- package/dist/artifacts/svm/index.cjs +1 -1
- package/dist/artifacts/svm/index.d.cts +3 -3
- package/dist/artifacts/svm/index.d.ts +3 -3
- package/dist/artifacts/svm/index.js +1 -1
- package/dist/{container-provider-B_TXusVF.d.cts → container-provider-BGXrTnGa.d.cts} +1 -1
- package/dist/{container-provider-C0dZf8jA.d.ts → container-provider-DeEiua4J.d.ts} +1 -1
- package/dist/{evm-CsdcpuSb.d.ts → evm-D3zji6gT.d.ts} +1 -1
- package/dist/{evm-DjRcWpHv.d.cts → evm-TSU9rVlb.d.cts} +1 -1
- package/dist/{file-sink-B_Ng4V0f.d.cts → file-sink-BsfIT5JJ.d.cts} +2 -2
- package/dist/{file-sink-gFMJnV3R.d.ts → file-sink-DAitYVxc.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.d.cts +5 -5
- package/dist/index.node.d.ts +5 -5
- package/dist/index.node.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +3 -3
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/{svm-BZlfBFcJ.d.ts → svm-B66vNECq.d.ts} +1 -1
- package/dist/{svm-B7qJlwaU.d.cts → svm-DuJBblmu.d.cts} +1 -1
- package/dist/{workspace-kmsiTC-d.d.cts → workspace-_8Ed5yFS.d.cts} +6 -0
- package/dist/{workspace-kmsiTC-d.d.ts → workspace-_8Ed5yFS.d.ts} +6 -0
- package/examples/03-pk-account.test.cjs +1 -1
- package/examples/04-network-management.test.cjs +1 -1
- package/examples/05-asset-management.test.cjs +2 -2
- package/examples/06-address-signing.test.cjs +2 -3
- package/examples/18-envelope-v3.test.cjs +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Address, a5 as SvmTxBuildParams, a4 as SvmTransaction, N as Network, a2 as SvmAddressLookupTable } from './workspace-
|
|
1
|
+
import { c as Address, a5 as SvmTxBuildParams, a4 as SvmTransaction, N as Network, a2 as SvmAddressLookupTable } from './workspace-_8Ed5yFS.js';
|
|
2
2
|
|
|
3
3
|
declare function svmResolveAddressLookupTables(network: Network, addresses: readonly string[]): Promise<SvmAddressLookupTable[]>;
|
|
4
4
|
interface SvmInstruction {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Address, a5 as SvmTxBuildParams, a4 as SvmTransaction, N as Network, a2 as SvmAddressLookupTable } from './workspace-
|
|
1
|
+
import { c as Address, a5 as SvmTxBuildParams, a4 as SvmTransaction, N as Network, a2 as SvmAddressLookupTable } from './workspace-_8Ed5yFS.cjs';
|
|
2
2
|
|
|
3
3
|
declare function svmResolveAddressLookupTables(network: Network, addresses: readonly string[]): Promise<SvmAddressLookupTable[]>;
|
|
4
4
|
interface SvmInstruction {
|
|
@@ -129,6 +129,8 @@ interface NetworkCollection extends ReadonlyArray<Network> {
|
|
|
129
129
|
drop(network: Network): Promise<void>;
|
|
130
130
|
|
|
131
131
|
update(network: Network): Promise<Network>;
|
|
132
|
+
|
|
133
|
+
move(slug: Slug, toIndex: number): Promise<void>;
|
|
132
134
|
bySlug(slug: Slug): Network | null;
|
|
133
135
|
byChainId(id: ChainId): Network | null;
|
|
134
136
|
}
|
|
@@ -321,6 +323,8 @@ type WativeErrorCode = "WORKSPACE_LOCKED" | "ACCOUNT_LOCKED"
|
|
|
321
323
|
|
|
322
324
|
| "WALLET_DISABLED" | "RECORD_LOCKED" | "BAD_PASSWORD" | "WEAK_PASSWORD" | "RECORD_NOT_FOUND" | "PROVIDER_IO" | "PERMISSION_DENIED" | "DISK_FULL" | "PARAMETER_ERROR"
|
|
323
325
|
|
|
326
|
+
| "DUPLICATE_IDENTITY"
|
|
327
|
+
|
|
324
328
|
| "IRREGULAR_DESTINATION" | "DECRYPT_FAILED" | "ENCRYPT_FAILED" | "ALGORITHM_IRREVERSIBLE" | "INVALID_MNEMONIC" | "INVALID_PRIVATE_KEY" | "UNSUPPORTED_NETWORK" | "TX_BUILD_FAILED" | "TX_SIGN_FAILED" | "TX_SUBMIT_FAILED" | "TX_TIMEOUT" | "TX_DROPPED" | "TX_ABORTED" | "RPC_UNREACHABLE"
|
|
325
329
|
|
|
326
330
|
| "RPC_REJECTED" | "STORAGE_NOT_DURABLE" | "UNSUPPORTED_OP";
|
|
@@ -1067,6 +1071,8 @@ declare class Workspace {
|
|
|
1067
1071
|
|
|
1068
1072
|
dropAsset(id: AssetId): Promise<void>;
|
|
1069
1073
|
|
|
1074
|
+
moveAsset(network: NetworkLike, id: AssetId, toIndex: number): Promise<void>;
|
|
1075
|
+
|
|
1070
1076
|
_findUserAssetOnNetwork(slug: Slug): {
|
|
1071
1077
|
id: number;
|
|
1072
1078
|
symbol: string;
|
|
@@ -129,6 +129,8 @@ interface NetworkCollection extends ReadonlyArray<Network> {
|
|
|
129
129
|
drop(network: Network): Promise<void>;
|
|
130
130
|
|
|
131
131
|
update(network: Network): Promise<Network>;
|
|
132
|
+
|
|
133
|
+
move(slug: Slug, toIndex: number): Promise<void>;
|
|
132
134
|
bySlug(slug: Slug): Network | null;
|
|
133
135
|
byChainId(id: ChainId): Network | null;
|
|
134
136
|
}
|
|
@@ -321,6 +323,8 @@ type WativeErrorCode = "WORKSPACE_LOCKED" | "ACCOUNT_LOCKED"
|
|
|
321
323
|
|
|
322
324
|
| "WALLET_DISABLED" | "RECORD_LOCKED" | "BAD_PASSWORD" | "WEAK_PASSWORD" | "RECORD_NOT_FOUND" | "PROVIDER_IO" | "PERMISSION_DENIED" | "DISK_FULL" | "PARAMETER_ERROR"
|
|
323
325
|
|
|
326
|
+
| "DUPLICATE_IDENTITY"
|
|
327
|
+
|
|
324
328
|
| "IRREGULAR_DESTINATION" | "DECRYPT_FAILED" | "ENCRYPT_FAILED" | "ALGORITHM_IRREVERSIBLE" | "INVALID_MNEMONIC" | "INVALID_PRIVATE_KEY" | "UNSUPPORTED_NETWORK" | "TX_BUILD_FAILED" | "TX_SIGN_FAILED" | "TX_SUBMIT_FAILED" | "TX_TIMEOUT" | "TX_DROPPED" | "TX_ABORTED" | "RPC_UNREACHABLE"
|
|
325
329
|
|
|
326
330
|
| "RPC_REJECTED" | "STORAGE_NOT_DURABLE" | "UNSUPPORTED_OP";
|
|
@@ -1067,6 +1071,8 @@ declare class Workspace {
|
|
|
1067
1071
|
|
|
1068
1072
|
dropAsset(id: AssetId): Promise<void>;
|
|
1069
1073
|
|
|
1074
|
+
moveAsset(network: NetworkLike, id: AssetId, toIndex: number): Promise<void>;
|
|
1075
|
+
|
|
1070
1076
|
_findUserAssetOnNetwork(slug: Slug): {
|
|
1071
1077
|
id: number;
|
|
1072
1078
|
symbol: string;
|
|
@@ -76,7 +76,7 @@ test("PK account — duplicate import is rejected", async () => {
|
|
|
76
76
|
const ws = await Workspace.open({ path: root, password: "wsp-pwd" });
|
|
77
77
|
|
|
78
78
|
const acc = await ws.accounts.create("HotWallet", "wsp-pwd", EVM_PK, undefined, { kind: "PK" });
|
|
79
|
-
await assert.rejects(acc.importPrivateKey(EVM_PK, "evm"), (err) => err.code === "
|
|
79
|
+
await assert.rejects(acc.importPrivateKey(EVM_PK, "evm"), (err) => err.code === "DUPLICATE_IDENTITY");
|
|
80
80
|
|
|
81
81
|
await ws.lock();
|
|
82
82
|
});
|
|
@@ -45,7 +45,7 @@ test("network — add a brand-new user network", async () => {
|
|
|
45
45
|
|
|
46
46
|
assert.strictEqual(ws.networks.length, 15);
|
|
47
47
|
assert.strictEqual(ws.networks.bySlug("monad-testnet").chainId, 10143);
|
|
48
|
-
await assert.rejects(ws.networks.add(monad), (err) => err.code === "
|
|
48
|
+
await assert.rejects(ws.networks.add(monad), (err) => err.code === "DUPLICATE_IDENTITY");
|
|
49
49
|
|
|
50
50
|
await ws.lock();
|
|
51
51
|
});
|
|
@@ -64,7 +64,7 @@ test("asset — id and address collisions are rejected", async () => {
|
|
|
64
64
|
contractAddress: "0x1234567890123456789012345678901234567890",
|
|
65
65
|
network: Network.Ethereum,
|
|
66
66
|
});
|
|
67
|
-
await assert.rejects(ws.addAsset(dupId), (err) => err.code === "
|
|
67
|
+
await assert.rejects(ws.addAsset(dupId), (err) => err.code === "DUPLICATE_IDENTITY");
|
|
68
68
|
|
|
69
69
|
const dupAddr = new Asset({
|
|
70
70
|
id: 201,
|
|
@@ -74,7 +74,7 @@ test("asset — id and address collisions are rejected", async () => {
|
|
|
74
74
|
contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
75
75
|
network: Network.Ethereum,
|
|
76
76
|
});
|
|
77
|
-
await assert.rejects(ws.addAsset(dupAddr), (err) => err.code === "
|
|
77
|
+
await assert.rejects(ws.addAsset(dupAddr), (err) => err.code === "DUPLICATE_IDENTITY");
|
|
78
78
|
|
|
79
79
|
await ws.lock();
|
|
80
80
|
});
|
|
@@ -6,7 +6,7 @@ const { mkdtempSync } = require("node:fs");
|
|
|
6
6
|
const { tmpdir } = require("node:os");
|
|
7
7
|
const { join } = require("node:path");
|
|
8
8
|
|
|
9
|
-
const { Workspace
|
|
9
|
+
const { Workspace } = require("wative-core");
|
|
10
10
|
|
|
11
11
|
const MNEMONIC =
|
|
12
12
|
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
|
|
@@ -36,7 +36,7 @@ test("address — buildTransaction convenience helper (offline)", async () => {
|
|
|
36
36
|
const acc = await ws.accounts.create("Desk", "wsp-pwd", MNEMONIC);
|
|
37
37
|
const evm = acc.wallets[0].addresses.find((a) => a.vm === "evm");
|
|
38
38
|
|
|
39
|
-
const tx =
|
|
39
|
+
const tx = evm.buildTransaction({
|
|
40
40
|
to: "0x1234567890123456789012345678901234567890",
|
|
41
41
|
value: 1_000_000_000_000_000n,
|
|
42
42
|
chainId: 1,
|
|
@@ -45,7 +45,6 @@ test("address — buildTransaction convenience helper (offline)", async () => {
|
|
|
45
45
|
maxFeePerGas: 50_000_000_000n,
|
|
46
46
|
maxPriorityFeePerGas: 1_000_000_000n,
|
|
47
47
|
type: 2,
|
|
48
|
-
network: Network.Ethereum,
|
|
49
48
|
});
|
|
50
49
|
|
|
51
50
|
assert.strictEqual(tx.from.toLowerCase(), evm.publicKey.toLowerCase());
|
|
@@ -29,7 +29,7 @@ function versions(root) {
|
|
|
29
29
|
|
|
30
30
|
test("HybridProviderV3 writes v3 records, and they all share one salt", async () => {
|
|
31
31
|
const root = mkdtempSync(join(tmpdir(), "wative-v3-example-"));
|
|
32
|
-
const ws = await Workspace.open(new HybridProviderV3(root), PW
|
|
32
|
+
const ws = await Workspace.open(new HybridProviderV3(root), PW);
|
|
33
33
|
const acc = await ws.accounts.create("V3 Desk", PW, MNEMONIC);
|
|
34
34
|
await acc.deriveWallets(3);
|
|
35
35
|
await ws.lock();
|
|
@@ -52,7 +52,7 @@ test("HybridProviderV3 writes v3 records, and they all share one salt", async ()
|
|
|
52
52
|
|
|
53
53
|
test("a v3 container reopens and yields the original secrets", async () => {
|
|
54
54
|
const root = mkdtempSync(join(tmpdir(), "wative-v3-example-"));
|
|
55
|
-
let ws = await Workspace.open(new HybridProviderV3(root), PW
|
|
55
|
+
let ws = await Workspace.open(new HybridProviderV3(root), PW);
|
|
56
56
|
const created = await ws.accounts.create("V3 Desk", PW, MNEMONIC);
|
|
57
57
|
await created.deriveWallets(2);
|
|
58
58
|
const expected = created.wallets.map((w) => w.addresses.map((a) => a.publicKey).join(","));
|
|
@@ -72,7 +72,7 @@ test("a v3 container reopens and yields the original secrets", async () => {
|
|
|
72
72
|
|
|
73
73
|
test("a wrong password is rejected, and does not damage the container", async () => {
|
|
74
74
|
const root = mkdtempSync(join(tmpdir(), "wative-v3-example-"));
|
|
75
|
-
let ws = await Workspace.open(new HybridProviderV3(root), PW
|
|
75
|
+
let ws = await Workspace.open(new HybridProviderV3(root), PW);
|
|
76
76
|
await ws.accounts.create("V3 Desk", PW, MNEMONIC);
|
|
77
77
|
await ws.lock();
|
|
78
78
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wative-core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"description": "Hyperscale crypto wallet management library — multi-workspace, multi-chain, originally designed for on-chain market makers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.node.cjs",
|