gondi 0.62.1 → 0.63.1

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.
@@ -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 = {
@@ -298,6 +298,8 @@ export declare class Api {
298
298
  tokenId: bigint;
299
299
  orderHash?: import("viem").Hash | null;
300
300
  error?: string | null;
301
+ failureReason?: import("../../generated/graphql").OpenSeaListingFailureReason | null;
302
+ status: import("../../generated/graphql").OpenSeaListingStatus;
301
303
  }>;
302
304
  } | {
303
305
  __typename?: "SignatureRequest";
@@ -310,6 +312,37 @@ export declare class Api {
310
312
  message: object;
311
313
  };
312
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;
325
+ }>;
326
+ } | {
327
+ __typename?: "SignatureRequest";
328
+ key: string;
329
+ typedData: {
330
+ __typename?: "TypedData";
331
+ types: object;
332
+ primaryType: string;
333
+ domain: object;
334
+ message: object;
335
+ };
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
+ }[]>;
313
346
  saveCollectionOffer(offerInput: CollectionSignedOfferInput, publication?: LoanOfferPublicationInput): Promise<{
314
347
  aprBps: import("../../generated/graphql").Scalars["BigInt"];
315
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>;
@@ -176,6 +179,9 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
176
179
  nftId: import("../../generated/graphql").Scalars["Int"];
177
180
  taker: import("../../generated/graphql").Scalars["Address"];
178
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>;
179
185
  listOrders(variables?: import("../../generated/graphql").Exact<{
180
186
  side?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").OrderSide>;
181
187
  collectionIds?: import("../../generated/graphql").InputMaybe<Array<import("../../generated/graphql").Scalars["Int"]> | import("../../generated/graphql").Scalars["Int"]>;
@@ -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
+ }
@@ -23,14 +23,20 @@ export type Scalars = {
23
23
  Float: number;
24
24
  Address: Address;
25
25
  BigInt: bigint;
26
+ /** Date (isoformat) */
26
27
  Date: any;
28
+ /** Date with time (isoformat) */
27
29
  DateTime: Date;
28
30
  Hash: Hash;
29
31
  Hex: Hex;
32
+ /** 64-bit integer as a JSON number. */
30
33
  Int64: any;
34
+ /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf). */
31
35
  JSON: object;
32
36
  Signature: Hex;
37
+ /** Represents a file upload. */
33
38
  Upload: any;
39
+ /** Represents NULL values */
34
40
  Void: any;
35
41
  };
36
42
  export type ActiveOfferNotification = Node & Notification & {
@@ -2665,7 +2671,7 @@ export type LoansData = {
2665
2671
  minPrincipalAmount: Scalars['BigInt'];
2666
2672
  minRemainingTime: Scalars['BigInt'];
2667
2673
  };
2668
- /** This is the definition of a lost source. Lost sources are the lender/s that have lost a loan because of renegotiation or refinance. */
2674
+ /** This is the definition of a lost source. Lost sources are the lender/s that have lost a loan because of renegotiation or refinance. */
2669
2675
  export type LostSource = Node & {
2670
2676
  __typename?: 'LostSource';
2671
2677
  accruedInterest: Scalars['BigInt'];
@@ -2953,7 +2959,7 @@ export type Mutation = {
2953
2959
  generateSingleNftOfferToBeSigned: SingleNftOffer;
2954
2960
  /** This is the first step of the trait loan offer flow: an offer any NFT carrying every one of the traits can borrow against. This step populates some fields of the offer, among them the validator holding the token ids that carry them now. `duration` must be a positive whole number of seconds that represents either a multiple of 30 days or one of the special values of 3, 5, 7, 10, 15, 20 or 45 days, and at most 3650 days; otherwise the call fails with INVALID_OFFER_DURATION_ERROR. Refer to gondi-js examples for more details. */
2955
2961
  generateTraitOfferToBeSigned: TraitOffer;
2956
- /** Hides all loan offers from a user for a given contract address. */
2962
+ /** Hides all loan offers from a user for a given contract address. */
2957
2963
  hideAllOffers: Array<Offer>;
2958
2964
  /** Hides a loan offer. */
2959
2965
  hideOffer: Offer;
@@ -2961,7 +2967,7 @@ export type Mutation = {
2961
2967
  hideOffers: Array<Offer>;
2962
2968
  /** Hides a trade bid. Listings can no longer be hidden: cancelling them on-chain is the only supported way to take one down, so an ask is rejected. */
2963
2969
  hideOrder: Order;
2964
- /** Hides a loan renegotiation offer. */
2970
+ /** Hides a loan renegotiation offer. */
2965
2971
  hideRenegotiation: Renegotiation;
2966
2972
  linkWalletAddress: LinkedWallets;
2967
2973
  markNotificationIdsAsRead?: Maybe<Scalars['Void']>;
@@ -2991,6 +2997,8 @@ export type Mutation = {
2991
2997
  refreshNftMetadata: Nft;
2992
2998
  /** Register a browser's push subscription under the wallet you are signed in with, so your account's alerts can be pushed to it. A subscription registered before moves to the wallet that registers it last, and a wallet keeps the 10 it registered last. Returns true once it is stored. */
2993
2999
  registerPushSubscription: Scalars['Boolean'];
3000
+ /** Signs again the OpenSea listings of the caller's asks that failed (listOpenSeaListingResults: FAILED), on OpenSea's current terms and at the OpenSea price they were first signed at; the GONDI asks are not touched. First call (no signature) returns a SignatureRequest for one Seaport bulk order holding only those listings. Sign the typedData and call again with the signature: it returns RelistOpenSeaListingsResult, each listing PENDING until listOpenSeaListingResults says what became of it. A listing that cannot be signed again (its ask ended, or OpenSea no longer lists the collection) is left out of the typedData and reported as FAILED; when none can be, the first call returns the result at once. Refused as a whole for an order that is not the caller's or has no failed listing, and for a signature that does not match the typedData, which changes with OpenSea's terms: ask for it again. */
3001
+ relistOpenSeaListings: RelistOpenSeaListingsResultSignatureRequest;
2994
3002
  removeLinkedWallets?: Maybe<Scalars['Void']>;
2995
3003
  /** Removes a loan listing from a user. */
2996
3004
  removeListing: Listing;
@@ -3024,7 +3032,7 @@ export type Mutation = {
3024
3032
  showOffer: Offer;
3025
3033
  /** Unhides a trade bid. Listings can no longer be hidden, so an ask is rejected: one hidden before that change stays hidden and is cancelled on-chain rather than brought back. */
3026
3034
  showOrder: Order;
3027
- /** Unhides a loan renegotiation offer. */
3035
+ /** Unhides a loan renegotiation offer. */
3028
3036
  showRenegotiation: Renegotiation;
3029
3037
  signInWithEthereum: Scalars['String'];
3030
3038
  /** Starts proving the caller's X account: returns the x.com page to send them to. X sends them back to the configured redirect URI with `code` and `state` for completeTwitterVerification. */
@@ -3201,6 +3209,9 @@ export type MutationRefreshNftMetadataArgs = {
3201
3209
  export type MutationRegisterPushSubscriptionArgs = {
3202
3210
  subscription: PushSubscriptionInput;
3203
3211
  };
3212
+ export type MutationRelistOpenSeaListingsArgs = {
3213
+ relistInput: RelistOpenSeaListingsInput;
3214
+ };
3204
3215
  export type MutationRemoveLinkedWalletsArgs = {
3205
3216
  linkedWalletsId: Scalars['String'];
3206
3217
  };
@@ -4249,7 +4260,7 @@ export type Query = {
4249
4260
  getCancelOrdersCalldata: Array<CancelAllOrdersCalldata>;
4250
4261
  /** Get some general loan stats about the activities for a collection. */
4251
4262
  getCollectionActivitiesCount: CollectionEventsCountByDayAndCurrency;
4252
- /** Get a collection by its slug. Slugs are unique identifiers for collections. */
4263
+ /** Get a collection by its slug. Slugs are unique identifiers for collections. */
4253
4264
  getCollectionBySlug?: Maybe<Collection>;
4254
4265
  /** Highest active bid targeting a single collection whose trait constraint is satisfied by the supplied trait IDs. Considers single-trait bids whose trait is in the input, multi-trait bids whose trait set is contained in the input, collection-level bids, and native set bids covering every NFT that carries all the input traits. Returns null when traitIds is empty or no matching bid exists. */
4255
4266
  getCollectionHighestBidMatchingTraits?: Maybe<Order>;
@@ -5368,6 +5379,18 @@ export type RefinanceTermsFilter = {
5368
5379
  profitLeft?: InputMaybe<Interval>;
5369
5380
  remainingTime?: InputMaybe<Interval>;
5370
5381
  };
5382
+ export type RelistOpenSeaListingsInput = {
5383
+ /** The caller's GONDI asks whose OpenSea listing failed, 1 to 50. The same ids on both calls. */
5384
+ orderIds: Array<Scalars['Int64']>;
5385
+ /** The caller's signature of the typedData the call without it returned. */
5386
+ signature?: InputMaybe<Scalars['Signature']>;
5387
+ };
5388
+ export type RelistOpenSeaListingsResult = {
5389
+ __typename?: 'RelistOpenSeaListingsResult';
5390
+ /** One entry per order: PENDING once its newly signed listing waits to be posted to OpenSea, FAILED with the error when it could not be signed again. */
5391
+ openSeaListings: Array<OpenSeaListingResult>;
5392
+ };
5393
+ export type RelistOpenSeaListingsResultSignatureRequest = RelistOpenSeaListingsResult | SignatureRequest;
5371
5394
  /** A renegotiation when the loan terms change and the borrower accepted. The difference with refinance is that renegotiation does not mean better terms for the borrower, because of that the borrower needs to accept the renegotiation. Also the renegotiation can be made by the same previous lender.Renegotiation can be top ups. A top up is when someone adds more principal to the loan. */
5372
5395
  export type Renegotiation = Event & Node & {
5373
5396
  __typename?: 'Renegotiation';
@@ -7393,6 +7416,8 @@ export type PublishBulkOrdersMutation = {
7393
7416
  tokenId: bigint;
7394
7417
  orderHash?: Hash | null;
7395
7418
  error?: string | null;
7419
+ failureReason?: OpenSeaListingFailureReason | null;
7420
+ status: OpenSeaListingStatus;
7396
7421
  }>;
7397
7422
  } | {
7398
7423
  __typename?: 'SignatureRequest';
@@ -7583,6 +7608,34 @@ export type PublishSellAndRepayOrderMutation = {
7583
7608
  };
7584
7609
  };
7585
7610
  };
7611
+ export type RelistOpenSeaListingsMutationVariables = Exact<{
7612
+ relistInput: RelistOpenSeaListingsInput;
7613
+ }>;
7614
+ export type RelistOpenSeaListingsMutation = {
7615
+ __typename?: 'Mutation';
7616
+ result: {
7617
+ __typename?: 'RelistOpenSeaListingsResult';
7618
+ openSeaListings: Array<{
7619
+ __typename?: 'OpenSeaListingResult';
7620
+ contractAddress: Address;
7621
+ tokenId: bigint;
7622
+ orderHash?: Hash | null;
7623
+ error?: string | null;
7624
+ failureReason?: OpenSeaListingFailureReason | null;
7625
+ status: OpenSeaListingStatus;
7626
+ }>;
7627
+ } | {
7628
+ __typename?: 'SignatureRequest';
7629
+ key: string;
7630
+ typedData: {
7631
+ __typename?: 'TypedData';
7632
+ types: object;
7633
+ primaryType: string;
7634
+ domain: object;
7635
+ message: object;
7636
+ };
7637
+ };
7638
+ };
7586
7639
  export type ShowOrderMutationVariables = Exact<{
7587
7640
  id: Scalars['Int64'];
7588
7641
  }>;
@@ -8738,6 +8791,21 @@ export type GetSaleCalldataQuery = {
8738
8791
  __typename?: 'Query';
8739
8792
  saleCalldata: Hex;
8740
8793
  };
8794
+ export type ListOpenSeaListingResultsQueryVariables = Exact<{
8795
+ orderIds: Array<Scalars['Int64']> | Scalars['Int64'];
8796
+ }>;
8797
+ export type ListOpenSeaListingResultsQuery = {
8798
+ __typename?: 'Query';
8799
+ result: Array<{
8800
+ __typename?: 'OpenSeaListingResult';
8801
+ contractAddress: Address;
8802
+ tokenId: bigint;
8803
+ orderHash?: Hash | null;
8804
+ error?: string | null;
8805
+ failureReason?: OpenSeaListingFailureReason | null;
8806
+ status: OpenSeaListingStatus;
8807
+ }>;
8808
+ };
8741
8809
  export type ListOrdersQueryVariables = Exact<{
8742
8810
  side?: InputMaybe<OrderSide>;
8743
8811
  collectionIds?: InputMaybe<Array<Scalars['Int']> | Scalars['Int']>;
@@ -10809,7 +10877,7 @@ export type MultipleTraitOrderFieldPolicy = {
10809
10877
  traits?: FieldPolicy<any> | FieldReadFunction<any>;
10810
10878
  updatedDate?: FieldPolicy<any> | FieldReadFunction<any>;
10811
10879
  };
10812
- export type MutationKeySpecifier = ('acceptLinkedWallets' | 'addListingsOfNftsFromUser' | 'addOrUpdateListing' | 'addOrUpdateRenegotiationRequest' | 'addOrUpdateTopUpRequest' | 'cancelTradeOrders' | 'completeTwitterVerification' | 'createBidBudget' | 'createGallery' | 'createTelegramLink' | 'deleteGallery' | 'deleteProfilePicture' | 'disconnectTelegram' | 'disconnectTwitter' | 'editUser' | 'followArtist' | 'followCollection' | 'followCollections' | 'followEdition' | 'followNft' | 'followWallet' | 'generateCollectionOfferToBeSigned' | 'generateRenegotiationOfferToBeSigned' | 'generateSignInNonce' | 'generateSingleNftOfferToBeSigned' | 'generateTraitOfferToBeSigned' | 'hideAllOffers' | 'hideOffer' | 'hideOffers' | 'hideOrder' | 'hideRenegotiation' | 'linkWalletAddress' | 'markNotificationIdsAsRead' | 'markNotificationsAsRead' | 'publishBulkOrdersForNfts' | 'publishBuyNowPayLaterOrder' | 'publishDealOrder' | 'publishGallery' | 'publishOrderForCollection' | 'publishOrderForNft' | 'publishOrderForNftSet' | 'publishOrderForTrait' | 'publishSellAndRepayOrder' | 'recordGalleryVisit' | 'recordItemVisit' | 'refreshNftMetadata' | 'registerPushSubscription' | 'removeLinkedWallets' | 'removeListing' | 'removeListingsOfNftsFromUser' | 'removeRenegotiationRequest' | 'removeTopUpRequest' | 'resendVerificationEmail' | 'saveItemBrowseList' | 'saveRenegotiationSignedOffer' | 'saveSignedCollectionOffer' | 'saveSignedSingleNftOffer' | 'saveSignedTraitOffer' | 'setMinimumOfferAmount' | 'setNftWatchNotifications' | 'setNotificationPreferences' | 'setReferral' | 'setWatchNotifications' | 'showOffer' | 'showOrder' | 'showRenegotiation' | 'signInWithEthereum' | 'startTwitterVerification' | 'unfollowArtist' | 'unfollowCollection' | 'unfollowEdition' | 'unfollowNft' | 'unfollowWallet' | 'unpublishGallery' | 'unregisterPushSubscription' | 'updateGallery' | 'uploadProfilePicture' | 'verifyMailValidationCode' | MutationKeySpecifier)[];
10880
+ export type MutationKeySpecifier = ('acceptLinkedWallets' | 'addListingsOfNftsFromUser' | 'addOrUpdateListing' | 'addOrUpdateRenegotiationRequest' | 'addOrUpdateTopUpRequest' | 'cancelTradeOrders' | 'completeTwitterVerification' | 'createBidBudget' | 'createGallery' | 'createTelegramLink' | 'deleteGallery' | 'deleteProfilePicture' | 'disconnectTelegram' | 'disconnectTwitter' | 'editUser' | 'followArtist' | 'followCollection' | 'followCollections' | 'followEdition' | 'followNft' | 'followWallet' | 'generateCollectionOfferToBeSigned' | 'generateRenegotiationOfferToBeSigned' | 'generateSignInNonce' | 'generateSingleNftOfferToBeSigned' | 'generateTraitOfferToBeSigned' | 'hideAllOffers' | 'hideOffer' | 'hideOffers' | 'hideOrder' | 'hideRenegotiation' | 'linkWalletAddress' | 'markNotificationIdsAsRead' | 'markNotificationsAsRead' | 'publishBulkOrdersForNfts' | 'publishBuyNowPayLaterOrder' | 'publishDealOrder' | 'publishGallery' | 'publishOrderForCollection' | 'publishOrderForNft' | 'publishOrderForNftSet' | 'publishOrderForTrait' | 'publishSellAndRepayOrder' | 'recordGalleryVisit' | 'recordItemVisit' | 'refreshNftMetadata' | 'registerPushSubscription' | 'relistOpenSeaListings' | 'removeLinkedWallets' | 'removeListing' | 'removeListingsOfNftsFromUser' | 'removeRenegotiationRequest' | 'removeTopUpRequest' | 'resendVerificationEmail' | 'saveItemBrowseList' | 'saveRenegotiationSignedOffer' | 'saveSignedCollectionOffer' | 'saveSignedSingleNftOffer' | 'saveSignedTraitOffer' | 'setMinimumOfferAmount' | 'setNftWatchNotifications' | 'setNotificationPreferences' | 'setReferral' | 'setWatchNotifications' | 'showOffer' | 'showOrder' | 'showRenegotiation' | 'signInWithEthereum' | 'startTwitterVerification' | 'unfollowArtist' | 'unfollowCollection' | 'unfollowEdition' | 'unfollowNft' | 'unfollowWallet' | 'unpublishGallery' | 'unregisterPushSubscription' | 'updateGallery' | 'uploadProfilePicture' | 'verifyMailValidationCode' | MutationKeySpecifier)[];
10813
10881
  export type MutationFieldPolicy = {
10814
10882
  acceptLinkedWallets?: FieldPolicy<any> | FieldReadFunction<any>;
10815
10883
  addListingsOfNftsFromUser?: FieldPolicy<any> | FieldReadFunction<any>;
@@ -10858,6 +10926,7 @@ export type MutationFieldPolicy = {
10858
10926
  recordItemVisit?: FieldPolicy<any> | FieldReadFunction<any>;
10859
10927
  refreshNftMetadata?: FieldPolicy<any> | FieldReadFunction<any>;
10860
10928
  registerPushSubscription?: FieldPolicy<any> | FieldReadFunction<any>;
10929
+ relistOpenSeaListings?: FieldPolicy<any> | FieldReadFunction<any>;
10861
10930
  removeLinkedWallets?: FieldPolicy<any> | FieldReadFunction<any>;
10862
10931
  removeListing?: FieldPolicy<any> | FieldReadFunction<any>;
10863
10932
  removeListingsOfNftsFromUser?: FieldPolicy<any> | FieldReadFunction<any>;
@@ -11472,6 +11541,10 @@ export type RealizedProfitDayFieldPolicy = {
11472
11541
  netProfit?: FieldPolicy<any> | FieldReadFunction<any>;
11473
11542
  profit?: FieldPolicy<any> | FieldReadFunction<any>;
11474
11543
  };
11544
+ export type RelistOpenSeaListingsResultKeySpecifier = ('openSeaListings' | RelistOpenSeaListingsResultKeySpecifier)[];
11545
+ export type RelistOpenSeaListingsResultFieldPolicy = {
11546
+ openSeaListings?: FieldPolicy<any> | FieldReadFunction<any>;
11547
+ };
11475
11548
  export type RenegotiationKeySpecifier = ('aprBps' | 'availablePrincipalAmount' | 'createdDate' | 'duration' | 'expirationTime' | 'fallbackOfferId' | 'feeAmount' | 'hidden' | 'id' | 'isAddNewTranche' | 'lenderAddress' | 'lenderName' | 'lenderProfilePictureUrl' | 'loan' | 'loanAddress' | 'loanId' | 'loanReferenceId' | 'nft' | 'offerHash' | 'principalAmount' | 'private' | 'renegotiationId' | 'repayment' | 'requiresLiquidation' | 'signature' | 'signerAddress' | 'status' | 'strictImprovement' | 'timestamp' | RenegotiationKeySpecifier)[];
11476
11549
  export type RenegotiationFieldPolicy = {
11477
11550
  aprBps?: FieldPolicy<any> | FieldReadFunction<any>;
@@ -13303,6 +13376,10 @@ export type StrictTypedTypePolicies = {
13303
13376
  keyFields?: false | RealizedProfitDayKeySpecifier | (() => undefined | RealizedProfitDayKeySpecifier);
13304
13377
  fields?: RealizedProfitDayFieldPolicy;
13305
13378
  };
13379
+ RelistOpenSeaListingsResult?: Omit<TypePolicy, 'fields' | 'keyFields'> & {
13380
+ keyFields?: false | RelistOpenSeaListingsResultKeySpecifier | (() => undefined | RelistOpenSeaListingsResultKeySpecifier);
13381
+ fields?: RelistOpenSeaListingsResultFieldPolicy;
13382
+ };
13306
13383
  Renegotiation?: Omit<TypePolicy, 'fields' | 'keyFields'> & {
13307
13384
  keyFields?: false | RenegotiationKeySpecifier | (() => undefined | RenegotiationKeySpecifier);
13308
13385
  fields?: RenegotiationFieldPolicy;
@@ -13626,6 +13703,7 @@ export declare const PublishOrderForNftDocument: DocumentNode;
13626
13703
  export declare const PublishOrderForNftSetDocument: DocumentNode;
13627
13704
  export declare const PublishOrderForTraitDocument: DocumentNode;
13628
13705
  export declare const PublishSellAndRepayOrderDocument: DocumentNode;
13706
+ export declare const RelistOpenSeaListingsDocument: DocumentNode;
13629
13707
  export declare const ShowOrderDocument: DocumentNode;
13630
13708
  export declare const GenerateRenegotiationOfferHashDocument: DocumentNode;
13631
13709
  export declare const HideRenegotiationOfferDocument: DocumentNode;
@@ -13647,6 +13725,7 @@ export declare const ListOffersDocument: DocumentNode;
13647
13725
  export declare const BuyWithLoanListingDocument: DocumentNode;
13648
13726
  export declare const GetCancelOrdersCalldataDocument: DocumentNode;
13649
13727
  export declare const GetSaleCalldataDocument: DocumentNode;
13728
+ export declare const ListOpenSeaListingResultsDocument: DocumentNode;
13650
13729
  export declare const ListOrdersDocument: DocumentNode;
13651
13730
  export declare const PreviewItemLoanOfferCompetitionDocument: DocumentNode;
13652
13731
  export declare const PreviewRenegotiationCompetitionDocument: DocumentNode;
@@ -13673,6 +13752,7 @@ export declare function getSdk<C, E>(requester: Requester<C, E>): {
13673
13752
  publishOrderForNftSet(variables: PublishOrderForNftSetMutationVariables, options?: C): Promise<PublishOrderForNftSetMutation>;
13674
13753
  publishOrderForTrait(variables: PublishOrderForTraitMutationVariables, options?: C): Promise<PublishOrderForTraitMutation>;
13675
13754
  publishSellAndRepayOrder(variables: PublishSellAndRepayOrderMutationVariables, options?: C): Promise<PublishSellAndRepayOrderMutation>;
13755
+ relistOpenSeaListings(variables: RelistOpenSeaListingsMutationVariables, options?: C): Promise<RelistOpenSeaListingsMutation>;
13676
13756
  showOrder(variables: ShowOrderMutationVariables, options?: C): Promise<ShowOrderMutation>;
13677
13757
  generateRenegotiationOfferHash(variables: GenerateRenegotiationOfferHashMutationVariables, options?: C): Promise<GenerateRenegotiationOfferHashMutation>;
13678
13758
  hideRenegotiationOffer(variables: HideRenegotiationOfferMutationVariables, options?: C): Promise<HideRenegotiationOfferMutation>;
@@ -13694,6 +13774,7 @@ export declare function getSdk<C, E>(requester: Requester<C, E>): {
13694
13774
  buyWithLoanListing(variables: BuyWithLoanListingQueryVariables, options?: C): Promise<BuyWithLoanListingQuery>;
13695
13775
  getCancelOrdersCalldata(variables: GetCancelOrdersCalldataQueryVariables, options?: C): Promise<GetCancelOrdersCalldataQuery>;
13696
13776
  getSaleCalldata(variables: GetSaleCalldataQueryVariables, options?: C): Promise<GetSaleCalldataQuery>;
13777
+ listOpenSeaListingResults(variables: ListOpenSeaListingResultsQueryVariables, options?: C): Promise<ListOpenSeaListingResultsQuery>;
13697
13778
  listOrders(variables?: ListOrdersQueryVariables, options?: C): Promise<ListOrdersQuery>;
13698
13779
  previewItemLoanOfferCompetition(variables: PreviewItemLoanOfferCompetitionQueryVariables, options?: C): Promise<PreviewItemLoanOfferCompetitionQuery>;
13699
13780
  previewRenegotiationCompetition(variables: PreviewRenegotiationCompetitionQueryVariables, options?: C): Promise<PreviewRenegotiationCompetitionQuery>;
@@ -760,9 +760,12 @@ export declare class Gondi {
760
760
  * Publishes `orders` like `makeOrders` and lists each one on OpenSea too, under the same
761
761
  * signature. Public asks on Ethereum only; the owner must have approved OpenSea's conduit for
762
762
  * each collection. A refusal never touches the GONDI ask: `openSeaListings` holds one entry per
763
- * ask, with its `orderHash` once OpenSea took it, or the `error` saying why it did not. An
764
- * order's `openSeaPrice`, at least its `price`, prices its OpenSea listing on its own, so the
765
- * seller can receive there what they do on GONDI after OpenSea's higher fees.
763
+ * ask with its `status`. `PENDING` means the listing waits to be posted to OpenSea: follow it
764
+ * with `openSeaListingResults`. `POSTED` carries its `orderHash`, and `FAILED` the `error`
765
+ * saying why OpenSea did not take it, with a `failureReason` when the caller can act on it:
766
+ * `relistOrdersOnOpenSea` signs a failed listing again. An order's `openSeaPrice`, at least its
767
+ * `price`, prices its OpenSea listing on its own, so the seller can receive there what they do
768
+ * on GONDI after OpenSea's higher fees.
766
769
  */
767
770
  makeOrdersOnOpenSea(orders: SingleNftOrderInput[]): Promise<{
768
771
  __typename?: "BulkNFTOrdersResult";
@@ -794,10 +797,48 @@ export declare class Gondi {
794
797
  tokenId: bigint;
795
798
  orderHash?: Hash | null;
796
799
  error?: string | null;
800
+ failureReason?: import("./generated/graphql").OpenSeaListingFailureReason | null;
801
+ status: import("./generated/graphql").OpenSeaListingStatus;
797
802
  }>;
798
803
  }>;
804
+ /**
805
+ * Signs again the OpenSea listings of the wallet's asks `orderIds` that failed, for example
806
+ * because OpenSea's fees for the collection changed after `makeOrdersOnOpenSea` signed them
807
+ * (`failureReason: TERMS_CHANGED`). The GONDI asks are not touched: same orders, same ids. Each
808
+ * listing is rebuilt on OpenSea's current terms at the OpenSea price it was first signed at,
809
+ * and one signature covers them all.
810
+ *
811
+ * A listing that cannot be signed again, because its ask ended or OpenSea no longer lists the
812
+ * collection, is left out of the signature and returned as `FAILED` with its `error`; when none
813
+ * can be, the wallet is not asked to sign.
814
+ *
815
+ * @param orderIds The ids of the GONDI asks whose OpenSea listing is `FAILED`, 1 to 50.
816
+ * @returns One entry per order: `PENDING` once its newly signed listing waits to be posted to
817
+ * OpenSea, or `FAILED` with the `error`. Follow the pending ones with `openSeaListingResults`.
818
+ * @throws {RelistOnOpenSeaError} When the API refuses the whole call: an order has no failed
819
+ * OpenSea listing (`NOT_FAILED`), or the signature did not match the current listings, usually
820
+ * because the terms changed again while signing (`STALE_SIGNATURE`: call the method again, a
821
+ * bounded number of times). Any other failure, such as the wallet rejecting the signature, is
822
+ * thrown as it is.
823
+ */
824
+ relistOrdersOnOpenSea(orderIds: number[]): Promise<model.OpenSeaListingResult[]>;
825
+ /**
826
+ * What became of the OpenSea listing of each of the wallet's asks among `orderIds`, as signed
827
+ * by `makeOrdersOnOpenSea` or `relistOrdersOnOpenSea`: `PENDING` until it is `POSTED` to
828
+ * OpenSea or `FAILED`, then with its `error` and, when the caller can act on it, its
829
+ * `failureReason`. An order with no OpenSea listing has no entry.
830
+ */
831
+ openSeaListingResults(orderIds: number[]): Promise<model.OpenSeaListingResult[]>;
799
832
  /** Publishes the batch, signing the typed data the API answers with when it asks for it. */
800
833
  private publishBulkOrders;
834
+ /**
835
+ * Publishes `input` until the API answers with one of the `settled` types, answering each step
836
+ * it asks for in between: `onExtraSeaportData` copies refreshed marketplace data into the input,
837
+ * and `sign` answers a signature request, by default writing the wallet's signature of the typed
838
+ * data into the input field the request names. A step asked for twice, or a response that is
839
+ * neither settled nor a step the caller answers, throws instead of publishing again.
840
+ */
841
+ private negotiate;
801
842
  makeDeal(dealInput: DealInput): Promise<{
802
843
  blockchain: import("./generated/graphql").BlockchainEnum;
803
844
  counterOfferForId?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Int"]>;
@@ -2591,6 +2632,9 @@ export declare class Gondi {
2591
2632
  * Lists trade orders — bids and listings — across the marketplaces GONDI indexes, newest first
2592
2633
  * unless `sortBy` says otherwise. Only active orders unless `statuses` is given.
2593
2634
  *
2635
+ * The API answers this read without a session, but like every call on `Gondi` it signs the
2636
+ * wallet in first. The GONDI market maker reads the same data through its own sign-in-free client.
2637
+ *
2594
2638
  * @returns One page of orders, with the cursor of the next one.
2595
2639
  */
2596
2640
  orders({ side, collections, traits, nfts, makers, excludeMakers, currencies, statuses, matchMode, orderTypes, sortBy, limit, cursor, }: model.ListOrdersProps): Promise<{
@@ -2892,6 +2936,9 @@ export declare class Gondi {
2892
2936
  *
2893
2937
  * Looks the collection up by slug, the lookup the API answers fastest.
2894
2938
  *
2939
+ * The API answers this read without a session, but like every call on `Gondi` it signs the
2940
+ * wallet in first. The GONDI market maker reads the same data through its own sign-in-free client.
2941
+ *
2895
2942
  * @throws Error when no collection has `slug`.
2896
2943
  */
2897
2944
  collectionMarket({ slug, currencies }: {
@@ -1,6 +1,7 @@
1
- export { CreateVaultError, FlaggedNftError } from './errors';
1
+ export { CreateVaultError, FlaggedNftError, RelistOnOpenSeaError } from './errors';
2
+ export type { RelistOnOpenSeaErrorReason } from './errors';
2
3
  export { Gondi } from './gondi';
3
- export { CollectionOrderType, LoanStatusType, OfferStatus, OffersSortField, Ordering, OrderMatchMode, OrderSide, OrderSortField, OrderStatusType, MarketplaceEnum, TokenStandardType, } from './generated/graphql';
4
+ export { CollectionOrderType, LoanStatusType, OfferStatus, OffersSortField, OpenSeaListingFailureReason, OpenSeaListingStatus, Ordering, OrderMatchMode, OrderSide, OrderSortField, OrderStatusType, MarketplaceEnum, TokenStandardType, } from './generated/graphql';
4
5
  export type { OnStepChange, Punk721WrapState } from './gondi';
5
6
  export type { CreditPurchaseInput, CreditPurchaseQuote } from './utils/creditPurchase';
6
7
  export type { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote, } from './clients/contracts/CrossCurrencyRenegotiation';
@@ -1,6 +1,6 @@
1
1
  import { Address, Hash } from 'viem';
2
2
  import { Signature } from './blockchain';
3
- import { CollectionOfferInput as ApiCollectionOfferInput, CollectionOrderType, CollectionSignedOfferInput, LoanSortInput, LoanStatusType, MarketplaceEnum, OffersSortInput, OfferStatus, OrderForNft, OrderMatchMode, OrderSide, OrderSortInput, OrderStatusType, RenegotiationOfferInput as ApiRenegotiationInput, SignedRenegotiationOfferInput, SingleNftOfferInput as ApiSingleNftOfferInput, SingleNftSignedOfferInput, TermsFilter, TraitOfferInput as ApiTraitOfferInput, UserFilter } from './generated/graphql';
3
+ import { CollectionOfferInput as ApiCollectionOfferInput, CollectionOrderType, CollectionSignedOfferInput, ListOpenSeaListingResultsQuery, LoanSortInput, LoanStatusType, MarketplaceEnum, OffersSortInput, OfferStatus, OrderForNft, OrderMatchMode, OrderSide, OrderSortInput, OrderStatusType, RenegotiationOfferInput as ApiRenegotiationInput, SignedRenegotiationOfferInput, SingleNftOfferInput as ApiSingleNftOfferInput, SingleNftSignedOfferInput, TermsFilter, TraitOfferInput as ApiTraitOfferInput, UserFilter } from './generated/graphql';
4
4
  import { Optional } from './utils/types';
5
5
  type MaxSeniorRepaymentArg = {
6
6
  maxSeniorRepayment: Exclude<ApiSingleNftOfferInput['maxSeniorRepayment'], null | undefined>;
@@ -91,6 +91,17 @@ export type ListOrdersProps = {
91
91
  limit?: number;
92
92
  cursor?: string | null;
93
93
  };
94
+ /**
95
+ * What became of the OpenSea listing of one ask signed by `makeOrdersOnOpenSea` or
96
+ * `relistOrdersOnOpenSea`, identified by its NFT (`contractAddress` and `tokenId`).
97
+ *
98
+ * `status` is `PENDING` while the listing waits to be posted to OpenSea, `POSTED` once OpenSea
99
+ * took it (`orderHash` is then its OpenSea order hash), and `FAILED` when it did not, with the
100
+ * text to show in `error`. `failureReason` is set for a failure the caller can act on:
101
+ * `TERMS_CHANGED` when OpenSea refused the listing because the collection's fees changed after
102
+ * it was signed, which `relistOrdersOnOpenSea` signs again.
103
+ */
104
+ export type OpenSeaListingResult = ListOpenSeaListingResultsQuery['result'][number];
94
105
  export type NftStandard = 'ERC721' | 'ERC1155';
95
106
  export type TransferNftStandard = NftStandard | 'CryptoPunks' | 'OldERC721';
96
107
  export {};