gondi 0.58.2 → 0.60.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.
@@ -4,7 +4,7 @@ import type { multiSourceLoanABI as multiSourceLoanABIV4 } from './generated/blo
4
4
  import type { auctionLoanLiquidatorABI as auctionLoanLiquidatorABIV5, multiSourceLoanABI as multiSourceLoanABIV5 } from './generated/blockchain/v5';
5
5
  import type { auctionLoanLiquidatorAbi as auctionLoanLiquidatorABIV6, multiSourceLoanAbi as multiSourceLoanABIV6 } from './generated/blockchain/v6';
6
6
  import type { multiSourceLoanAbi as multiSourceLoanABIV7 } from './generated/blockchain/v7';
7
- import type { multiSourceLoanAbi as multiSourceLoanABIV8 } from './generated/blockchain/v8';
7
+ import type { auctionWithBuyoutLoanLiquidatorAbi as auctionLoanLiquidatorABIV8, multiSourceLoanAbi as multiSourceLoanABIV8 } from './generated/blockchain/v8';
8
8
  type RepayAbiTypeV4 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof multiSourceLoanABIV4, 'repayLoan'>['inputs']>;
9
9
  type RepayAbiTypeV5 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof multiSourceLoanABIV5, 'repayLoan'>['inputs']>;
10
10
  type RepayAbiTypeV6 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof multiSourceLoanABIV6, 'repayLoan'>['inputs']>;
@@ -19,6 +19,7 @@ type RefiAbiTypeV5 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof mul
19
19
  type RefiAbiTypeV6 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof multiSourceLoanABIV6, 'refinanceFull'>['inputs']>;
20
20
  type PlaceBidAbiTypeV5 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof auctionLoanLiquidatorABIV5, 'placeBid'>['inputs']>;
21
21
  type PlaceBidAbiTypeV6 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof auctionLoanLiquidatorABIV6, 'placeBid'>['inputs']>;
22
+ type PlaceBidAbiTypeV8 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof auctionLoanLiquidatorABIV8, 'placeBid'>['inputs']>;
22
23
  export type LoanV4 = RepayAbiTypeV4[2] & {
23
24
  contractAddress: Address;
24
25
  };
@@ -51,7 +52,9 @@ export type ExecutionDataV7 = EmitAbiTypeV7[0]['executionData'];
51
52
  export type ExecutionDataV8 = EmitAbiTypeV8[0]['executionData'];
52
53
  type AuctionV5 = PlaceBidAbiTypeV5[2];
53
54
  type AuctionV6 = PlaceBidAbiTypeV6[2];
54
- export type Auction = AuctionV5 | AuctionV6;
55
+ /** A contract version 3.2 auction, which also carries `loanHash` and `buyoutWindow`. */
56
+ export type AuctionV8 = PlaceBidAbiTypeV8[2];
57
+ export type Auction = AuctionV5 | AuctionV6 | AuctionV8;
55
58
  export type HexString = `0x${string}`;
56
59
  export type Signature = HexString;
57
60
  export declare const zeroAddress: Address;
