gondi 0.44.0 → 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.
@@ -5,7 +5,7 @@ import { Auction } from './blockchain';
5
5
  import { Api, 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, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
8
+ import { CollectionOrderInput, DealInput, GenerateCollectionOfferHashMutation, LoanOfferPublicationInput, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
9
9
  import * as model from './model';
10
10
  import { NftStandard } from './model';
11
11
  import { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
@@ -68,6 +68,13 @@ type Step = {
68
68
  };
69
69
  export type OnStepChange = (step: Step) => Promise<void>;
70
70
  export declare class Gondi {
71
+ private pendingSingleNftPublications;
72
+ private pendingCollectionPublications;
73
+ private pendingRenegotiationPublications;
74
+ /** Retains bounded signed payloads while their API save is pending. */
75
+ private rememberPublication;
76
+ /** Binds signed terms and contract; excludes unsigned predecessors. */
77
+ private publicationKey;
71
78
  contracts: Contracts;
72
79
  wallet: Wallet;
73
80
  account: Account;
@@ -97,7 +104,13 @@ export declare class Gondi {
97
104
  nonce: string;
98
105
  issuedAt?: string;
99
106
  }) => string;
100
- makeSingleNftOffer(offer: model.SingleNftOfferInput): Promise<{
107
+ /**
108
+ * Signs and saves an item offer.
109
+ * @param publication Optional unsigned admission metadata. Previews before signing
110
+ * and throws the backend rejection reason. Identical retries after failed saves
111
+ * reuse the signature; a successful save clears that pending signature.
112
+ */
113
+ makeSingleNftOffer(offer: model.SingleNftOfferInput, publication?: LoanOfferPublicationInput): Promise<{
101
114
  aprBps: import("./generated/graphql").Scalars["BigInt"];
102
115
  borrowerAddress: import("./generated/graphql").Scalars["Address"];
103
116
  capacity: import("./generated/graphql").Scalars["BigInt"];
@@ -123,10 +136,16 @@ export declare class Gondi {
123
136
  nftCollateralTokenId: bigint;
124
137
  }>;
125
138
  /** @internal */
126
- _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress: Address, skipSave: true): Promise<SingleNftSignedOfferInput>;
139
+ _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress: Address, skipSave: true, publication?: LoanOfferPublicationInput): Promise<SingleNftSignedOfferInput>;
127
140
  /** @internal */
128
- _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress?: Address, skipSave?: false): ReturnType<Api['saveSingleNftOffer']>;
129
- makeCollectionOffer(offer: model.CollectionOfferInput): Promise<{
141
+ _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress?: Address, skipSave?: false, publication?: LoanOfferPublicationInput): ReturnType<Api['saveSingleNftOffer']>;
142
+ /**
143
+ * Signs and saves a collection offer without an item preview.
144
+ * @param publication Optional unsigned admission metadata. Identical retries after
145
+ * failed saves reuse the signature; a successful save clears that pending signature.
146
+ * The backend evaluates collection offers independently for each item.
147
+ */
148
+ makeCollectionOffer(offer: model.CollectionOfferInput, publication?: LoanOfferPublicationInput): Promise<{
130
149
  aprBps: import("./generated/graphql").Scalars["BigInt"];
131
150
  borrowerAddress: import("./generated/graphql").Scalars["Address"];
132
151
  capacity: import("./generated/graphql").Scalars["BigInt"];
@@ -152,7 +171,7 @@ export declare class Gondi {
152
171
  nftCollateralTokenId: bigint;
153
172
  }>;
154
173
  /** @internal */
155
- _makeCollectionOffer(offer: model.CollectionOfferInput, mslContractAddress?: Address): Promise<{
174
+ _makeCollectionOffer(offer: model.CollectionOfferInput, mslContractAddress?: Address, publication?: LoanOfferPublicationInput): Promise<{
156
175
  aprBps: import("./generated/graphql").Scalars["BigInt"];
157
176
  borrowerAddress: import("./generated/graphql").Scalars["Address"];
158
177
  capacity: import("./generated/graphql").Scalars["BigInt"];
@@ -719,7 +738,13 @@ export declare class Gondi {
719
738
  id: bigint;
720
739
  contractAddress: Address;
721
740
  }): Promise<import("./generated/graphql").UnhideOfferMutation>;
722
- makeRefinanceOffer({ renegotiation, contractAddress, ...props }: MakeRefinanceOfferProps): Promise<{
741
+ /**
742
+ * Signs and saves a refinance offer, optionally with a matching fallback.
743
+ * @param props.publication Optional unsigned admission metadata. Previews before
744
+ * signing and throws the backend rejection reason. Identical retries after failed
745
+ * saves reuse both signatures; a successful save clears the pending payloads.
746
+ */
747
+ makeRefinanceOffer({ renegotiation, contractAddress, publication, ...props }: MakeRefinanceOfferProps): Promise<{
723
748
  id: string;
724
749
  loanId: import("./generated/graphql").Scalars["String"];
725
750
  duration: import("./generated/graphql").Scalars["BigInt"];
@@ -3652,6 +3677,7 @@ export declare class Gondi {
3652
3677
  type MakeOfferType = Omit<Awaited<ReturnType<Gondi['makeSingleNftOffer']>>, 'nftId'> | Omit<Awaited<ReturnType<Gondi['makeCollectionOffer']>>, 'collectionId'> | Omit<Awaited<ReturnType<Gondi['makeTraitOffer']>>, 'traitIds'>;
3653
3678
  type OfferFromExecutionOffer = OptionalNullable<MakeOfferType, 'borrowerAddress' | 'lenderAddress' | 'offerHash' | 'signature'>;
3654
3679
  type MakeRefinanceOfferProps = {
3680
+ publication?: LoanOfferPublicationInput;
3655
3681
  renegotiation: model.RenegotiationInput;
3656
3682
  contractAddress: Address;
3657
3683
  } & ({
@@ -7,3 +7,4 @@ export type { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote,
7
7
  export type * as Types from './model';
8
8
  export { FULFILLED, REJECTED } from './utils/promises';
9
9
  export type { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
10
+ export type { LoanOfferPublicationInput } from './generated/graphql';