gondi 0.32.0 → 0.34.0

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,6 +1,8 @@
1
+ import { PublicClient } from 'viem';
1
2
  import { Wallet } from './clients/contracts';
2
3
  import { type OnStepChange } from './gondi';
3
4
  export declare const addStepCallback: (props: {
4
5
  wallet: Wallet;
5
6
  onStepChange: OnStepChange;
7
+ publicClient?: PublicClient;
6
8
  }) => Wallet;
@@ -1,4 +1,4 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { LoanV4 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { auctionLoanLiquidatorABI as auctionLoanLiquidatorABIV4 } from '../../generated/blockchain/v4';
@@ -22,9 +22,10 @@ export declare class AllV4 extends BaseContract<typeof auctionLoanLiquidatorABIV
22
22
  }[];
23
23
  })[];
24
24
  }[];
25
- constructor({ walletClient, address }: {
25
+ constructor({ walletClient, address, publicClient, }: {
26
26
  walletClient: Wallet;
27
27
  address: Address;
28
+ publicClient?: PublicClient;
28
29
  });
29
30
  placeBid({ collectionContractAddress, tokenId, bid, }: {
30
31
  collectionContractAddress: Address;
@@ -1,13 +1,14 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { Auction, LoanV5 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { auctionLoanLiquidatorABI as auctionLoanLiquidatorABIV5 } from '../../generated/blockchain/v5';
5
5
  import { AllV6 } from './AllV6';
6
6
  import { BaseContract } from './BaseContract';
7
7
  export declare class AllV5 extends BaseContract<typeof auctionLoanLiquidatorABIV5> {
8
- constructor({ walletClient, address }: {
8
+ constructor({ walletClient, address, publicClient, }: {
9
9
  walletClient: Wallet;
10
10
  address: Address;
11
+ publicClient?: PublicClient;
11
12
  });
12
13
  placeBid({ collectionContractAddress, tokenId, bid, auction, }: {
13
14
  collectionContractAddress: Address;
@@ -1,12 +1,13 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { Auction, LoanV6 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { auctionWithBuyoutLoanLiquidatorAbi as auctionWithBuyoutLoanLiquidatorABIV6 } from '../../generated/blockchain/v6';
5
5
  import { BaseContract } from './BaseContract';
6
6
  export declare class AllV6 extends BaseContract<typeof auctionWithBuyoutLoanLiquidatorABIV6> {
7
- constructor({ walletClient, address }: {
7
+ constructor({ walletClient, address, publicClient, }: {
8
8
  walletClient: Wallet;
9
9
  address: Address;
10
+ publicClient?: PublicClient;
10
11
  });
11
12
  placeBid({ collectionContractAddress, tokenId, bid, auction, }: {
12
13
  collectionContractAddress: Address;
@@ -12,10 +12,11 @@ export declare class BaseContract<TAbi extends Abi> {
12
12
  }) => Promise<Hash>;
13
13
  };
14
14
  parseEventLogs: <TFunctionName extends ContractEventName<TAbi>>(eventName: TFunctionName, logs: TransactionReceipt['logs']) => ReturnType<typeof parseEventLogs<TAbi, true, TFunctionName>>;
15
- constructor({ walletClient, address, abi, }: {
15
+ constructor({ walletClient, address, abi, publicClient, }: {
16
16
  walletClient: Wallet;
17
17
  address: Address;
18
18
  abi: TAbi;
19
+ publicClient?: PublicClient;
19
20
  });
20
21
  sendTransactionData(data: Hex, value?: bigint): Promise<{
21
22
  txHash: `0x${string}`;
@@ -1,11 +1,12 @@
1
- import { Address, Hex } from 'viem';
1
+ import { Address, Hex, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { erc20ABI } from '../../generated/blockchain/v5';
4
4
  import { BaseContract } from './BaseContract';
5
5
  export declare class Erc20 extends BaseContract<typeof erc20ABI> {
6
- constructor({ address, walletClient }: {
6
+ constructor({ address, walletClient, publicClient, }: {
7
7
  address: Address;
8
8
  walletClient: Wallet;
9
+ publicClient?: PublicClient;
9
10
  });
10
11
  decodeApproveCalldata(calldata: Hex): readonly [spender: `0x${string}`, amount: bigint];
11
12
  }
@@ -1,4 +1,4 @@
1
- import { Address, Hash, Hex } from 'viem';
1
+ import { Address, Hash, Hex, PublicClient } from 'viem';
2
2
  import { LoanV4, OfferV4, RenegotiationV4 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { multiSourceLoanABI as multiSourceLoanABIV4 } from '../../generated/blockchain/v4';
@@ -8,9 +8,10 @@ import { MslV5 } from './MslV5';
8
8
  import { MslV6 } from './MslV6';
9
9
  export declare class MslV4 extends BaseContract<typeof multiSourceLoanABIV4> {
10
10
  version: "1";
11
- constructor({ walletClient, address }: {
11
+ constructor({ walletClient, address, publicClient, }: {
12
12
  walletClient: Wallet;
13
13
  address: Address;
14
+ publicClient?: PublicClient;
14
15
  });
15
16
  private getDomain;
16
17
  signOffer({ structToSign }: {
@@ -1,4 +1,4 @@
1
- import { Address, Hash, Hex } from 'viem';
1
+ import { Address, Hash, Hex, PublicClient } from 'viem';
2
2
  import { LoanV5, OfferV5, RenegotiationV5, SignableRepaymentDataV5 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { multiSourceLoanABI as multiSourceLoanABIV5 } from '../../generated/blockchain/v5';
@@ -11,9 +11,10 @@ type RepayArgs = {
11
11
  };
12
12
  export declare class MslV5 extends BaseContract<typeof multiSourceLoanABIV5> {
13
13
  version: "2";
14
- constructor({ walletClient, address }: {
14
+ constructor({ walletClient, address, publicClient, }: {
15
15
  walletClient: Wallet;
16
16
  address: Address;
17
+ publicClient?: PublicClient;
17
18
  });
18
19
  private getDomain;
19
20
  signOffer({ structToSign }: {
@@ -1,4 +1,4 @@
1
- import { Address, Hash, Hex } from 'viem';
1
+ import { Address, Hash, Hex, PublicClient } from 'viem';
2
2
  import { ExecutionDataV6, ExecutionDataV7, ExecutionDataV8, LoanV6, OfferV6, OfferV8, RenegotiationV6, SignableRepaymentDataV6 } from '../../blockchain';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { multiSourceLoanAbi as multiSourceLoanAbiV6 } from '../../generated/blockchain/v6';
@@ -8785,10 +8785,11 @@ declare const MSL_V6_ABI_BY_VERSION: {
8785
8785
  export type MslV6Version = keyof typeof MSL_V6_ABI_BY_VERSION;
8786
8786
  export declare class MslV6 extends BaseContract<typeof multiSourceLoanAbiV6 | typeof multiSourceLoanAbiV7 | typeof multiSourceLoanAbiV8> {
8787
8787
  version: MslV6Version;
8788
- constructor({ walletClient, address, version, }: {
8788
+ constructor({ walletClient, address, version, publicClient, }: {
8789
8789
  walletClient: Wallet;
8790
8790
  address: Address;
8791
8791
  version: MslV6Version;
8792
+ publicClient?: PublicClient;
8792
8793
  });
8793
8794
  private getDomain;
8794
8795
  private loanOfferType;
@@ -1,11 +1,12 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { BaseContract } from '../../clients/contracts/BaseContract';
4
4
  import { oldErc721WrapperAbi } from '../../generated/blockchain/oldERC721Wrapper';
5
5
  export declare class OldERC721Wrapper extends BaseContract<typeof oldErc721WrapperAbi> {
6
- constructor({ walletClient, contractAddress, }: {
6
+ constructor({ walletClient, contractAddress, publicClient, }: {
7
7
  walletClient: Wallet;
8
8
  contractAddress: Address;
9
+ publicClient?: PublicClient;
9
10
  });
10
11
  wrapOldERC721({ tokenId }: {
11
12
  tokenId: bigint;
@@ -1,5 +1,5 @@
1
1
  import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
2
- import { Address, Hex } from 'viem';
2
+ import { Address, Hex, PublicClient } from 'viem';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { MslV5 } from '../../clients/contracts/MslV5';
5
5
  import { MslV6 } from '../../clients/contracts/MslV6';
@@ -17,10 +17,11 @@ export declare class PositionMigrator extends BaseContract<typeof positionMigrat
17
17
  signMigrationArgs({ structToSign }: {
18
18
  structToSign: SmartMigrateArgs['migrationArgs'];
19
19
  }): Promise<`0x${string}`>;
20
- constructor({ address, walletClient, msl, }: {
20
+ constructor({ address, walletClient, msl, publicClient, }: {
21
21
  address: Address;
22
22
  msl: MslV6;
23
23
  walletClient: Wallet;
24
+ publicClient?: PublicClient;
24
25
  });
25
26
  smartRenegotiation({ currentBalance, previousMsl, repaymentCalldata, emitCalldata, }: {
26
27
  currentBalance: bigint;
@@ -1,4 +1,4 @@
1
- import { Address, Hex } from 'viem';
1
+ import { Address, Hex, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { MslV5 } from '../../clients/contracts/MslV5';
4
4
  import { MslV6 } from '../../clients/contracts/MslV6';
@@ -6,10 +6,11 @@ import { purchaseBundlerAbi } from '../../generated/blockchain/v6';
6
6
  import { BaseContract } from './BaseContract';
7
7
  export declare class PurchaseBundlerV1 extends BaseContract<typeof purchaseBundlerAbi> {
8
8
  msl: MslV5 | MslV6;
9
- constructor({ address, walletClient, msl, }: {
9
+ constructor({ address, walletClient, msl, publicClient, }: {
10
10
  address: Address;
11
11
  msl: MslV5 | MslV6;
12
12
  walletClient: Wallet;
13
+ publicClient?: PublicClient;
13
14
  });
14
15
  static EXECUTION_INFO: {
15
16
  readonly name: "executionInfo";
@@ -1,5 +1,5 @@
1
1
  import { Maybe } from 'graphql/jsutils/Maybe';
2
- import { Address, Hex } from 'viem';
2
+ import { Address, Hex, PublicClient } from 'viem';
3
3
  import { Wallet } from '../../clients/contracts';
4
4
  import { MslV5 } from '../../clients/contracts/MslV5';
5
5
  import { MslV6 } from '../../clients/contracts/MslV6';
@@ -8,10 +8,11 @@ import { BaseContract } from './BaseContract';
8
8
  export declare class PurchaseBundlerV2 extends BaseContract<typeof purchaseBundlerV2ABI> {
9
9
  msl: MslV5 | MslV6;
10
10
  static AAVE_PREMIUM_BPS: bigint;
11
- constructor({ address, walletClient, msl, }: {
11
+ constructor({ address, walletClient, msl, publicClient, }: {
12
12
  address: Address;
13
13
  msl: MslV5 | MslV6;
14
14
  walletClient: Wallet;
15
+ publicClient?: PublicClient;
15
16
  });
16
17
  static EXECUTION_INFO: {
17
18
  readonly name: "executionInfo";
@@ -1,4 +1,4 @@
1
- import { Address, Hash, Hex } from 'viem';
1
+ import { Address, Hash, Hex, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { seaportABI } from '../../generated/blockchain/seaport';
4
4
  import { BaseContract } from './BaseContract';
@@ -34,8 +34,9 @@ interface AdvancedOrder {
34
34
  extraData: Hex;
35
35
  }
36
36
  export declare class Seaport extends BaseContract<typeof seaportABI> {
37
- constructor({ walletClient }: {
37
+ constructor({ walletClient, publicClient, }: {
38
38
  walletClient: Wallet;
39
+ publicClient?: PublicClient;
39
40
  });
40
41
  fulfillAdvancedOrder({ advancedOrder, value }: {
41
42
  advancedOrder: AdvancedOrder;
@@ -1,4 +1,4 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { UserVaultV6 } from '../../clients/contracts/UserVaultV6';
4
4
  import { userVaultABI as userVaultABIV5 } from '../../generated/blockchain/v5';
@@ -6,9 +6,10 @@ import { BurnAndWithdrawArgs, CreateVaultCurrencies, CreateVaultNfts, DepositERC
6
6
  import { BaseContract } from './BaseContract';
7
7
  export declare class UserVaultV5 extends BaseContract<typeof userVaultABIV5> {
8
8
  #private;
9
- constructor({ walletClient, address }: {
9
+ constructor({ walletClient, address, publicClient, }: {
10
10
  walletClient: Wallet;
11
11
  address: Address;
12
+ publicClient?: PublicClient;
12
13
  });
13
14
  burnAndWithdraw({ vaultId, collections, tokenIds, tokens, }: BurnAndWithdrawArgs): ReturnType<UserVaultV6['burnAndWithdraw']>;
14
15
  createVault(nfts: CreateVaultNfts, currencies: CreateVaultCurrencies): Promise<{
@@ -1,13 +1,14 @@
1
- import { Address } from 'viem';
1
+ import { Address, PublicClient } from 'viem';
2
2
  import { Wallet } from '../../clients/contracts';
3
3
  import { userVaultAbi as userVaultABIV6 } from '../../generated/blockchain/v6';
4
4
  import { BurnAndWithdrawArgs, CreateVaultCurrencies, CreateVaultNfts, DepositERC20Args, DepositERC721sArgs, DepositERC1155sArgs } from '../../gondi';
5
5
  import { BaseContract } from './BaseContract';
6
6
  export declare class UserVaultV6 extends BaseContract<typeof userVaultABIV6> {
7
7
  #private;
8
- constructor({ walletClient, address }: {
8
+ constructor({ walletClient, address, publicClient, }: {
9
9
  walletClient: Wallet;
10
10
  address: Address;
11
+ publicClient?: PublicClient;
11
12
  });
12
13
  burnAndWithdraw({ vaultId, collections, tokenIds, tokens, erc1155Collections, erc1155TokenIds, }: BurnAndWithdrawArgs): Promise<{
13
14
  txHash: `0x${string}`;
@@ -26,6 +26,7 @@ type Erc721Or1155ABI = typeof erc721ABI | typeof erc1155Abi;
26
26
  type MslArgs = {
27
27
  walletClient: Wallet;
28
28
  address: Address;
29
+ publicClient?: PublicClient;
29
30
  };
30
31
  export declare class Contracts {
31
32
  publicClient: GondiPublicClient;
@@ -12,6 +12,13 @@ import { LoanToMslLoanType } from './utils/loan';
12
12
  import { OptionalNullable } from './utils/types';
13
13
  interface GondiProps {
14
14
  wallet: Wallet;
15
+ /**
16
+ * Dedicated public client for read operations: transaction simulations,
17
+ * receipt polling and contract reads. Must be connected to the same chain as
18
+ * `wallet`. When omitted, a public client is derived from the wallet's own
19
+ * transport, so every read goes through the wallet provider's RPC.
20
+ */
21
+ publicClient?: GondiPublicClient;
15
22
  apiClient?: ApiProps['apiClient'];
16
23
  openseaApiKey?: string;
17
24
  onStepChange?: OnStepChange;
@@ -39,7 +46,7 @@ export declare class Gondi {
39
46
  bcClient: GondiPublicClient;
40
47
  apiClient: Api;
41
48
  openseaClient: Opensea;
42
- constructor({ wallet, apiClient, openseaApiKey, onStepChange }: GondiProps);
49
+ constructor({ wallet, publicClient, apiClient, openseaApiKey, onStepChange }: GondiProps);
43
50
  static create(props: GondiProps & {
44
51
  onStepChange: OnStepChange;
45
52
  }): Gondi;