@@ -0,0 +1,158 @@
1
+ import { Address, PublicClient } from 'viem';
2
+ import { Auction, LoanV8 } from '../../blockchain';
3
+ import { Wallet } from '../../clients/contracts';
4
+ import { auctionWithBuyoutLoanLiquidatorAbi as auctionWithBuyoutLoanLiquidatorABIV8 } from '../../generated/blockchain/v8';
5
+ import { BaseContract } from './BaseContract';
6
+ /**
7
+ * The AuctionLoanLiquidator of contract version 3.2. Its `Auction` struct carries `loanHash` and
8
+ * `buyoutWindow` on top of the version 3 struct, and an outbid bidder whose refund transfer failed
9
+ * claims it with `claimRefund`.
10
+ */
11
+ export declare class AllV8 extends BaseContract<typeof auctionWithBuyoutLoanLiquidatorABIV8> {
12
+ constructor({ walletClient, address, publicClient, }: {
13
+ walletClient: Wallet;
14
+ address: Address;
15
+ publicClient?: PublicClient;
16
+ });
17
+ hasAuction({ collectionContractAddress, tokenId, }: {
18
+ collectionContractAddress: Address;
19
+ tokenId: bigint;
20
+ }): Promise<boolean>;
21
+ placeBid({ collectionContractAddress, tokenId, bid, auction, }: {
22
+ collectionContractAddress: Address;
23
+ tokenId: bigint;
24
+ bid: bigint;
25
+ auction: Auction;
26
+ }): Promise<{
27
+ txHash: `0x${string}`;
28
+ waitTxInBlock: () => Promise<{
29
+ blobGasPrice?: bigint | undefined;
30
+ blobGasUsed?: bigint | undefined;
31
+ blockHash: import("viem").Hash;
32
+ blockNumber: bigint;
33
+ blockTimestamp?: bigint | undefined;
34
+ contractAddress: Address | null | undefined;
35
+ cumulativeGasUsed: bigint;
36
+ effectiveGasPrice: bigint;
37
+ from: Address;
38
+ gasUsed: bigint;
39
+ logs: import("viem").Log<bigint, number, false>[];
40
+ logsBloom: import("viem").Hex;
41
+ root?: import("viem").Hash | undefined;
42
+ status: "success" | "reverted";
43
+ to: Address | null;
44
+ transactionHash: import("viem").Hash;
45
+ transactionIndex: number;
46
+ type: import("viem").TransactionType;
47
+ collection: `0x${string}`;
48
+ tokenId: bigint;
49
+ newBidder: `0x${string}`;
50
+ bid: bigint;
51
+ loanAddress: `0x${string}`;
52
+ loanId: bigint;
53
+ }>;
54
+ }>;
55
+ getRemainingLockupSeconds({ auction }: {
56
+ auction: Pick<Auction, 'startTime'>;
57
+ }): Promise<number>;
58
+ settleAuctionWithBuyout({ auction, loan }: {
59
+ auction: Auction;
60
+ loan: LoanV8;
61
+ }): Promise<{
62
+ txHash: `0x${string}`;
63
+ waitTxInBlock: () => Promise<{
64
+ blobGasPrice?: bigint | undefined;
65
+ blobGasUsed?: bigint | undefined;
66
+ blockHash: import("viem").Hash;
67
+ blockNumber: bigint;
68
+ blockTimestamp?: bigint | undefined;
69
+ contractAddress: Address | null | undefined;
70
+ cumulativeGasUsed: bigint;
71
+ effectiveGasPrice: bigint;
72
+ from: Address;
73
+ gasUsed: bigint;
74
+ logs: import("viem").Log<bigint, number, false>[];
75
+ logsBloom: import("viem").Hex;
76
+ root?: import("viem").Hash | undefined;
77
+ status: "success" | "reverted";
78
+ to: Address | null;
79
+ transactionHash: import("viem").Hash;
80
+ transactionIndex: number;
81
+ type: import("viem").TransactionType;
82
+ loanAddress: `0x${string}`;
83
+ loanId: bigint;
84
+ nftAddress: `0x${string}`;
85
+ tokenId: bigint;
86
+ largestTrancheIdx: bigint;
87
+ }>;
88
+ }>;
89
+ settleAuction({ auction, loan }: {
90
+ auction: Auction;
91
+ loan: LoanV8;
92
+ }): Promise<{
93
+ txHash: `0x${string}`;
94
+ waitTxInBlock: () => Promise<{
95
+ blobGasPrice?: bigint | undefined;
96
+ blobGasUsed?: bigint | undefined;
97
+ blockHash: import("viem").Hash;
98
+ blockNumber: bigint;
99
+ blockTimestamp?: bigint | undefined;
100
+ contractAddress: Address | null | undefined;
101
+ cumulativeGasUsed: bigint;
102
+ effectiveGasPrice: bigint;
103
+ from: Address;
104
+ gasUsed: bigint;
105
+ logs: import("viem").Log<bigint, number, false>[];
106
+ logsBloom: import("viem").Hex;
107
+ root?: import("viem").Hash | undefined;
108
+ status: "success" | "reverted";
109
+ to: Address | null;
110
+ transactionHash: import("viem").Hash;
111
+ transactionIndex: number;
112
+ type: import("viem").TransactionType;
113
+ loanContract: `0x${string}`;
114
+ loanId: bigint;
115
+ collection: `0x${string}`;
116
+ tokenId: bigint;
117
+ asset: `0x${string}`;
118
+ proceeds: bigint;
119
+ settler: `0x${string}`;
120
+ triggerFee: bigint;
121
+ }>;
122
+ }>;
123
+ /** The bid refund in `token` that the liquidator holds for `bidder` because its transfer failed. */
124
+ getPendingRefund({ bidder, token }: {
125
+ bidder: Address;
126
+ token: Address;
127
+ }): Promise<bigint>;
128
+ /** Sends the wallet the bid refund in `token` the liquidator holds for it. */
129
+ claimRefund({ token }: {
130
+ token: Address;
131
+ }): Promise<{
132
+ txHash: `0x${string}`;
133
+ waitTxInBlock: () => Promise<{
134
+ blobGasPrice?: bigint | undefined;
135
+ blobGasUsed?: bigint | undefined;
136
+ blockHash: import("viem").Hash;
137
+ blockNumber: bigint;
138
+ blockTimestamp?: bigint | undefined;
139
+ contractAddress: Address | null | undefined;
140
+ cumulativeGasUsed: bigint;
141
+ effectiveGasPrice: bigint;
142
+ from: Address;
143
+ gasUsed: bigint;
144
+ logs: import("viem").Log<bigint, number, false>[];
145
+ logsBloom: import("viem").Hex;
146
+ root?: import("viem").Hash | undefined;
147
+ status: "success" | "reverted";
148
+ to: Address | null;
149
+ transactionHash: import("viem").Hash;
150
+ transactionIndex: number;
151
+ type: import("viem").TransactionType;
152
+ bidder: `0x${string}`;
153
+ asset: `0x${string}`;
154
+ amount: bigint;
155
+ }>;
156
+ }>;
157
+ private mapAuctionToAuctionArgs;
158
+ }
@@ -68,7 +68,12 @@ export declare class CrossCurrencyRenegotiation extends BaseContract<typeof posi
68
68
  * https://aave.com/docs/aave-v3/guides/flash-loans
