wative-core 2.5.1 → 2.5.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +61 -55
  2. package/README.md +27 -3
  3. package/dist/artifacts/evm/index.cjs +1 -1
  4. package/dist/artifacts/evm/index.d.cts +2 -2
  5. package/dist/artifacts/evm/index.d.ts +2 -2
  6. package/dist/artifacts/evm/index.js +1 -1
  7. package/dist/artifacts/svm/index.cjs +1 -1
  8. package/dist/artifacts/svm/index.d.cts +3 -3
  9. package/dist/artifacts/svm/index.d.ts +3 -3
  10. package/dist/artifacts/svm/index.js +1 -1
  11. package/dist/{container-provider-CBBJbpUn.d.ts → container-provider-D5bLhd__.d.ts} +4 -2
  12. package/dist/{container-provider-COvXmCLM.d.cts → container-provider-DObyv4EW.d.cts} +4 -2
  13. package/dist/{evm-V5Fn53uW.d.cts → evm-CJqPjHHu.d.cts} +1 -1
  14. package/dist/{evm-Dk4ceFz0.d.ts → evm-Yd0NCJAL.d.ts} +1 -1
  15. package/dist/{file-sink-BjbtAHUL.d.cts → file-sink-D8l-OwW9.d.cts} +2 -2
  16. package/dist/{file-sink-Bf9mpegF.d.ts → file-sink-GrtMBpmU.d.ts} +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +67 -7
  19. package/dist/index.d.ts +67 -7
  20. package/dist/index.js +1 -1
  21. package/dist/index.node.cjs +1 -1
  22. package/dist/index.node.d.cts +6 -6
  23. package/dist/index.node.d.ts +6 -6
  24. package/dist/index.node.js +1 -1
  25. package/dist/node/index.cjs +1 -1
  26. package/dist/node/index.d.cts +3 -3
  27. package/dist/node/index.d.ts +3 -3
  28. package/dist/node/index.js +1 -1
  29. package/dist/{svm-CjNIJZ4l.d.cts → svm-DgxTJqrR.d.ts} +3 -2
  30. package/dist/{svm-D8zsWS64.d.ts → svm-qBfrN98x.d.cts} +3 -2
  31. package/dist/{workspace-DqUdScht.d.cts → workspace-CZO-ANYP.d.cts} +265 -16
  32. package/dist/{workspace-DqUdScht.d.ts → workspace-CZO-ANYP.d.ts} +265 -16
  33. package/examples/14-esm-runtime.test.mjs +0 -3
  34. package/examples/17-locked-state.test.cjs +1 -0
  35. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
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';
1
+ import { P as Provider, T as RecordType, a0 as Slug, Q as Record$1, N as Network, a2 as SvmAddressLookupTable, R as RawTx, E as EvmAddress, _ as SimulationResult, o as DestinationGuardOptions, p as DestinationReport, V as SendRoute, a1 as SvmAddress, ar as SuiAddress, ad as VmToken, f as AssetCollection, x as EvmTxBuildParams, a5 as SvmTxBuildParams, a6 as Transaction, ac as TransferRequest, ab as TransferPayload, j as ChainVM } from './workspace-CZO-ANYP.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 Commitment, l as ConsoleSink, m as ContainerState, D as DecodedTx, n as DestinationCode, q as DestinationScreenResult, r as DestinationScreener, s as DestinationSeverity, t as DestinationWarning, u as EvmRawTx, v as EvmSigner, w as EvmTransaction, y as EvmTxType, L as LogLevel, z as LogRecord, B as LogSink, F as Logger, G as LoggerConfig, H as NetworkCollection, I as NetworkInit, J as NetworkLike, K as NetworkRoutes, M as NormalizedTx, O as OpenOptions, S as RecordInit, U as SendOptions, W as Settling, X as SignInParams, Y as SignInResult, Z as SignRawOptions, $ as SinkConfig, a3 as SvmSigner, a4 as SvmTransaction, a7 as TransactionReceipt, a8 as TransactionStateChange, a9 as TransactionStatus, aa as TransactionTracker, ae as Wallet, af as WalletCollection, ag as WativeError, ah as WativeErrorCode, ai as WativeErrorOpts, aj as Workspace, ak as WorkspaceConfig, al as deserializeEvmTx, am as deserializeSvmTx, an as deserializeTx, ao as isRawTx, ap as newMnemonic, aq as normalizeTxInput } from './workspace-CZO-ANYP.cjs';
3
+ import { a as ContainerProvider } from './container-provider-DObyv4EW.cjs';
4
+ export { C as ContainerEntry } from './container-provider-DObyv4EW.cjs';
5
+ export { A as AbiItem, C as Contract } from './evm-CJqPjHHu.cjs';
6
+ export { P as Program, S as SvmInstruction, s as svmResolveAddressLookupTables } from './svm-qBfrN98x.cjs';
7
7
 
