gondi 0.44.0 → 0.46.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.
- package/dist/index.mjs +855 -64
- package/dist/index.mjs.map +3 -3
- package/dist/src/clients/api/index.d.ts +37 -6
- package/dist/src/clients/api/sdk.d.ts +11 -0
- package/dist/src/clients/contracts/MslV6.d.ts +107 -0
- package/dist/src/generated/graphql/index.d.ts +1019 -42
- package/dist/src/gondi.d.ts +137 -8
- package/dist/src/index.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
package/dist/src/gondi.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Auction } from './blockchain';
|
|
|
5
5
|
import { Api, Props as ApiProps } from './clients/api';
|
|
6
6
|
import { Contracts, GondiPublicClient, Wallet } from './clients/contracts';
|
|
7
7
|
import { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote } from './clients/contracts/CrossCurrencyRenegotiation';
|
|
8
|
-
import { CollectionOrderInput, DealInput, GenerateCollectionOfferHashMutation, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
|
|
8
|
+
import { CollectionOrderInput, DealInput, GenerateCollectionOfferHashMutation, LoanOfferPublicationInput, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
|
|
9
9
|
import * as model from './model';
|
|
10
10
|
import { NftStandard } from './model';
|
|
11
11
|
import { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
|
|
@@ -43,7 +43,7 @@ interface GondiProps {
|
|
|
43
43
|
apiClient?: ApiProps['apiClient'];
|
|
44
44
|
onStepChange?: OnStepChange;
|
|
45
45
|
/**
|
|
46
|
-
* Skips the flagged-NFT lookup `emitLoan`, `revokeDelegationsAndEmitLoan`,
|
|
46
|
+
* Skips the flagged-NFT lookup `emitLoan`, `emitLoans`, `revokeDelegationsAndEmitLoan`,
|
|
47
47
|
* `refinanceFromOffers`, `efficientRefinanceFromOffers` and
|
|
48
48
|
* `crossCurrencyRenegotiation` run before
|
|
49
49
|
* sending, saving an API call. Only for callers that already keep flagged
|
|
@@ -68,6 +68,13 @@ type Step = {
|
|
|
68
68
|
};
|
|
69
69
|
export type OnStepChange = (step: Step) => Promise<void>;
|
|
70
70
|
export declare class Gondi {
|
|
71
|
+
private pendingSingleNftPublications;
|
|
72
|
+
private pendingCollectionPublications;
|
|
73
|
+
private pendingRenegotiationPublications;
|
|
74
|
+
/** Retains bounded signed payloads while their API save is pending. */
|
|
75
|
+
private rememberPublication;
|
|
76
|
+
/** Binds signed terms and contract; excludes unsigned predecessors. */
|
|
77
|
+
private publicationKey;
|
|
71
78
|
contracts: Contracts;
|
|
72
79
|
wallet: Wallet;
|
|
73
80
|
account: Account;
|
|
@@ -97,7 +104,13 @@ export declare class Gondi {
|
|
|
97
104
|
nonce: string;
|
|
98
105
|
issuedAt?: string;
|
|
99
106
|
}) => string;
|
|
100
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Signs and saves an item offer.
|
|
109
|
+
* @param publication Optional unsigned admission metadata. Previews before signing
|
|
110
|
+
* and throws the backend rejection reason. Identical retries after failed saves
|
|
111
|
+
* reuse the signature; a successful save clears that pending signature.
|
|
112
|
+
*/
|
|
113
|
+
makeSingleNftOffer(offer: model.SingleNftOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
101
114
|
aprBps: import("./generated/graphql").Scalars["BigInt"];
|
|
102
115
|
borrowerAddress: import("./generated/graphql").Scalars["Address"];
|
|
103
116
|
capacity: import("./generated/graphql").Scalars["BigInt"];
|
|
@@ -123,10 +136,16 @@ export declare class Gondi {
|
|
|
123
136
|
nftCollateralTokenId: bigint;
|
|
124
137
|
}>;
|
|
125
138
|
/** @internal */
|
|
126
|
-
_makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress: Address, skipSave: true): Promise<SingleNftSignedOfferInput>;
|
|
139
|
+
_makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress: Address, skipSave: true, publication?: LoanOfferPublicationInput): Promise<SingleNftSignedOfferInput>;
|
|
127
140
|
/** @internal */
|
|
128
|
-
_makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress?: Address, skipSave?: false): ReturnType<Api['saveSingleNftOffer']>;
|
|
129
|
-
|
|
141
|
+
_makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress?: Address, skipSave?: false, publication?: LoanOfferPublicationInput): ReturnType<Api['saveSingleNftOffer']>;
|
|
142
|
+
/**
|
|
143
|
+
* Signs and saves a collection offer without an item preview.
|
|
144
|
+
* @param publication Optional unsigned admission metadata. Identical retries after
|
|
145
|
+
* failed saves reuse the signature; a successful save clears that pending signature.
|
|
146
|
+
* The backend evaluates collection offers independently for each item.
|
|
147
|
+
*/
|
|
148
|
+
makeCollectionOffer(offer: model.CollectionOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
130
149
|
aprBps: import("./generated/graphql").Scalars["BigInt"];
|
|
131
150
|
borrowerAddress: import("./generated/graphql").Scalars["Address"];
|
|
132
151
|
capacity: import("./generated/graphql").Scalars["BigInt"];
|
|
@@ -152,7 +171,7 @@ export declare class Gondi {
|
|
|
152
171
|
nftCollateralTokenId: bigint;
|
|
153
172
|
}>;
|
|
154
173
|
/** @internal */
|
|
155
|
-
_makeCollectionOffer(offer: model.CollectionOfferInput, mslContractAddress?: Address): Promise<{
|
|
174
|
+
_makeCollectionOffer(offer: model.CollectionOfferInput, mslContractAddress?: Address, publication?: LoanOfferPublicationInput): Promise<{
|
|
156
175
|
aprBps: import("./generated/graphql").Scalars["BigInt"];
|
|
157
176
|
borrowerAddress: import("./generated/graphql").Scalars["Address"];
|
|
158
177
|
capacity: import("./generated/graphql").Scalars["BigInt"];
|
|
@@ -719,7 +738,13 @@ export declare class Gondi {
|
|
|
719
738
|
id: bigint;
|
|
720
739
|
contractAddress: Address;
|
|
721
740
|
}): Promise<import("./generated/graphql").UnhideOfferMutation>;
|
|
722
|
-
|
|
741
|
+
/**
|
|
742
|
+
* Signs and saves a refinance offer, optionally with a matching fallback.
|
|
743
|
+
* @param props.publication Optional unsigned admission metadata. Previews before
|
|
744
|
+
* signing and throws the backend rejection reason. Identical retries after failed
|
|
745
|
+
* saves reuse both signatures; a successful save clears the pending payloads.
|
|
746
|
+
*/
|
|
747
|
+
makeRefinanceOffer({ renegotiation, contractAddress, publication, ...props }: MakeRefinanceOfferProps): Promise<{
|
|
723
748
|
id: string;
|
|
724
749
|
loanId: import("./generated/graphql").Scalars["String"];
|
|
725
750
|
duration: import("./generated/graphql").Scalars["BigInt"];
|
|
@@ -1020,6 +1045,109 @@ export declare class Gondi {
|
|
|
1020
1045
|
offerId: string;
|
|
1021
1046
|
}>;
|
|
1022
1047
|
}>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Emits several loans in one transaction: either every loan is emitted or none is.
|
|
1050
|
+
*
|
|
1051
|
+
* Every offer of every loan must belong to the same MultiSourceLoan contract, of version 3 or
|
|
1052
|
+
* later, and each NFT goes through the flagged-NFT check `emitLoan` runs before anything is sent.
|
|
1053
|
+
* `waitTxInBlock` resolves to `loans`, one per item and in the same order, each shaped as
|
|
1054
|
+
* `emitLoan` returns it.
|
|
1055
|
+
*
|
|
1056
|
+
* IMPLEMENTATION NOTE: each loan is an encoded `emitLoan` call inside the contract's
|
|
1057
|
+
* `multicall(bytes[])`, which `MultiSourceLoan` inherits from `Multicall`
|
|
1058
|
+
* (florida-contracts `src/lib/loans/MultiSourceLoan.sol`, `src/lib/Multicall.sol`). It
|
|
1059
|
+
* delegatecalls the calls in order, so `msg.sender` stays the borrower, and reverts the whole
|
|
1060
|
+
* transaction with `MulticallFailed(index, reason)` as soon as one of them fails.
|
|
1061
|
+
*/
|
|
1062
|
+
emitLoans(loans: EmitLoanArgs[]): Promise<{
|
|
1063
|
+
txHash: `0x${string}`;
|
|
1064
|
+
waitTxInBlock: () => Promise<{
|
|
1065
|
+
blobGasPrice?: bigint | undefined;
|
|
1066
|
+
blobGasUsed?: bigint | undefined;
|
|
1067
|
+
blockHash: Hash;
|
|
1068
|
+
blockNumber: bigint;
|
|
1069
|
+
blockTimestamp?: bigint | undefined;
|
|
1070
|
+
contractAddress: Address | null | undefined;
|
|
1071
|
+
cumulativeGasUsed: bigint;
|
|
1072
|
+
effectiveGasPrice: bigint;
|
|
1073
|
+
from: Address;
|
|
1074
|
+
gasUsed: bigint;
|
|
1075
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
1076
|
+
logsBloom: Hex;
|
|
1077
|
+
root?: Hash | undefined;
|
|
1078
|
+
status: "success" | "reverted";
|
|
1079
|
+
to: Address | null;
|
|
1080
|
+
transactionHash: Hash;
|
|
1081
|
+
transactionIndex: number;
|
|
1082
|
+
type: import("viem").TransactionType;
|
|
1083
|
+
loans: {
|
|
1084
|
+
loan: {
|
|
1085
|
+
contractAddress: `0x${string}`;
|
|
1086
|
+
borrower: `0x${string}`;
|
|
1087
|
+
nftCollateralTokenId: bigint;
|
|
1088
|
+
nftCollateralAddress: `0x${string}`;
|
|
1089
|
+
principalAddress: `0x${string}`;
|
|
1090
|
+
principalAmount: bigint;
|
|
1091
|
+
startTime: bigint;
|
|
1092
|
+
duration: bigint;
|
|
1093
|
+
tranche: readonly {
|
|
1094
|
+
loanId: bigint;
|
|
1095
|
+
floor: bigint;
|
|
1096
|
+
principalAmount: bigint;
|
|
1097
|
+
lender: `0x${string}`;
|
|
1098
|
+
accruedInterest: bigint;
|
|
1099
|
+
startTime: bigint;
|
|
1100
|
+
aprBps: bigint;
|
|
1101
|
+
}[];
|
|
1102
|
+
protocolFee: bigint;
|
|
1103
|
+
id: string;
|
|
1104
|
+
} | {
|
|
1105
|
+
contractAddress: `0x${string}`;
|
|
1106
|
+
borrower: `0x${string}`;
|
|
1107
|
+
nftCollateralTokenId: bigint;
|
|
1108
|
+
nftCollateralAddress: `0x${string}`;
|
|
1109
|
+
principalAddress: `0x${string}`;
|
|
1110
|
+
principalAmount: bigint;
|
|
1111
|
+
startTime: bigint;
|
|
1112
|
+
duration: bigint;
|
|
1113
|
+
tranche: readonly {
|
|
1114
|
+
loanId: bigint;
|
|
1115
|
+
floor: bigint;
|
|
1116
|
+
principalAmount: bigint;
|
|
1117
|
+
lender: `0x${string}`;
|
|
1118
|
+
accruedInterest: bigint;
|
|
1119
|
+
startTime: bigint;
|
|
1120
|
+
aprBps: bigint;
|
|
1121
|
+
}[];
|
|
1122
|
+
protocolFee: bigint;
|
|
1123
|
+
id: string;
|
|
1124
|
+
} | {
|
|
1125
|
+
contractAddress: `0x${string}`;
|
|
1126
|
+
borrower: `0x${string}`;
|
|
1127
|
+
nftCollateralTokenId: bigint;
|
|
1128
|
+
nftCollateralAddress: `0x${string}`;
|
|
1129
|
+
principalAddress: `0x${string}`;
|
|
1130
|
+
principalAmount: bigint;
|
|
1131
|
+
startTime: bigint;
|
|
1132
|
+
duration: bigint;
|
|
1133
|
+
tranche: readonly {
|
|
1134
|
+
loanId: bigint;
|
|
1135
|
+
floor: bigint;
|
|
1136
|
+
principalAmount: bigint;
|
|
1137
|
+
lender: `0x${string}`;
|
|
1138
|
+
accruedInterest: bigint;
|
|
1139
|
+
startTime: bigint;
|
|
1140
|
+
aprBps: bigint;
|
|
1141
|
+
}[];
|
|
1142
|
+
protocolFee: bigint;
|
|
1143
|
+
lenderRefinanceDisabled: boolean;
|
|
1144
|
+
id: string;
|
|
1145
|
+
};
|
|
1146
|
+
loanId: bigint;
|
|
1147
|
+
offerIds: string[];
|
|
1148
|
+
}[];
|
|
1149
|
+
}>;
|
|
1150
|
+
}>;
|
|
1023
1151
|
refinanceFromOffers({ loan, loanId, executionData, }: {
|
|
1024
1152
|
loan: LoanToMslLoanType;
|
|
1025
1153
|
loanId: bigint;
|
|
@@ -3652,6 +3780,7 @@ export declare class Gondi {
|
|
|
3652
3780
|
type MakeOfferType = Omit<Awaited<ReturnType<Gondi['makeSingleNftOffer']>>, 'nftId'> | Omit<Awaited<ReturnType<Gondi['makeCollectionOffer']>>, 'collectionId'> | Omit<Awaited<ReturnType<Gondi['makeTraitOffer']>>, 'traitIds'>;
|
|
3653
3781
|
type OfferFromExecutionOffer = OptionalNullable<MakeOfferType, 'borrowerAddress' | 'lenderAddress' | 'offerHash' | 'signature'>;
|
|
3654
3782
|
type MakeRefinanceOfferProps = {
|
|
3783
|
+
publication?: LoanOfferPublicationInput;
|
|
3655
3784
|
renegotiation: model.RenegotiationInput;
|
|
3656
3785
|
contractAddress: Address;
|
|
3657
3786
|
} & ({
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export type { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote,
|
|
|
7
7
|
export type * as Types from './model';
|
|
8
8
|
export { FULFILLED, REJECTED } from './utils/promises';
|
|
9
9
|
export type { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
|
|
10
|
+
export type { LoanOfferPublicationInput } from './generated/graphql';
|