gondi 0.43.1 → 0.45.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 +868 -66
- package/dist/index.mjs.map +4 -4
- package/dist/src/clients/api/index.d.ts +41 -6
- package/dist/src/clients/api/sdk.d.ts +15 -0
- package/dist/src/errors.d.ts +14 -0
- package/dist/src/generated/graphql/index.d.ts +1038 -42
- package/dist/src/gondi.d.ts +49 -8
- package/dist/src/index.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
2
|
import { getSdkApollo } from '../../clients/api/sdk';
|
|
3
3
|
import { Wallet } from '../../clients/contracts';
|
|
4
|
-
import { BnplOrderInput, BulkNftOrdersInput, CollectionOrderInput, CollectionSignedOfferInput, DealInput, ListListingsQueryVariables, ListLoansQueryVariables, ListOffersQueryVariables, NftOrderInput, SingleNftOrderInput, SingleNftSignedOfferInput, TraitOrderInput, TraitSignedOfferInput } from '../../generated/graphql';
|
|
4
|
+
import { BnplOrderInput, BulkNftOrdersInput, CollectionOrderInput, CollectionSignedOfferInput, DealInput, ListListingsQueryVariables, ListLoansQueryVariables, ListOffersQueryVariables, LoanOfferPublicationInput, NftOrderInput, RenegotiationOfferInput, SingleNftOfferInput, SingleNftOrderInput, SingleNftSignedOfferInput, TraitOrderInput, TraitSignedOfferInput } from '../../generated/graphql';
|
|
5
5
|
import { OnStepChange } from '../../gondi';
|
|
6
6
|
import { RenegotiationOffer } from '../../model';
|
|
7
7
|
export type Props = {
|
|
@@ -19,7 +19,7 @@ export declare class Api {
|
|
|
19
19
|
taker: import("../../generated/graphql").Scalars["Address"];
|
|
20
20
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").GetSaleCalldataQuery>;
|
|
21
21
|
generateSingleNftOfferHash: (variables: import("../../generated/graphql").Exact<{
|
|
22
|
-
offerInput:
|
|
22
|
+
offerInput: SingleNftOfferInput;
|
|
23
23
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").GenerateSingleNftOfferHashMutation>;
|
|
24
24
|
generateCollectionOfferHash: (variables: import("../../generated/graphql").Exact<{
|
|
25
25
|
offerInput: import("../../generated/graphql").CollectionOfferInput;
|
|
@@ -28,7 +28,7 @@ export declare class Api {
|
|
|
28
28
|
offerInput: import("../../generated/graphql").TraitOfferInput;
|
|
29
29
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").GenerateTraitOfferHashMutation>;
|
|
30
30
|
generateRenegotiationOfferHash: (variables: import("../../generated/graphql").Exact<{
|
|
31
|
-
renegotiationInput:
|
|
31
|
+
renegotiationInput: RenegotiationOfferInput;
|
|
32
32
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").GenerateRenegotiationOfferHashMutation>;
|
|
33
33
|
nftIdBySlugTokenId: (variables: import("../../generated/graphql").Exact<{
|
|
34
34
|
slug: import("../../generated/graphql").Scalars["String"];
|
|
@@ -38,6 +38,10 @@ export declare class Api {
|
|
|
38
38
|
contractAddress: import("../../generated/graphql").Scalars["Address"];
|
|
39
39
|
tokenId: import("../../generated/graphql").Scalars["BigInt"];
|
|
40
40
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").NftIdByContractAddressAndTokenIdQuery>;
|
|
41
|
+
nftFlaggedByContractAddressAndTokenId: (variables: import("../../generated/graphql").Exact<{
|
|
42
|
+
contractAddress: import("../../generated/graphql").Scalars["Address"];
|
|
43
|
+
tokenId: import("../../generated/graphql").Scalars["BigInt"];
|
|
44
|
+
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").NftFlaggedByContractAddressAndTokenIdQuery>;
|
|
41
45
|
collections: (variables: import("../../generated/graphql").Exact<{
|
|
42
46
|
currency: import("../../generated/graphql").Scalars["Address"];
|
|
43
47
|
collections?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["Int"]> | import("../../generated/graphql").Scalars["Int"]>;
|
|
@@ -102,7 +106,38 @@ export declare class Api {
|
|
|
102
106
|
collectionId: import("../../generated/graphql").Scalars["Int"];
|
|
103
107
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").CollectionStepsByIdQuery>;
|
|
104
108
|
constructor({ apiClient, wallet, onStepChange }: Props);
|
|
105
|
-
|
|
109
|
+
/** Check competition before asking the wallet to sign; saving rechecks atomically. */
|
|
110
|
+
previewSingleNftPublication(offerInput: SingleNftOfferInput, publication: LoanOfferPublicationInput): Promise<{
|
|
111
|
+
__typename?: "LoanOfferCompetitionPreview";
|
|
112
|
+
complete: boolean;
|
|
113
|
+
qualifies: boolean;
|
|
114
|
+
reason?: string | null;
|
|
115
|
+
replacementIds: Array<string>;
|
|
116
|
+
references: Array<{
|
|
117
|
+
__typename?: "LoanOfferCompetitionReference";
|
|
118
|
+
optionId: string;
|
|
119
|
+
sourceIds: Array<string>;
|
|
120
|
+
requiredNetPrincipal: bigint;
|
|
121
|
+
maximumEaprNumerator: bigint;
|
|
122
|
+
maximumEaprDenominator: bigint;
|
|
123
|
+
}>;
|
|
124
|
+
}>;
|
|
125
|
+
previewRenegotiationPublication(renegotiationInput: RenegotiationOfferInput, publication: LoanOfferPublicationInput): Promise<{
|
|
126
|
+
__typename?: "LoanOfferCompetitionPreview";
|
|
127
|
+
complete: boolean;
|
|
128
|
+
qualifies: boolean;
|
|
129
|
+
reason?: string | null;
|
|
130
|
+
replacementIds: Array<string>;
|
|
131
|
+
references: Array<{
|
|
132
|
+
__typename?: "LoanOfferCompetitionReference";
|
|
133
|
+
optionId: string;
|
|
134
|
+
sourceIds: Array<string>;
|
|
135
|
+
requiredNetPrincipal: bigint;
|
|
136
|
+
maximumEaprNumerator: bigint;
|
|
137
|
+
maximumEaprDenominator: bigint;
|
|
138
|
+
}>;
|
|
139
|
+
}>;
|
|
140
|
+
saveSingleNftOffer(offerInput: SingleNftSignedOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
106
141
|
aprBps: import("../../generated/graphql").Scalars["BigInt"];
|
|
107
142
|
borrowerAddress: import("../../generated/graphql").Scalars["Address"];
|
|
108
143
|
capacity: import("../../generated/graphql").Scalars["BigInt"];
|
|
@@ -258,7 +293,7 @@ export declare class Api {
|
|
|
258
293
|
message: object;
|
|
259
294
|
};
|
|
260
295
|
}>;
|
|
261
|
-
saveCollectionOffer(offerInput: CollectionSignedOfferInput): Promise<{
|
|
296
|
+
saveCollectionOffer(offerInput: CollectionSignedOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
262
297
|
aprBps: import("../../generated/graphql").Scalars["BigInt"];
|
|
263
298
|
borrowerAddress: import("../../generated/graphql").Scalars["Address"];
|
|
264
299
|
capacity: import("../../generated/graphql").Scalars["BigInt"];
|
|
@@ -308,7 +343,7 @@ export declare class Api {
|
|
|
308
343
|
nftCollateralAddress: `0x${string}`;
|
|
309
344
|
nftCollateralTokenId: bigint;
|
|
310
345
|
}>;
|
|
311
|
-
saveRefinanceOffer(renegotiation: RenegotiationOffer, fallbackOffer?: SingleNftSignedOfferInput): Promise<{
|
|
346
|
+
saveRefinanceOffer(renegotiation: RenegotiationOffer, fallbackOffer?: SingleNftSignedOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
312
347
|
id: string;
|
|
313
348
|
loanId: import("../../generated/graphql").Scalars["String"];
|
|
314
349
|
duration: import("../../generated/graphql").Scalars["BigInt"];
|
|
@@ -13,6 +13,7 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
13
13
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").GenerateCollectionOfferHashMutation>;
|
|
14
14
|
saveCollectionOffer(variables: import("../../generated/graphql").Exact<{
|
|
15
15
|
offer: import("../../generated/graphql").CollectionSignedOfferInput;
|
|
16
|
+
publication?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").LoanOfferPublicationInput>;
|
|
16
17
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").SaveCollectionOfferMutation>;
|
|
17
18
|
hideOffer(variables: import("../../generated/graphql").Exact<{
|
|
18
19
|
contract: import("../../generated/graphql").Scalars["Address"];
|
|
@@ -27,6 +28,7 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
27
28
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").GenerateSingleNftOfferHashMutation>;
|
|
28
29
|
saveSingleNftOffer(variables: import("../../generated/graphql").Exact<{
|
|
29
30
|
offer: import("../../generated/graphql").SingleNftSignedOfferInput;
|
|
31
|
+
publication?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").LoanOfferPublicationInput>;
|
|
30
32
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").SaveSingleNftOfferMutation>;
|
|
31
33
|
generateTraitOfferHash(variables: import("../../generated/graphql").Exact<{
|
|
32
34
|
offerInput: import("../../generated/graphql").TraitOfferInput;
|
|
@@ -77,6 +79,7 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
77
79
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").HideRenegotiationOfferMutation>;
|
|
78
80
|
saveRenegotiationOffer(variables: import("../../generated/graphql").Exact<{
|
|
79
81
|
renegotiation: import("../../generated/graphql").SignedRenegotiationOfferInput;
|
|
82
|
+
publication?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").LoanOfferPublicationInput>;
|
|
80
83
|
fallbackOffer?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").SingleNftSignedOfferInput>;
|
|
81
84
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").SaveRenegotiationOfferMutation>;
|
|
82
85
|
unhideRenegotiationOffer(variables: import("../../generated/graphql").Exact<{
|
|
@@ -120,6 +123,10 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
120
123
|
first?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["Int"]>;
|
|
121
124
|
after?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["String"]>;
|
|
122
125
|
}> | undefined, options?: {} | undefined): Promise<import("../../generated/graphql").ListLoansQuery>;
|
|
126
|
+
nftFlaggedByContractAddressAndTokenId(variables: import("../../generated/graphql").Exact<{
|
|
127
|
+
contractAddress: import("../../generated/graphql").Scalars["Address"];
|
|
128
|
+
tokenId: import("../../generated/graphql").Scalars["BigInt"];
|
|
129
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").NftFlaggedByContractAddressAndTokenIdQuery>;
|
|
123
130
|
nftIdByContractAddressAndTokenId(variables: import("../../generated/graphql").Exact<{
|
|
124
131
|
contractAddress: import("../../generated/graphql").Scalars["Address"];
|
|
125
132
|
tokenId: import("../../generated/graphql").Scalars["BigInt"];
|
|
@@ -161,5 +168,13 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
161
168
|
nftId: import("../../generated/graphql").Scalars["Int"];
|
|
162
169
|
taker: import("../../generated/graphql").Scalars["Address"];
|
|
163
170
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").GetSaleCalldataQuery>;
|
|
171
|
+
previewItemLoanOfferCompetition(variables: import("../../generated/graphql").Exact<{
|
|
172
|
+
offerInput: import("../../generated/graphql").SingleNftOfferInput;
|
|
173
|
+
replacementIds?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["String"]> | import("../../generated/graphql").Scalars["String"]>;
|
|
174
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").PreviewItemLoanOfferCompetitionQuery>;
|
|
175
|
+
previewRenegotiationCompetition(variables: import("../../generated/graphql").Exact<{
|
|
176
|
+
renegotiationInput: import("../../generated/graphql").RenegotiationOfferInput;
|
|
177
|
+
replacementIds?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["String"]> | import("../../generated/graphql").Scalars["String"]>;
|
|
178
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").PreviewRenegotiationCompetitionQuery>;
|
|
164
179
|
};
|
|
165
180
|
export type Sdk = ReturnType<typeof getSdkApollo>;
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -21,3 +21,17 @@ export declare class InterruptedSeaportSendTransactionStepError extends Interrup
|
|
|
21
21
|
signature: Hash;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Thrown before a loan is emitted or refinanced against an NFT the GONDI API flags (for example
|
|
26
|
+
* reported as stolen), or against a wrapper holding one. Lenders' collection offers cannot exclude
|
|
27
|
+
* a flagged NFT on-chain, so the SDK refuses to borrow against it unless the `Gondi` instance was
|
|
28
|
+
* created with `skipFlaggedNftCheck`.
|
|
29
|
+
*/
|
|
30
|
+
export declare class FlaggedNftError extends Error {
|
|
31
|
+
nftCollateralAddress: Address;
|
|
32
|
+
tokenId: bigint;
|
|
33
|
+
constructor({ nftCollateralAddress, tokenId, }: {
|
|
34
|
+
nftCollateralAddress: Address;
|
|
35
|
+
tokenId: bigint;
|
|
36
|
+
});
|
|
37
|
+
}
|