wative-core 2.4.7 → 2.5.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/CHANGELOG.md +17 -0
- package/README.md +49 -5
- 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-D4yopeO_.d.ts → container-provider-CBBJbpUn.d.ts} +1 -1
- package/dist/{container-provider-Dh55EEx5.d.cts → container-provider-COvXmCLM.d.cts} +1 -1
- package/dist/{evm-B-cOplST.d.ts → evm-Dk4ceFz0.d.ts} +1 -1
- package/dist/{evm-CkUAeSHX.d.cts → evm-V5Fn53uW.d.cts} +1 -1
- package/dist/{file-sink-GTK4Vv_k.d.ts → file-sink-Bf9mpegF.d.ts} +2 -2
- package/dist/{file-sink-ClLrovbG.d.cts → file-sink-BjbtAHUL.d.cts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +55 -7
- package/dist/index.d.ts +55 -7
- package/dist/index.js +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.d.cts +6 -6
- package/dist/index.node.d.ts +6 -6
- 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-BVmGEWtP.d.cts → svm-CjNIJZ4l.d.cts} +1 -1
- package/dist/{svm-B0khNLa5.d.ts → svm-D8zsWS64.d.ts} +1 -1
- package/dist/{workspace-B3nsEAmk.d.cts → workspace-DqUdScht.d.cts} +44 -11
- package/dist/{workspace-B3nsEAmk.d.ts → workspace-DqUdScht.d.ts} +44 -11
- package/examples/20-custom-chain-dialect.test.cjs +155 -0
- package/examples/21-token-transfer.test.cjs +85 -0
- package/examples/README.md +5 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as Provider,
|
|
2
|
-
export { A as Account, a as AccountCollection, b as AccountOrgType, c as Address, d as Asset, e as AssetBalance,
|
|
3
|
-
import { a as ContainerProvider } from './container-provider-
|
|
4
|
-
export { C as ContainerEntry } from './container-provider-
|
|
5
|
-
export { A as AbiItem, C as Contract } from './evm-
|
|
6
|
-
export { P as Program, S as SvmInstruction } from './svm-
|
|
1
|
+
import { P as Provider, z as RecordType, F as Slug, R as Record$1, E as EvmAddress, G as SvmAddress, a4 as SuiAddress, X as VmToken, N as Network, f as AssetCollection, p as EvmTxBuildParams, J as SvmTxBuildParams, T as Transaction, W as TransferRequest, V as TransferPayload, j as ChainVM } from './workspace-DqUdScht.cjs';
|
|
2
|
+
export { A as Account, a as AccountCollection, b as AccountOrgType, c as Address, d as Asset, e as AssetBalance, g as AssetId, h as AssetInitObject, i as AssetRef, C as ChainId, k as ConsoleSink, l as ContainerState, m as EvmRawTx, n as EvmSigner, o as EvmTransaction, q as EvmTxType, L as LogLevel, r as LogRecord, s as LogSink, t as Logger, u as LoggerConfig, v as NetworkCollection, w as NetworkInit, x as NetworkLike, O as OpenOptions, y as RecordInit, S as Settling, B as SimulationResult, D as SinkConfig, H as SvmSigner, I as SvmTransaction, K as TransactionReceipt, M as TransactionStateChange, Q as TransactionStatus, U as TransactionTracker, Y as Wallet, Z as WalletCollection, _ as WativeError, $ as WativeErrorCode, a0 as WativeErrorOpts, a1 as Workspace, a2 as WorkspaceConfig, a3 as newMnemonic } from './workspace-DqUdScht.cjs';
|
|
3
|
+
import { a as ContainerProvider } from './container-provider-COvXmCLM.cjs';
|
|
4
|
+
export { C as ContainerEntry } from './container-provider-COvXmCLM.cjs';
|
|
5
|
+
export { A as AbiItem, C as Contract } from './evm-V5Fn53uW.cjs';
|
|
6
|
+
export { P as Program, S as SvmInstruction } from './svm-CjNIJZ4l.cjs';
|
|
7
7
|
|
|
8
8
|
type StorageDurability = "persistent" | "best-effort";
|
|
9
9
|
interface IdbProviderOptions {
|
|
@@ -186,6 +186,54 @@ declare class PasswordPolicy {
|
|
|
186
186
|
|
|
187
187
|
declare function closeAllRpcClients(): Promise<void>;
|
|
188
188
|
|
|
189
|
+
interface RecoveredSecpSig {
|
|
190
|
+
recovery: number;
|
|
191
|
+
toCompactHex(): string;
|
|
192
|
+
}
|
|
193
|
+
type CurveName = "secp256k1" | "ed25519";
|
|
194
|
+
|
|
195
|
+
type MessageEncoding = "personal_sign" | "raw" | "ed25519";
|
|
196
|
+
|
|
197
|
+
interface DigestSigner {
|
|
198
|
+
_signBytes(input: string | Uint8Array): RecoveredSecpSig | Uint8Array;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
interface ChainCtx extends DigestSigner {
|
|
202
|
+
readonly publicKey: EvmAddress | SvmAddress | SuiAddress;
|
|
203
|
+
readonly vm: VmToken;
|
|
204
|
+
readonly network: Network;
|
|
205
|
+
readonly assets: AssetCollection;
|
|
206
|
+
}
|
|
207
|
+
declare abstract class ChainDialect {
|
|
208
|
+
|
|
209
|
+
abstract readonly vm: VmToken;
|
|
210
|
+
|
|
211
|
+
abstract readonly curve: CurveName;
|
|
212
|
+
abstract signMessage(ctx: ChainCtx, message: string): string;
|
|
213
|
+
abstract signMessageEncoded(ctx: ChainCtx, message: string, encoding: MessageEncoding): {
|
|
214
|
+
signature: string;
|
|
215
|
+
messageHash: string;
|
|
216
|
+
};
|
|
217
|
+
abstract signTypedData(ctx: ChainCtx, typedData: unknown, chainId: number | bigint): {
|
|
218
|
+
signature: string;
|
|
219
|
+
domainSeparator: string;
|
|
220
|
+
structHash: string;
|
|
221
|
+
};
|
|
222
|
+
abstract buildTransaction(ctx: ChainCtx, params: EvmTxBuildParams | SvmTxBuildParams): Transaction;
|
|
223
|
+
abstract buildTransferPayload(ctx: ChainCtx, req: TransferRequest): TransferPayload;
|
|
224
|
+
|
|
225
|
+
abstract derive(seed: Uint8Array, index: number): {
|
|
226
|
+
publicKey: string;
|
|
227
|
+
privateKey: string;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
abstract addressFromPrivateKey(privateKey: string): string;
|
|
231
|
+
|
|
232
|
+
abstract privateKeyMatches(privateKey: string, publicKey: string): boolean;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
declare function registerDialect(vm: string, factory: () => ChainDialect): void;
|
|
236
|
+
|
|
189
237
|
interface NetworkConfig {
|
|
190
238
|
readonly slug: string;
|
|
191
239
|
readonly name: string;
|
|
@@ -210,4 +258,4 @@ interface AssetInit {
|
|
|
210
258
|
}
|
|
211
259
|
declare const BUILTIN_ASSETS: Record<string, ReadonlyArray<AssetInit>>;
|
|
212
260
|
|
|
213
|
-
export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, ChainVM, Cipher, ContainerProvider, DbProvider, FileProvider, type IdbDestroyOptions, IdbProvider, type IdbProviderOptions, type NetworkConfig, type PasswordCheckContext, type PasswordCheckResult, PasswordPolicy, type PasswordPolicyOptions, PasswordScore, type PasswordWeakness, type PasswordWeaknessCode, Provider, Record$1 as Record, RecordType, Slug, type StorageDurability, type StorageQuota, argon2BackendInfo, closeAllRpcClients };
|
|
261
|
+
export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, AssetCollection, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, type ChainCtx, ChainDialect, ChainVM, Cipher, ContainerProvider, type CurveName, DbProvider, type DigestSigner, EvmAddress, EvmTxBuildParams, FileProvider, type IdbDestroyOptions, IdbProvider, type IdbProviderOptions, type MessageEncoding, Network, type NetworkConfig, type PasswordCheckContext, type PasswordCheckResult, PasswordPolicy, type PasswordPolicyOptions, PasswordScore, type PasswordWeakness, type PasswordWeaknessCode, Provider, Record$1 as Record, RecordType, type RecoveredSecpSig, Slug, type StorageDurability, type StorageQuota, SvmAddress, SvmTxBuildParams, Transaction, TransferPayload, TransferRequest, VmToken, argon2BackendInfo, closeAllRpcClients, registerDialect };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as Provider,
|
|
2
|
-
export { A as Account, a as AccountCollection, b as AccountOrgType, c as Address, d as Asset, e as AssetBalance,
|
|
3
|
-
import { a as ContainerProvider } from './container-provider-
|
|
4
|
-
export { C as ContainerEntry } from './container-provider-
|
|
5
|
-
export { A as AbiItem, C as Contract } from './evm-
|
|
6
|
-
export { P as Program, S as SvmInstruction } from './svm-
|
|
1
|
+
import { P as Provider, z as RecordType, F as Slug, R as Record$1, E as EvmAddress, G as SvmAddress, a4 as SuiAddress, X as VmToken, N as Network, f as AssetCollection, p as EvmTxBuildParams, J as SvmTxBuildParams, T as Transaction, W as TransferRequest, V as TransferPayload, j as ChainVM } from './workspace-DqUdScht.js';
|
|
2
|
+
export { A as Account, a as AccountCollection, b as AccountOrgType, c as Address, d as Asset, e as AssetBalance, g as AssetId, h as AssetInitObject, i as AssetRef, C as ChainId, k as ConsoleSink, l as ContainerState, m as EvmRawTx, n as EvmSigner, o as EvmTransaction, q as EvmTxType, L as LogLevel, r as LogRecord, s as LogSink, t as Logger, u as LoggerConfig, v as NetworkCollection, w as NetworkInit, x as NetworkLike, O as OpenOptions, y as RecordInit, S as Settling, B as SimulationResult, D as SinkConfig, H as SvmSigner, I as SvmTransaction, K as TransactionReceipt, M as TransactionStateChange, Q as TransactionStatus, U as TransactionTracker, Y as Wallet, Z as WalletCollection, _ as WativeError, $ as WativeErrorCode, a0 as WativeErrorOpts, a1 as Workspace, a2 as WorkspaceConfig, a3 as newMnemonic } from './workspace-DqUdScht.js';
|
|
3
|
+
import { a as ContainerProvider } from './container-provider-CBBJbpUn.js';
|
|
4
|
+
export { C as ContainerEntry } from './container-provider-CBBJbpUn.js';
|
|
5
|
+
export { A as AbiItem, C as Contract } from './evm-Dk4ceFz0.js';
|
|
6
|
+
export { P as Program, S as SvmInstruction } from './svm-D8zsWS64.js';
|
|
7
7
|
|
|
8
8
|
type StorageDurability = "persistent" | "best-effort";
|
|
9
9
|
interface IdbProviderOptions {
|
|
@@ -186,6 +186,54 @@ declare class PasswordPolicy {
|
|
|
186
186
|
|
|
187
187
|
declare function closeAllRpcClients(): Promise<void>;
|
|
188
188
|
|
|
189
|
+
interface RecoveredSecpSig {
|
|
190
|
+
recovery: number;
|
|
191
|
+
toCompactHex(): string;
|
|
192
|
+
}
|
|
193
|
+
type CurveName = "secp256k1" | "ed25519";
|
|
194
|
+
|
|
195
|
+
type MessageEncoding = "personal_sign" | "raw" | "ed25519";
|
|
196
|
+
|
|
197
|
+
interface DigestSigner {
|
|
198
|
+
_signBytes(input: string | Uint8Array): RecoveredSecpSig | Uint8Array;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
interface ChainCtx extends DigestSigner {
|
|
202
|
+
readonly publicKey: EvmAddress | SvmAddress | SuiAddress;
|
|
203
|
+
readonly vm: VmToken;
|
|
204
|
+
readonly network: Network;
|
|
205
|
+
readonly assets: AssetCollection;
|
|
206
|
+
}
|
|
207
|
+
declare abstract class ChainDialect {
|
|
208
|
+
|
|
209
|
+
abstract readonly vm: VmToken;
|
|
210
|
+
|
|
211
|
+
abstract readonly curve: CurveName;
|
|
212
|
+
abstract signMessage(ctx: ChainCtx, message: string): string;
|
|
213
|
+
abstract signMessageEncoded(ctx: ChainCtx, message: string, encoding: MessageEncoding): {
|
|
214
|
+
signature: string;
|
|
215
|
+
messageHash: string;
|
|
216
|
+
};
|
|
217
|
+
abstract signTypedData(ctx: ChainCtx, typedData: unknown, chainId: number | bigint): {
|
|
218
|
+
signature: string;
|
|
219
|
+
domainSeparator: string;
|
|
220
|
+
structHash: string;
|
|
221
|
+
};
|
|
222
|
+
abstract buildTransaction(ctx: ChainCtx, params: EvmTxBuildParams | SvmTxBuildParams): Transaction;
|
|
223
|
+
abstract buildTransferPayload(ctx: ChainCtx, req: TransferRequest): TransferPayload;
|
|
224
|
+
|
|
225
|
+
abstract derive(seed: Uint8Array, index: number): {
|
|
226
|
+
publicKey: string;
|
|
227
|
+
privateKey: string;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
abstract addressFromPrivateKey(privateKey: string): string;
|
|
231
|
+
|
|
232
|
+
abstract privateKeyMatches(privateKey: string, publicKey: string): boolean;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
declare function registerDialect(vm: string, factory: () => ChainDialect): void;
|
|
236
|
+
|
|
189
237
|
interface NetworkConfig {
|
|
190
238
|
readonly slug: string;
|
|
191
239
|
readonly name: string;
|
|
@@ -210,4 +258,4 @@ interface AssetInit {
|
|
|
210
258
|
}
|
|
211
259
|
declare const BUILTIN_ASSETS: Record<string, ReadonlyArray<AssetInit>>;
|
|
212
260
|
|
|
213
|
-
export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, ChainVM, Cipher, ContainerProvider, DbProvider, FileProvider, type IdbDestroyOptions, IdbProvider, type IdbProviderOptions, type NetworkConfig, type PasswordCheckContext, type PasswordCheckResult, PasswordPolicy, type PasswordPolicyOptions, PasswordScore, type PasswordWeakness, type PasswordWeaknessCode, Provider, Record$1 as Record, RecordType, Slug, type StorageDurability, type StorageQuota, argon2BackendInfo, closeAllRpcClients };
|
|
261
|
+
export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, AssetCollection, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, type ChainCtx, ChainDialect, ChainVM, Cipher, ContainerProvider, type CurveName, DbProvider, type DigestSigner, EvmAddress, EvmTxBuildParams, FileProvider, type IdbDestroyOptions, IdbProvider, type IdbProviderOptions, type MessageEncoding, Network, type NetworkConfig, type PasswordCheckContext, type PasswordCheckResult, PasswordPolicy, type PasswordPolicyOptions, PasswordScore, type PasswordWeakness, type PasswordWeaknessCode, Provider, Record$1 as Record, RecordType, type RecoveredSecpSig, Slug, type StorageDurability, type StorageQuota, SvmAddress, SvmTxBuildParams, Transaction, TransferPayload, TransferRequest, VmToken, argon2BackendInfo, closeAllRpcClients, registerDialect };
|