gondi 0.37.0 → 0.37.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.
@@ -1,5 +1,16 @@
1
1
  import { Abi, Address, ContractEventName, ContractFunctionName, GetContractReturnType, Hash, Hex, parseEventLogs, PublicClient, SimulateContractParameters, TransactionReceipt } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
+ /**
4
+ * Options of a `safeContractWrite` call. `dataSuffix` is appended verbatim after
5
+ * the ABI-encoded arguments, both in the simulation and in the broadcast
6
+ * transaction (viem's `writeContract` forwards it to `sendTransaction`, which
7
+ * concatenates it onto `data`); Solidity's decoder ignores trailing bytes, so a
8
+ * suffix never changes what the contract executes.
9
+ */
10
+ export type SafeContractWriteOptions = {
11
+ value?: bigint;
12
+ dataSuffix?: Hex;
13
+ };
3
14
  export declare class BaseContract<TAbi extends Abi> {
4
15
  abi: TAbi;
5
16
  address: Address;
@@ -7,9 +18,7 @@ export declare class BaseContract<TAbi extends Abi> {
7
18
  wallet: Wallet;
8
19
  contract: GetContractReturnType<TAbi, PublicClient | Wallet>;
9
20
  safeContractWrite: {
10
- [TFunctionName in ContractFunctionName<TAbi, 'nonpayable' | 'payable'>]: (args: SimulateContractParameters<TAbi, TFunctionName>['args'], options?: {
11
- value?: bigint;
12
- }) => Promise<Hash>;
21
+ [TFunctionName in ContractFunctionName<TAbi, 'nonpayable' | 'payable'>]: (args: SimulateContractParameters<TAbi, TFunctionName>['args'], options?: SafeContractWriteOptions) => Promise<Hash>;
13
22
  };
14
23
  parseEventLogs: <TFunctionName extends ContractEventName<TAbi>>(eventName: TFunctionName, logs: TransactionReceipt['logs']) => ReturnType<typeof parseEventLogs<TAbi, true, TFunctionName>>;
15
24
  constructor({ walletClient, address, abi, publicClient, }: {
@@ -23,7 +32,5 @@ export declare class BaseContract<TAbi extends Abi> {
23
32
  waitTxInBlock: () => Promise<TransactionReceipt>;
24
33
  }>;
25
34
  private sendRawTransaction;
26
- private safeRawWrite;
27
- private decodeRawRevert;
28
35
  private sendTransactionWithAbiValidation;
29
36
  }
@@ -1,6 +1,16 @@
1
- import { PublicClient } from 'viem';
1
+ import { PublicClient, TransactionReceipt } from 'viem';
2
2
  import { HexString } from '../blockchain';
3
3
  export declare const isEmptyCalldata: (calldata: HexString) => calldata is "0x";
4
+ /**
5
+ * Returns the receipt of a mined transaction, or throws when it reverted.
6
+ *
7
+ * IMPLEMENTATION NOTE: viem's `waitForTransactionReceipt` resolves with the
8
+ * receipt whatever its outcome and reports a revert only through
9
+ * `receipt.status === 'reverted'`
10
+ * (https://viem.sh/docs/actions/public/waitForTransactionReceipt#returns), so a
11
+ * caller that awaits the receipt alone treats a reverted transaction as mined.
12
+ */
13
+ export declare const assertTransactionSucceeded: (receipt: TransactionReceipt) => TransactionReceipt;
4
14
  /**
5
15
  * Total time a receipt wait keeps trying before giving up on a broadcast
6
16
  * transaction. Slow-to-mine transactions usually confirm well within this
@@ -0,0 +1,9 @@
1
+ import { Hex } from 'viem';
2
+ /**
3
+ * Seaport `matchAdvancedOrders` calldata for an ask matched against a collection
4
+ * bid, encoded by the Gondi API's encoder (web3.py `Contract.encode_abi`, i.e.
5
+ * eth_abi) rather than viem: two orders with signatures that do not fill a
6
+ * word, a criteria resolver with a proof, three fulfillments and a recipient.
7
+ * Untagged; tests append the attribution tag.
8
+ */
9
+ export declare const matchAdvancedOrdersCalldata: Hex;