gondi 0.62.0 → 0.63.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 +221 -68
- package/dist/index.mjs.map +3 -3
- package/dist/src/clients/api/index.d.ts +40 -6
- package/dist/src/clients/api/sdk.d.ts +12 -5
- package/dist/src/errors.d.ts +36 -0
- package/dist/src/generated/graphql/index.d.ts +156 -15
- package/dist/src/gondi.d.ts +52 -5
- package/dist/src/index.d.ts +3 -2
- package/dist/src/model.d.ts +12 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
|
2
2
|
import { Address } from 'viem';
|
|
3
3
|
import { getSdkApollo } from '../../clients/api/sdk';
|
|
4
4
|
import { Wallet } from '../../clients/contracts';
|
|
5
|
-
import { BnplOrderInput, BulkNftOrdersInput, CollectionOrderInput, CollectionSignedOfferInput, DealInput, ListListingsQueryVariables, ListLoansQueryVariables, ListOffersQueryVariables, ListOrdersQueryVariables, LoanOfferPublicationInput, NftOrderInput, NftSetOrderInput, RenegotiationOfferInput, SingleNftOfferInput, SingleNftOrderInput, SingleNftSignedOfferInput, TraitOrderInput, TraitSignedOfferInput } from '../../generated/graphql';
|
|
5
|
+
import { BnplOrderInput, BulkNftOrdersInput, CollectionOrderInput, CollectionSignedOfferInput, DealInput, ListListingsQueryVariables, ListLoansQueryVariables, ListOffersQueryVariables, ListOpenSeaListingResultsQueryVariables, ListOrdersQueryVariables, LoanOfferPublicationInput, NftOrderInput, NftSetOrderInput, RelistOpenSeaListingsInput, RenegotiationOfferInput, SingleNftOfferInput, SingleNftOrderInput, SingleNftSignedOfferInput, TraitOrderInput, TraitSignedOfferInput } from '../../generated/graphql';
|
|
6
6
|
import { OnStepChange } from '../../gondi';
|
|
7
7
|
import { RenegotiationOffer } from '../../model';
|
|
8
8
|
export type Props = {
|
|
@@ -66,12 +66,13 @@ export declare class Api {
|
|
|
66
66
|
unlistNft: (variables: import("../../generated/graphql").Exact<{
|
|
67
67
|
nftId: import("../../generated/graphql").Scalars["Int"];
|
|
68
68
|
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").UnlistNftMutation>;
|
|
69
|
-
ownedNfts: (variables
|
|
69
|
+
ownedNfts: (variables: import("../../generated/graphql").Exact<{
|
|
70
|
+
owner: import("../../generated/graphql").Scalars["Address"];
|
|
70
71
|
after?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["String"]>;
|
|
71
|
-
includeInLoans
|
|
72
|
-
includeInStash
|
|
73
|
-
standards
|
|
74
|
-
}
|
|
72
|
+
includeInLoans: import("../../generated/graphql").Scalars["Boolean"];
|
|
73
|
+
includeInStash: import("../../generated/graphql").Scalars["Boolean"];
|
|
74
|
+
standards: Array<import("../../generated/graphql").TokenStandardType> | import("../../generated/graphql").TokenStandardType;
|
|
75
|
+
}>, options?: {} | undefined) => Promise<import("../../generated/graphql").OwnedNftsQuery>;
|
|
75
76
|
hideOffer: (variables: import("../../generated/graphql").Exact<{
|
|
76
77
|
contract: import("../../generated/graphql").Scalars["Address"];
|
|
77
78
|
id: import("../../generated/graphql").Scalars["String"];
|
|
@@ -297,6 +298,30 @@ export declare class Api {
|
|
|
297
298
|
tokenId: bigint;
|
|
298
299
|
orderHash?: import("viem").Hash | null;
|
|
299
300
|
error?: string | null;
|
|
301
|
+
failureReason?: import("../../generated/graphql").OpenSeaListingFailureReason | null;
|
|
302
|
+
status: import("../../generated/graphql").OpenSeaListingStatus;
|
|
303
|
+
}>;
|
|
304
|
+
} | {
|
|
305
|
+
__typename?: "SignatureRequest";
|
|
306
|
+
key: string;
|
|
307
|
+
typedData: {
|
|
308
|
+
__typename?: "TypedData";
|
|
309
|
+
types: object;
|
|
310
|
+
primaryType: string;
|
|
311
|
+
domain: object;
|
|
312
|
+
message: object;
|
|
313
|
+
};
|
|
314
|
+
}>;
|
|
315
|
+
relistOpenSeaListings(relistInput: RelistOpenSeaListingsInput): Promise<{
|
|
316
|
+
__typename?: "RelistOpenSeaListingsResult";
|
|
317
|
+
openSeaListings: Array<{
|
|
318
|
+
__typename?: "OpenSeaListingResult";
|
|
319
|
+
contractAddress: Address;
|
|
320
|
+
tokenId: bigint;
|
|
321
|
+
orderHash?: import("viem").Hash | null;
|
|
322
|
+
error?: string | null;
|
|
323
|
+
failureReason?: import("../../generated/graphql").OpenSeaListingFailureReason | null;
|
|
324
|
+
status: import("../../generated/graphql").OpenSeaListingStatus;
|
|
300
325
|
}>;
|
|
301
326
|
} | {
|
|
302
327
|
__typename?: "SignatureRequest";
|
|
@@ -309,6 +334,15 @@ export declare class Api {
|
|
|
309
334
|
message: object;
|
|
310
335
|
};
|
|
311
336
|
}>;
|
|
337
|
+
listOpenSeaListingResults(variables: ListOpenSeaListingResultsQueryVariables): Promise<{
|
|
338
|
+
__typename?: "OpenSeaListingResult";
|
|
339
|
+
contractAddress: Address;
|
|
340
|
+
tokenId: bigint;
|
|
341
|
+
orderHash?: import("viem").Hash | null;
|
|
342
|
+
error?: string | null;
|
|
343
|
+
failureReason?: import("../../generated/graphql").OpenSeaListingFailureReason | null;
|
|
344
|
+
status: import("../../generated/graphql").OpenSeaListingStatus;
|
|
345
|
+
}[]>;
|
|
312
346
|
saveCollectionOffer(offerInput: CollectionSignedOfferInput, publication?: LoanOfferPublicationInput): Promise<{
|
|
313
347
|
aprBps: import("../../generated/graphql").Scalars["BigInt"];
|
|
314
348
|
borrowerAddress: import("../../generated/graphql").Scalars["Address"];
|
|
@@ -70,6 +70,9 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
70
70
|
publishSellAndRepayOrder(variables: import("../../generated/graphql").Exact<{
|
|
71
71
|
orderInput: import("../../generated/graphql").NftOrderInput;
|
|
72
72
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").PublishSellAndRepayOrderMutation>;
|
|
73
|
+
relistOpenSeaListings(variables: import("../../generated/graphql").Exact<{
|
|
74
|
+
relistInput: import("../../generated/graphql").RelistOpenSeaListingsInput;
|
|
75
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").RelistOpenSeaListingsMutation>;
|
|
73
76
|
showOrder(variables: import("../../generated/graphql").Exact<{
|
|
74
77
|
id: import("../../generated/graphql").Scalars["Int64"];
|
|
75
78
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").ShowOrderMutation>;
|
|
@@ -142,12 +145,13 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
142
145
|
slug: import("../../generated/graphql").Scalars["String"];
|
|
143
146
|
tokenId: import("../../generated/graphql").Scalars["BigInt"];
|
|
144
147
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").NftIdBySlugTokenIdQuery>;
|
|
145
|
-
ownedNfts(variables
|
|
148
|
+
ownedNfts(variables: import("../../generated/graphql").Exact<{
|
|
149
|
+
owner: import("../../generated/graphql").Scalars["Address"];
|
|
146
150
|
after?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["String"]>;
|
|
147
|
-
includeInLoans
|
|
148
|
-
includeInStash
|
|
149
|
-
standards
|
|
150
|
-
}
|
|
151
|
+
includeInLoans: import("../../generated/graphql").Scalars["Boolean"];
|
|
152
|
+
includeInStash: import("../../generated/graphql").Scalars["Boolean"];
|
|
153
|
+
standards: Array<import("../../generated/graphql").TokenStandardType> | import("../../generated/graphql").TokenStandardType;
|
|
154
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").OwnedNftsQuery>;
|
|
151
155
|
listOffers(variables: import("../../generated/graphql").Exact<{
|
|
152
156
|
borrowerAddress?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["String"]>;
|
|
153
157
|
lenders?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["String"]> | import("../../generated/graphql").Scalars["String"]>;
|
|
@@ -175,6 +179,9 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
|
|
|
175
179
|
nftId: import("../../generated/graphql").Scalars["Int"];
|
|
176
180
|
taker: import("../../generated/graphql").Scalars["Address"];
|
|
177
181
|
}>, options?: {} | undefined): Promise<import("../../generated/graphql").GetSaleCalldataQuery>;
|
|
182
|
+
listOpenSeaListingResults(variables: import("../../generated/graphql").Exact<{
|
|
183
|
+
orderIds: Array<import("../../generated/graphql").Scalars["Int64"]> | import("../../generated/graphql").Scalars["Int64"];
|
|
184
|
+
}>, options?: {} | undefined): Promise<import("../../generated/graphql").ListOpenSeaListingResultsQuery>;
|
|
178
185
|
listOrders(variables?: import("../../generated/graphql").Exact<{
|
|
179
186
|
side?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").OrderSide>;
|
|
180
187
|
collectionIds?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["Int"]> | import("../../generated/graphql").Scalars["Int"]>;
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -28,3 +28,39 @@ export declare class FlaggedNftError extends Error {
|
|
|
28
28
|
tokenId: bigint;
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Why `relistOrdersOnOpenSea` was refused as a whole:
|
|
33
|
+
*
|
|
34
|
+
* - `NOT_FAILED`: some orders have no failed OpenSea listing to sign again. They are not the
|
|
35
|
+
* wallet's, their listing is still waiting or was posted, or it failed more than a few days ago.
|
|
36
|
+
* Read the current state with `openSeaListingResults` and retry without them.
|
|
37
|
+
* - `STALE_SIGNATURE`: the signature did not match the listings the API builds now, usually
|
|
38
|
+
* because OpenSea's terms changed between the signature request and the signature. Call
|
|
39
|
+
* `relistOrdersOnOpenSea` again to sign the current ones, a bounded number of times: a wallet
|
|
40
|
+
* whose signature the API cannot verify gets this reason on every attempt.
|
|
41
|
+
*/
|
|
42
|
+
export type RelistOnOpenSeaErrorReason = 'NOT_FAILED' | 'STALE_SIGNATURE';
|
|
43
|
+
/**
|
|
44
|
+
* Thrown by `relistOrdersOnOpenSea` when the GONDI API refuses the whole call for a reason the
|
|
45
|
+
* caller can act on, named by `reason`. Nothing was listed again and no GONDI ask changed.
|
|
46
|
+
* `orderIds` holds the refused orders for `NOT_FAILED`, and is empty otherwise. `cause` is the
|
|
47
|
+
* API's own error.
|
|
48
|
+
*/
|
|
49
|
+
export declare class RelistOnOpenSeaError extends Error {
|
|
50
|
+
reason: RelistOnOpenSeaErrorReason;
|
|
51
|
+
orderIds: number[];
|
|
52
|
+
constructor({ reason, orderIds, cause, }: {
|
|
53
|
+
reason: RelistOnOpenSeaErrorReason;
|
|
54
|
+
orderIds?: number[];
|
|
55
|
+
cause: unknown;
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* The typed error for a refusal of the re-list mutation, or `error` itself when it is anything
|
|
59
|
+
* else.
|
|
60
|
+
*
|
|
61
|
+
* IMPLEMENTATION NOTE: the GONDI API reports a refusal as a GraphQL error carrying only a
|
|
62
|
+
* message, which the API client rethrows with that message in its own. So a refusal is
|
|
63
|
+
* recognised by its wording, and one the API words differently is rethrown unchanged.
|
|
64
|
+
*/
|
|
65
|
+
static from(error: unknown): unknown;
|
|
66
|
+
}
|