8
8
  type StorageDurability = "persistent" | "best-effort";
9
9
  interface IdbProviderOptions {
@@ -35,6 +35,8 @@ declare class IdbProvider extends ContainerProvider {
35
35
 
36
36
  initialize(): Promise<void>;
37
37
 
38
+ protected get _containerLockKey(): string;
39
+
38
40
  protected _exist(key: string): Promise<boolean>;
39
41
 
40
42
  protected _listItems(key: string): Promise<string[]>;
@@ -186,6 +188,64 @@ declare class PasswordPolicy {
186
188
 
187
189
  declare function closeAllRpcClients(): Promise<void>;
188
190
 
191
+ interface ChainClientOpts {
192
+ rpcUrl?: string;
193
+ }
194
+
195
+ interface ChainClientSimulateOpts extends ChainClientOpts {
196
+ from?: EvmAddress;
197
+ }
198
+
199
+ interface ChainClientBroadcastOpts extends ChainClientOpts {
200
+ route?: SendRoute;
201
+ }
202
+ declare class ChainClient {
203
+ #private;
204
+ readonly network: Network;
205
+ constructor(network: Network);
206
+ get vm(): string;
207
+
208
+ readBalance(owner: string, token?: string | null, opts?: ChainClientOpts): Promise<bigint>;
209
+
210
+ getBlockNumber(opts?: ChainClientOpts): Promise<number>;
211
+
212
+ getGasPrice(opts?: ChainClientOpts): Promise<bigint>;
213
+
214
+ getTransactionCount(address: string, block?: "latest" | "pending", opts?: ChainClientOpts): Promise<number>;
215
+
216
+ getCode(address: string, opts?: ChainClientOpts): Promise<string>;
217
+
218
+ getTransactionReceipt(hash: string, opts?: ChainClientOpts): Promise<unknown | null>;
219
+
220
+ getRecentBlockhash(opts?: ChainClientOpts): Promise<{
221
+ blockhash: string;
222
+ lastValidBlockHeight: number;
223
+ }>;
224
+
225
+ getAccountInfo(address: string, opts?: ChainClientOpts): Promise<{
226
+ owner: string;
227
+ executable: boolean;
228
+ lamports: number;
229
+ parsed: {
230
+ program: string;
231
+ type: string;
232
+ info: Record<string, unknown>;
233
+ } | null;
234
+ } | null>;
235
+
236
+ getSignatureStatus(signature: string, opts?: ChainClientOpts): Promise<unknown | null>;
237
+
238
+ resolveAddressLookupTables(addresses: readonly string[], opts?: ChainClientOpts): Promise<SvmAddressLookupTable[]>;
239
+
240
+ simulate(input: RawTx | string, opts?: ChainClientSimulateOpts): Promise<SimulationResult>;
241
+
242
+ checkDestination(to: string, opts?: {
243
+ tokenAddress?: string;
244
+ } & DestinationGuardOptions): Promise<DestinationReport>;
245
+
246
+ broadcast(raw: string | Uint8Array, opts?: ChainClientBroadcastOpts): Promise<string>;
247
+ }
248
+
189
249
  interface RecoveredSecpSig {
190
250
  recovery: number;
191
251
  toCompactHex(): string;
@@ -258,4 +318,4 @@ interface AssetInit {
258
318
  }
259
319
  declare const BUILTIN_ASSETS: Record<string, ReadonlyArray<AssetInit>>;
260
320
 
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 };
321
+ export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, AssetCollection, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, ChainClient, type ChainClientBroadcastOpts, type ChainClientOpts, type ChainClientSimulateOpts, type ChainCtx, ChainDialect, ChainVM, Cipher, ContainerProvider, type CurveName, DbProvider, DestinationGuardOptions, DestinationReport, 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, RawTx, Record$1 as Record, RecordType, type RecoveredSecpSig, SendRoute, SimulationResult, Slug, type StorageDurability, type StorageQuota, SvmAddress, SvmAddressLookupTable, SvmTxBuildParams, Transaction, TransferPayload, TransferRequest, VmToken, argon2BackendInfo, closeAllRpcClients, registerDialect };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
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';
1
+ import { P as Provider, T as RecordType, a0 as Slug, Q as Record$1, N as Network, a2 as SvmAddressLookupTable, R as RawTx, E as EvmAddress, _ as SimulationResult, o as DestinationGuardOptions, p as DestinationReport, V as SendRoute, a1 as SvmAddress, ar as SuiAddress, ad as VmToken, f as AssetCollection, x as EvmTxBuildParams, a5 as SvmTxBuildParams, a6 as Transaction, ac as TransferRequest, ab as TransferPayload, j as ChainVM } from './workspace-CZO-ANYP.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 Commitment, l as ConsoleSink, m as ContainerState, D as DecodedTx, n as DestinationCode, q as DestinationScreenResult, r as DestinationScreener, s as DestinationSeverity, t as DestinationWarning, u as EvmRawTx, v as EvmSigner, w as EvmTransaction, y as EvmTxType, L as LogLevel, z as LogRecord, B as LogSink, F as Logger, G as LoggerConfig, H as NetworkCollection, I as NetworkInit, J as NetworkLike, K as NetworkRoutes, M as NormalizedTx, O as OpenOptions, S as RecordInit, U as SendOptions, W as Settling, X as SignInParams, Y as SignInResult, Z as SignRawOptions, $ as SinkConfig, a3 as SvmSigner, a4 as SvmTransaction, a7 as TransactionReceipt, a8 as TransactionStateChange, a9 as TransactionStatus, aa as TransactionTracker, ae as Wallet, af as WalletCollection, ag as WativeError, ah as WativeErrorCode, ai as WativeErrorOpts, aj as Workspace, ak as WorkspaceConfig, al as deserializeEvmTx, am as deserializeSvmTx, an as deserializeTx, ao as isRawTx, ap as newMnemonic, aq as normalizeTxInput } from './workspace-CZO-ANYP.js';
3
+ import { a as ContainerProvider } from './container-provider-D5bLhd__.js';
4
+ export { C as ContainerEntry } from './container-provider-D5bLhd__.js';
5
+ export { A as AbiItem, C as Contract } from './evm-Yd0NCJAL.js';
6
+ export { P as Program, S as SvmInstruction, s as svmResolveAddressLookupTables } from './svm-DgxTJqrR.js';
7
7
 
8
8
  type StorageDurability = "persistent" | "best-effort";
9
9
  interface IdbProviderOptions {
@@ -35,6 +35,8 @@ declare class IdbProvider extends ContainerProvider {
35
35
 
36
36
  initialize(): Promise<void>;
37
37
 
38
+ protected get _containerLockKey(): string;
39
+
38
40
  protected _exist(key: string): Promise<boolean>;
39
41
 
40
42
  protected _listItems(key: string): Promise<string[]>;
@@ -186,6 +188,64 @@ declare class PasswordPolicy {
186
188
 
187
189
  declare function closeAllRpcClients(): Promise<void>;
188
190
 
191
+ interface ChainClientOpts {
192
+ rpcUrl?: string;
193
+ }
194
+
195
+ interface ChainClientSimulateOpts extends ChainClientOpts {
196
+ from?: EvmAddress;
197
+ }
198
+
199
+ interface ChainClientBroadcastOpts extends ChainClientOpts {
200
+ route?: SendRoute;
201
+ }
202
+ declare class ChainClient {
203
+ #private;
204
+ readonly network: Network;
205
+ constructor(network: Network);
206
+ get vm(): string;
207
+
208
+ readBalance(owner: string, token?: string | null, opts?: ChainClientOpts): Promise<bigint>;
209
+
210
+ getBlockNumber(opts?: ChainClientOpts): Promise<number>;
211
+
212
+ getGasPrice(opts?: ChainClientOpts): Promise<bigint>;
213
+
214
+ getTransactionCount(address: string, block?: "latest" | "pending", opts?: ChainClientOpts): Promise<number>;
215
+
216
+ getCode(address: string, opts?: ChainClientOpts): Promise<string>;
217
+
218
+ getTransactionReceipt(hash: string, opts?: ChainClientOpts): Promise<unknown | null>;
219
+
220
+ getRecentBlockhash(opts?: ChainClientOpts): Promise<{
221
+ blockhash: string;
222
+ lastValidBlockHeight: number;
223
+ }>;
224
+
225
+ getAccountInfo(address: string, opts?: ChainClientOpts): Promise<{
226
+ owner: string;
227
+ executable: boolean;
228
+ lamports: number;
229
+ parsed: {
230
+ program: string;
231
+ type: string;
232
+ info: Record<string, unknown>;
233
+ } | null;
234
+ } | null>;
235
+
236
+ getSignatureStatus(signature: string, opts?: ChainClientOpts): Promise<unknown | null>;
237
+
238
+ resolveAddressLookupTables(addresses: readonly string[], opts?: ChainClientOpts): Promise<SvmAddressLookupTable[]>;
239
+
240
+ simulate(input: RawTx | string, opts?: ChainClientSimulateOpts): Promise<SimulationResult>;
241
+
242
+ checkDestination(to: string, opts?: {
243
+ tokenAddress?: string;
244
+ } & DestinationGuardOptions): Promise<DestinationReport>;
245
+
246
+ broadcast(raw: string | Uint8Array, opts?: ChainClientBroadcastOpts): Promise<string>;
247
+ }
248
+
189
249
  interface RecoveredSecpSig {
190
250
  recovery: number;
191
251
  toCompactHex(): string;
@@ -258,4 +318,4 @@ interface AssetInit {
258
318
  }
259
319
  declare const BUILTIN_ASSETS: Record<string, ReadonlyArray<AssetInit>>;
260
320
 
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 };
321
+ export { AesGcmCipher, type AesGcmCipherOptions, type Argon2BackendInfo, Argon2Kdf, type Argon2KdfOptions, AssetCollection, type AssetInit, BUILTIN_ASSETS, BUILTIN_NETWORKS, ChainClient, type ChainClientBroadcastOpts, type ChainClientOpts, type ChainClientSimulateOpts, type ChainCtx, ChainDialect, ChainVM, Cipher, ContainerProvider, type CurveName, DbProvider, DestinationGuardOptions, DestinationReport, 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, RawTx, Record$1 as Record, RecordType, type RecoveredSecpSig, SendRoute, SimulationResult, Slug, type StorageDurability, type StorageQuota, SvmAddress, SvmAddressLookupTable, SvmTxBuildParams, Transaction, TransferPayload, TransferRequest, VmToken, argon2BackendInfo, closeAllRpcClients, registerDialect };