@sodax/types 2.2.0 → 2.3.0-rc.2

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/dist/evm/evm.d.ts CHANGED
@@ -42,9 +42,42 @@ export type EvmRawTransactionReceipt = {
42
42
  export type EvmSendTransactionOptions = {
43
43
  expectedChainId?: number;
44
44
  };
45
+ /**
46
+ * EIP-5792 `atomic` capability of a wallet on one chain. `'ready'` means the wallet can execute
47
+ * atomically once the user approves an account upgrade (e.g. MetaMask's EIP-7702 smart account).
48
+ */
49
+ export type EvmAtomicBatchSupport = 'supported' | 'ready' | 'unsupported';
50
+ export type EvmSendBatchOptions = {
51
+ expectedChainId: number;
52
+ };
53
+ export type EvmWaitForBatchOptions = {
54
+ /** How long to wait for the batch to reach a terminal status, in ms. */
55
+ timeout?: number;
56
+ };
57
+ export type EvmBatchReceipt = {
58
+ transactionHash: Hash;
59
+ status: 'success' | 'reverted';
60
+ };
61
+ /** Terminal state of an EIP-5792 call batch. One receipt when the wallet executed it as one transaction. */
62
+ export type EvmBatchResult = {
63
+ status: 'success' | 'failure';
64
+ /** EIP-5792 status code: 200 confirmed, 400 offchain failure, 500 reverted, 600 partially reverted. */
65
+ statusCode: number;
66
+ atomic: boolean;
67
+ receipts: readonly EvmBatchReceipt[];
68
+ };
45
69
  export interface IEvmWalletProvider extends ICoreWallet {
46
70
  readonly chainType: 'EVM';
47
71
  getWalletAddress: () => Promise<Address>;
48
72
  sendTransaction: (evmRawTx: EvmRawTransaction, options?: EvmSendTransactionOptions) => Promise<Hash>;
49
73
  waitForTransactionReceipt: (txHash: Hash) => Promise<EvmRawTransactionReceipt>;
74
+ /** EIP-5792 atomic-batch support for `chainId`. Optional — callers guard before use. */
75
+ getAtomicBatchSupport?: (chainId: number) => Promise<EvmAtomicBatchSupport>;
76
+ /**
77
+ * Send `txs` as one EIP-5792 batch that must execute atomically (`atomicRequired`), in order.
78
+ * Resolves to the wallet's batch id, not a transaction hash — read it from {@link waitForBatch}.
79
+ */
80
+ sendAtomicBatch?: (txs: readonly EvmRawTransaction[], options: EvmSendBatchOptions) => Promise<string>;
81
+ /** Wait for a batch sent with {@link sendAtomicBatch} to reach a terminal state. Throws on timeout. */
82
+ waitForBatch?: (batchId: string, options?: EvmWaitForBatchOptions) => Promise<EvmBatchResult>;
50
83
  }
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ export * from './wallet/index.js';
29
29
  * sentinel for a stable release. Use {@link configVersionFor} and {@link formatConfigVersion} rather
30
30
  * than unpacking it by hand.
31
31
  */
32
- export declare const CONFIG_VERSION = 2020099;
32
+ export declare const CONFIG_VERSION = 2030002;
33
33
  /** A version decoded from a config version number. `rc` is `null` for a stable release. */
34
34
  export type ParsedConfigVersion = {
35
35
  major: number;
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ export * from './wallet/index.js';
29
29
  * sentinel for a stable release. Use {@link configVersionFor} and {@link formatConfigVersion} rather
30
30
  * than unpacking it by hand.
31
31
  */
32
- export const CONFIG_VERSION = 2020099; // 2.2.0
32
+ export const CONFIG_VERSION = 2030002; // 2.3.0-rc.2
33
33
  /** Highest rc slot, reserved for a stable release so it outranks every rc of the same triple. */
34
34
  const RC_STABLE = 99;
35
35
  const MIN_CONFIG_VERSION = 1_000_000;