69
69
  */
70
70
  quote(input: CrossCurrencyRenegotiationInput): Promise<CrossCurrencyRenegotiationQuote>;
71
- /** Checks the bound quote and capped approvals, then simulates and broadcasts atomically. */
71
+ /**
72
+ * Checks the bound quote and capped approvals, then simulates and broadcasts atomically.
73
+ * The borrower signs the deadline-bound execution data first and the repayment data, which
74
+ * carries no nonce or expiry, last, so declining an earlier prompt never leaves a repayment
75
+ * signature behind.
76
+ */
72
77
  execute({ quote, ...input }: CrossCurrencyRenegotiationInput & {
73
78
  quote: CrossCurrencyRenegotiationQuote;
74
79
  }): Promise<{
@@ -8949,6 +8949,7 @@ export declare class MslV6 extends BaseContract<typeof multiSourceLoanAbiV6 | ty
8949
8949
  })[];
8950
8950
  }>;
8951
8951
  }>;
8952
+ /** Cancels every offer below `minId`; only the V3 contract has `cancelAllOffers`. */
8952
8953
  cancelAllOffers({ minId }: {
8953
8954
  minId: bigint;
8954
8955
  }): Promise<{
@@ -9045,6 +9046,7 @@ export declare class MslV6 extends BaseContract<typeof multiSourceLoanAbiV6 | ty
9045
9046
  renegotiationId: bigint;
9046
9047
  }>;
9047
9048
  }>;
9049
+ /** No V3 contract has `cancelAllRenegotiations`, so this always throws. */
9048
9050
  cancelAllRenegotiations(_: {
9049
9051
  minId: bigint;
9050
9052
  }): Promise<void>;
@@ -23,8 +23,9 @@ export declare class PositionMigrator extends BaseContract<typeof positionMigrat
23
23
  walletClient: Wallet;
