gondi 0.43.1 → 0.44.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.
@@ -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"]>;
@@ -120,6 +120,10 @@ export declare function getSdkApollo<C>(client: ApolloClient<C>, onStepChange?:
120
120
  first?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["Int"]>;
121
121
  after?: import("../../generated/graphql").InputMaybe<import("../../generated/graphql").Scalars["String"]>;
122
122
  }> | undefined, options?: {} | undefined): Promise<import("../../generated/graphql").ListLoansQuery>;
123
+ nftFlaggedByContractAddressAndTokenId(variables: import("../../generated/graphql").Exact<{
124
+ contractAddress: import("../../generated/graphql").Scalars["Address"];
125
+ tokenId: import("../../generated/graphql").Scalars["BigInt"];
126
+ }>, options?: {} | undefined): Promise<import("../../generated/graphql").NftFlaggedByContractAddressAndTokenIdQuery>;
123
127
  nftIdByContractAddressAndTokenId(variables: import("../../generated/graphql").Exact<{
124
128
  contractAddress: import("../../generated/graphql").Scalars["Address"];
125
129
  tokenId: import("../../generated/graphql").Scalars["BigInt"];
@@ -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
+ }
@@ -6362,6 +6362,23 @@ export type ListLoansQuery = {
6362
6362
  }>;
6363
6363
  };
6364
6364
  };
6365
+ export type NftFlaggedByContractAddressAndTokenIdQueryVariables = Exact<{
6366
+ contractAddress: Scalars['Address'];
6367
+ tokenId: Scalars['BigInt'];
6368
+ }>;
6369
+ export type NftFlaggedByContractAddressAndTokenIdQuery = {
6370
+ __typename?: 'Query';
6371
+ nft?: {
6372
+ __typename?: 'NFT';
6373
+ id: string;
6374
+ isFlagged?: boolean | null;
6375
+ wrapsNfts?: Array<{
6376
+ __typename?: 'NFT';
6377
+ id: string;
6378
+ isFlagged?: boolean | null;
6379
+ }> | null;
6380
+ } | null;
6381
+ };
6365
6382
  export type NftIdByContractAddressAndTokenIdQueryVariables = Exact<{
6366
6383
  contractAddress: Scalars['Address'];
6367
6384
  tokenId: Scalars['BigInt'];
@@ -10745,6 +10762,7 @@ export declare const CollectionIdBySlugDocument: DocumentNode;
10745
10762
  export declare const CollectionStepsByIdDocument: DocumentNode;
10746
10763
  export declare const ListListingsDocument: DocumentNode;
10747
10764
  export declare const ListLoansDocument: DocumentNode;
10765
+ export declare const NftFlaggedByContractAddressAndTokenIdDocument: DocumentNode;
10748
10766
  export declare const NftIdByContractAddressAndTokenIdDocument: DocumentNode;
10749
10767
  export declare const NftIdBySlugTokenIdDocument: DocumentNode;
10750
10768
  export declare const OwnedNftsDocument: DocumentNode;
@@ -10786,6 +10804,7 @@ export declare function getSdk<C, E>(requester: Requester<C, E>): {
10786
10804
  collectionStepsById(variables: CollectionStepsByIdQueryVariables, options?: C): Promise<CollectionStepsByIdQuery>;
10787
10805
  listListings(variables?: ListListingsQueryVariables, options?: C): Promise<ListListingsQuery>;
10788
10806
  listLoans(variables?: ListLoansQueryVariables, options?: C): Promise<ListLoansQuery>;
10807
+ nftFlaggedByContractAddressAndTokenId(variables: NftFlaggedByContractAddressAndTokenIdQueryVariables, options?: C): Promise<NftFlaggedByContractAddressAndTokenIdQuery>;
10789
10808
  nftIdByContractAddressAndTokenId(variables: NftIdByContractAddressAndTokenIdQueryVariables, options?: C): Promise<NftIdByContractAddressAndTokenIdQuery>;
10790
10809
  nftIdBySlugTokenId(variables: NftIdBySlugTokenIdQueryVariables, options?: C): Promise<NftIdBySlugTokenIdQuery>;
10791
10810
  ownedNfts(variables?: OwnedNftsQueryVariables, options?: C): Promise<OwnedNftsQuery>;
@@ -42,6 +42,14 @@ interface GondiProps {
42
42
  publicClient?: GondiPublicClient;
43
43
  apiClient?: ApiProps['apiClient'];
44
44
  onStepChange?: OnStepChange;
45
+ /**
46
+ * Skips the flagged-NFT lookup `emitLoan`, `revokeDelegationsAndEmitLoan`,
47
+ * `refinanceFromOffers`, `efficientRefinanceFromOffers` and
48
+ * `crossCurrencyRenegotiation` run before
49
+ * sending, saving an API call. Only for callers that already keep flagged
50
+ * NFTs out of those flows themselves, such as the GONDI web app.
51
+ */
52
+ skipFlaggedNftCheck?: boolean;
45
53
  }
46
54
  type Step = {
47
55
  type: 'signature';
@@ -65,7 +73,8 @@ export declare class Gondi {
65
73
  account: Account;
66
74
  bcClient: GondiPublicClient;
67
75
  apiClient: Api;
68
- constructor({ wallet, publicClient, apiClient, onStepChange }: GondiProps);
76
+ skipFlaggedNftCheck: boolean;
77
+ constructor({ wallet, publicClient, apiClient, onStepChange, skipFlaggedNftCheck, }: GondiProps);
69
78
  static create(props: GondiProps & {
70
79
  onStepChange: OnStepChange;
71
80
  }): Gondi;
@@ -875,6 +884,12 @@ export declare class Gondi {
875
884
  }>;
876
885
  }>;
877
886
  offerExecutionFromOffers(offers: OfferFromExecutionOffer[], amounts?: bigint[]): EmitLoanArgs['offerExecution'];
887
+ /**
888
+ * Throws `FlaggedNftError` when the API flags the collateral NFT or an NFT it wraps.
889
+ * An NFT the API does not know throws `NOT_FOUND`, and an API that does not answer
890
+ * throws its own error: a loan is only sent once the API confirms the NFT is not flagged.
891
+ */
892
+ private assertNftNotFlagged;
878
893
  emitLoan(args: EmitLoanArgs): Promise<{
879
894
  txHash: `0x${string}`;
880
895
  waitTxInBlock: () => Promise<{
@@ -1,3 +1,4 @@
1
+ export { FlaggedNftError } from './errors';
1
2
  export { Gondi } from './gondi';
2
3
  export { LoanStatusType, OfferStatus, OffersSortField, Ordering, MarketplaceEnum, TokenStandardType, } from './generated/graphql';
3
4
  export type { OnStepChange } from './gondi';