gondi 0.50.0 → 0.52.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.
@@ -2,10 +2,10 @@ import { OperationVariables } from '@apollo/client/core/index.js';
2
2
  import { Maybe } from 'graphql/jsutils/Maybe';
3
3
  import { Account, Address, Hash, Hex, TransactionReceipt } from 'viem';
4
4
  import { Auction } from './blockchain';
5
- import { Api, Props as ApiProps } from './clients/api';
5
+ import { Api, OrderInput, 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, LoanOfferPublicationInput, MarketplaceEnum, NftOrderInput, NftSetOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
8
+ import { DealInput, GenerateCollectionOfferHashMutation, LoanOfferPublicationInput, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType } from './generated/graphql';
9
9
  import * as model from './model';
10
10
  import { NftStandard } from './model';
11
11
  import { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
@@ -286,10 +286,12 @@ export declare class Gondi {
286
286
  *
287
287
  * The input picks the kind: `tokenId` for one NFT, `traitIds` for a trait bid,
288
288
  * `nftIds` for a set bid that fills with any of the listed NFTs of
289
- * `collectionId` (2 to 1,000), and `collectionId` alone for a collection bid.
289
+ * `collectionId` (2 to 1,000), `condition.anyTraitIds` for an OR trait bid that
290
+ * fills with any NFT of `collectionId` carrying one of those values of a trait
291
+ * key, and `collectionId` alone for a collection bid.
290
292
  * A trait, set or collection bid fills up to `maxExecutions` times.
291
293
  */
292
- makeOrder(orderInput: SingleNftOrderInput | CollectionOrderInput | TraitOrderInput | NftSetOrderInput): Promise<{
294
+ makeOrder(orderInput: OrderInput): Promise<{
293
295
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
294
296
  contractAddress: import("./generated/graphql").Scalars["Address"];
295
297
  currencyAddress: import("./generated/graphql").Scalars["Address"];
@@ -343,12 +345,13 @@ export declare class Gondi {
343
345
  } | {
344
346
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
345
347
  collectionId: import("./generated/graphql").Scalars["Int"];
348
+ condition?: import("./generated/graphql").InputMaybe<import("./generated/graphql").NftSetConditionInput>;
346
349
  currencyAddress: import("./generated/graphql").Scalars["Address"];
347
350
  expirationTime: import("./generated/graphql").Scalars["BigInt"];
348
351
  fees?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").OrderFee>>;
349
352
  isAsk?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]>;
350
353
  maxExecutions?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
351
- nftIds: Array<import("./generated/graphql").Scalars["Int"]>;
354
+ nftIds?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").Scalars["Int"]>>;
352
355
  price?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
353
356
  signature: import("./generated/graphql").InputMaybe<`0x${string}`>;
354
357
  startTime: import("./generated/graphql").Scalars["BigInt"];
@@ -412,12 +415,13 @@ export declare class Gondi {
412
415
  } | {
413
416
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
414
417
  collectionId: import("./generated/graphql").Scalars["Int"];
418
+ condition?: import("./generated/graphql").InputMaybe<import("./generated/graphql").NftSetConditionInput>;
415
419
  currencyAddress: import("./generated/graphql").Scalars["Address"];
416
420
  expirationTime: import("./generated/graphql").Scalars["BigInt"];
417
421
  fees?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").OrderFee>>;
418
422
  isAsk?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]>;
419
423
  maxExecutions?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
420
- nftIds: Array<import("./generated/graphql").Scalars["Int"]>;
424
+ nftIds?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").Scalars["Int"]>>;
421
425
  price?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
422
426
  signature: import("./generated/graphql").InputMaybe<`0x${string}`>;
423
427
  startTime: import("./generated/graphql").Scalars["BigInt"];
@@ -481,12 +485,13 @@ export declare class Gondi {
481
485
  } | {
482
486
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
483
487
  collectionId: import("./generated/graphql").Scalars["Int"];
488
+ condition?: import("./generated/graphql").InputMaybe<import("./generated/graphql").NftSetConditionInput>;
484
489
  currencyAddress: import("./generated/graphql").Scalars["Address"];
485
490
  expirationTime: import("./generated/graphql").Scalars["BigInt"];
486
491
  fees?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").OrderFee>>;
487
492
  isAsk?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]>;
488
493
  maxExecutions?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
489
- nftIds: Array<import("./generated/graphql").Scalars["Int"]>;
494
+ nftIds?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").Scalars["Int"]>>;
490
495
  price?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
491
496
  signature: import("./generated/graphql").InputMaybe<`0x${string}`>;
492
497
  startTime: import("./generated/graphql").Scalars["BigInt"];
@@ -550,12 +555,13 @@ export declare class Gondi {
550
555
  } | {
551
556
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
552
557
  collectionId: import("./generated/graphql").Scalars["Int"];
558
+ condition?: import("./generated/graphql").InputMaybe<import("./generated/graphql").NftSetConditionInput>;
553
559
  currencyAddress: import("./generated/graphql").Scalars["Address"];
554
560
  expirationTime: import("./generated/graphql").Scalars["BigInt"];
555
561
  fees?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").OrderFee>>;
556
562
  isAsk?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]>;
557
563
  maxExecutions?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
558
- nftIds: Array<import("./generated/graphql").Scalars["Int"]>;
564
+ nftIds?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").Scalars["Int"]>>;
559
565
  price?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
560
566
  signature: import("./generated/graphql").InputMaybe<`0x${string}`>;
561
567
  startTime: import("./generated/graphql").Scalars["BigInt"];
@@ -619,12 +625,13 @@ export declare class Gondi {
619
625
  } | {
620
626
  amount?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
621
627
  collectionId: import("./generated/graphql").Scalars["Int"];
628
+ condition?: import("./generated/graphql").InputMaybe<import("./generated/graphql").NftSetConditionInput>;
622
629
  currencyAddress: import("./generated/graphql").Scalars["Address"];
623
630
  expirationTime: import("./generated/graphql").Scalars["BigInt"];
624
631
  fees?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").OrderFee>>;
625
632
  isAsk?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]>;
626
633
  maxExecutions?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
627
- nftIds: Array<import("./generated/graphql").Scalars["Int"]>;
634
+ nftIds?: import("./generated/graphql").InputMaybe<Array<import("./generated/graphql").Scalars["Int"]>>;
628
635
  price?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["BigInt"]>;
629
636
  signature: import("./generated/graphql").InputMaybe<`0x${string}`>;
630
637
  startTime: import("./generated/graphql").Scalars["BigInt"];
@@ -3894,6 +3901,45 @@ export declare class Gondi {
3894
3901
  txHash: `0x${string}`;
3895
3902
  waitMined: () => Promise<TransactionReceipt>;
3896
3903
  }>;
3904
+ /**
3905
+ * Where the wallet's CryptoPunk `tokenId` stands on its way into CryptoPunks 721, read from
3906
+ * chain: `'wallet'` while the wallet holds it naked, `'stash'` once it sits in the wallet's
3907
+ * Stash waiting for {@link wrapPunk721}, `'wrapped'` once the wallet holds its 721 token, and
3908
+ * `'other'` when none of these holds.
3909
+ *
3910
+ * IMPLEMENTATION NOTE: the punks market's `punkIndexToAddress` names the punk's holder and
3911
+ * `CryptoPunks721.punkProxyForUser` the wallet's Stash, deployed or not yet; a wrapped punk is
3912
+ * held by the 721 contract, which mints its token to the wallet
3913
+ * (https://721.cryptopunks.app, https://etherscan.io/address/0x000000000000003607fce1ac9e043a86675c5c2f#code).
3914
+ */
3915
+ punk721WrapState({ tokenId }: {
3916
+ tokenId: bigint;
3917
+ }): Promise<Punk721WrapState>;
3918
+ /**
3919
+ * Moves the wallet's naked CryptoPunk `tokenId` into its Stash, the first of the two
3920
+ * transactions that wrap it into CryptoPunks 721. Refuses a punk the wallet does not hold.
3921
+ */
3922
+ transferPunkToStash721({ tokenId }: {
3923
+ tokenId: bigint;
3924
+ }): Promise<{
3925
+ txHash: `0x${string}`;
3926
+ waitTxInBlock: () => Promise<TransactionReceipt>;
3927
+ }>;
3928
+ /**
3929
+ * Wraps the CryptoPunk `tokenId` waiting in the wallet's Stash into CryptoPunks 721, minting
3930
+ * its 721 token to the wallet. Refuses a punk that is not in the Stash: move it there first
3931
+ * with {@link transferPunkToStash721}.
3932
+ */
3933
+ wrapPunk721({ tokenId }: {
3934
+ tokenId: bigint;
3935
+ }): Promise<{
3936
+ txHash: `0x${string}`;
3937
+ waitTxInBlock: () => Promise<TransactionReceipt>;
3938
+ }>;
3939
+ /** The punk's wrap state with the addresses the wrap transactions need. */
3940
+ private _punk721Holding;
3941
+ /** A sent transaction whose `waitTxInBlock` resolves with its receipt once it succeeds. */
3942
+ private _minedTransaction;
3897
3943
  buyWithSellAndRepay({ repaymentCalldata, purchaseBundlerAddress, mslContractAddress, price, swapData, }: {
3898
3944
  repaymentCalldata: Hex;
3899
3945
  purchaseBundlerAddress?: Address;
@@ -4022,6 +4068,8 @@ export type BurnAndWithdrawArgs = {
4022
4068
  erc1155Collections?: Address[];
4023
4069
  erc1155TokenIds?: bigint[];
4024
4070
  };
4071
+ /** Where a CryptoPunk stands on its way into CryptoPunks 721; see `Gondi.punk721WrapState`. */
4072
+ export type Punk721WrapState = 'wallet' | 'stash' | 'wrapped' | 'other';
4025
4073
  type wrapOldERC721Args = {
4026
4074
  collection: {
4027
4075
  contractData: {
@@ -1,7 +1,7 @@
1
1
  export { FlaggedNftError } from './errors';
2
2
  export { Gondi } from './gondi';
3
3
  export { LoanStatusType, OfferStatus, OffersSortField, Ordering, MarketplaceEnum, TokenStandardType, } from './generated/graphql';
4
- export type { OnStepChange } from './gondi';
4
+ export type { OnStepChange, Punk721WrapState } from './gondi';
5
5
  export type { CreditPurchaseInput, CreditPurchaseQuote } from './utils/creditPurchase';
6
6
  export type { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote, } from './clients/contracts/CrossCurrencyRenegotiation';
7
7
  export type * as Types from './model';
@@ -25,6 +25,22 @@ export type CreditPurchaseQuote = Readonly<{
25
25
  loanSwapData: Hex;
26
26
  callbackData: Hex;
27
27
  }>;
28
+ /** Decodes the purchase bundler's `executionInfo` callback carried by an execution or a seller repayment. */
29
+ export declare const decodePurchaseCallback: (data: Hex) => {
30
+ reservoirExecutionInfo: {
31
+ module: `0x${string}`;
32
+ data: `0x${string}`;
33
+ value: bigint;
34
+ };
35
+ contractMustBeOwner: boolean;
36
+ purchaseCurrency: `0x${string}`;
37
+ amount: bigint;
38
+ swapData: `0x${string}`;
39
+ swapValue: bigint;
40
+ maxSlippage: bigint;
41
+ };
42
+ /** The callback's purchase currency, with every native spelling (including the ETH sentinel) as `zeroAddress`. */
43
+ export declare const callbackPurchaseCurrency: (callback: ReturnType<typeof decodePurchaseCallback>) => Address;
28
44
  /** Compares every ABI field against the confirmed terms before signing or submitting an API execution. */
29
45
  export declare const assertCreditPurchaseExecution: (expected: ExecutionDataV7, received: unknown) => void;
30
46
  /** Rechecks activation, zero additional taxes and router funding before buyer signing. */