24
24
  publicClient?: PublicClient;
25
25
  });
26
- smartRenegotiation({ currentBalance, previousMsl, repaymentCalldata, emitCalldata, }: {
26
+ smartRenegotiation({ currentBalance, nonce, previousMsl, repaymentCalldata, emitCalldata, }: {
27
27
  currentBalance: bigint;
28
+ nonce: bigint;
28
29
  previousMsl: MslV5 | MslV6;
29
30
  repaymentCalldata: Hex;
30
31
  emitCalldata: Hex;
@@ -43,6 +43,12 @@ export declare class UserVaultV6 extends BaseContract<typeof userVaultABIV6> {
43
43
  }[];
44
44
  }>;
45
45
  }>;
46
+ /**
47
+ * Mints a vault, then deposits `nfts` (one transaction per collection, whatever the case of its
48
+ * address) and `currencies` into it, one transaction after the other. A deposit that fails
49
+ * after the mint throws a {@link CreateVaultError} carrying the new `vaultId` and the deposits
50
+ * already mined, so the caller can resume into that vault.
51
+ */
46
52
  createVault(nfts: CreateVaultNfts, currencies: CreateVaultCurrencies): Promise<{
47
53
  vaultId: bigint;
48
54
  receipts: ({
@@ -10,6 +10,7 @@ import { NftStandard } from '../../model';
10
10
  import { AllV4 } from './AllV4';
11
11
  import { AllV5 } from './AllV5';
12
12
  import { AllV6 } from './AllV6';
13
+ import { AllV8 } from './AllV8';
13
14
  import { BaseContract } from './BaseContract';
14
15
  import { MslV4 } from './MslV4';
15
16
  import { MslV5 } from './MslV5';
@@ -44,7 +45,7 @@ export declare class Contracts {
44
45
  '2': typeof AllV5;
45
46
  '3': typeof AllV6;
46
47
  '3.1': typeof AllV6;
47
- '3.2': typeof AllV6;
48
+ '3.2': typeof AllV8;
48
49
  };
49
50
  _PBs: {
50
51
  '2': typeof PurchaseBundlerV1;
@@ -66,7 +67,7 @@ export declare class Contracts {
66
67
  * (use `AllForCollateral` for those)
67
68
  * @returns The corresponding AuctionLoanLiquidator contract
68
69
  */
69
- All(mslContractAddress: Address, address?: Address): AllV4 | AllV5 | AllV6;
70
+ All(mslContractAddress: Address, address?: Address): AllV8 | AllV4 | AllV5 | AllV6;
70
71
  /**
71
72
  * The AuctionLoanLiquidator running the auction on a loan's collateral.
72
73
  *
@@ -88,7 +89,7 @@ export declare class Contracts {
88
89
  mslContractAddress: Address;
89
90
  collectionContractAddress: Address;
90
91
  tokenId: bigint;
91
- }): Promise<AllV4 | AllV5 | AllV6>;
92
+ }): Promise<AllV8 | AllV4 | AllV5 | AllV6>;
92
93
  /**
93
94
  * @param address The contract address of the PurchaseBundler contract
94
95
  * @param mslContractAddress The contract address of the MSL contract
@@ -1,4 +1,19 @@
1
1
  import { Address } from 'viem';
2
+ /**
3
+ * Thrown by `createUserVault` when the vault was minted but a deposit that follows it failed.
4
+ * The vault and every deposit in `receipts` stay on-chain, so the caller resumes with `vaultId`
5
+ * through the `depositUserVault*` methods instead of minting another vault. `cause` is the
6
+ * deposit's own error.
7
+ */
8
+ export declare class CreateVaultError extends Error {
9
+ vaultId: bigint;
10
+ receipts: unknown[];
11
+ constructor({ vaultId, receipts, cause, }: {
12
+ vaultId: bigint;
13
+ receipts: unknown[];
14
+ cause: unknown;
15
+ });
16
+ }
2
17
  /**
3
18
  * Thrown before a loan is emitted or refinanced against an NFT the GONDI API flags (for example
4
19
  * reported as stolen), or against a wrapper holding one. Lenders' collection offers cannot exclude