gondi 0.43.0 → 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.
- package/README.md +116 -17
- package/dist/index.mjs +68 -52
- package/dist/index.mjs.map +4 -4
- package/dist/src/blockchain.d.ts +2 -0
- package/dist/src/clients/api/index.d.ts +4 -0
- package/dist/src/clients/api/sdk.d.ts +4 -0
- package/dist/src/clients/contracts/MslV6.d.ts +7 -0
- package/dist/src/errors.d.ts +14 -0
- package/dist/src/generated/graphql/index.d.ts +21 -0
- package/dist/src/gondi.d.ts +16 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -1
package/dist/src/blockchain.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export declare const zeroAddress: Address;
|
|
|
58
58
|
export declare const zeroHash: Hash;
|
|
59
59
|
export declare const zeroHex: HexString;
|
|
60
60
|
export declare const REORG_SAFETY_BUFFER: bigint;
|
|
61
|
+
/** How long a borrower's signed loan execution data stays valid once it is sent on-chain. */
|
|
62
|
+
export declare const BORROWER_SIGNATURE_LIFETIME: bigint;
|
|
61
63
|
/** Native ETH marker on Ethereum mainnet: the zero address. */
|
|
62
64
|
export declare const __ETH_ADDRESS: `0x${string}`;
|
|
63
65
|
/** Synthetic sentinel the Gondi API uses for native HYPE on HyperEVM. */
|
|
@@ -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"];
|
|
@@ -9047,6 +9047,13 @@ export declare class MslV6 extends BaseContract<typeof multiSourceLoanAbiV6 | ty
|
|
|
9047
9047
|
cancelAllRenegotiations(_: {
|
|
9048
9048
|
minId: bigint;
|
|
9049
9049
|
}): Promise<void>;
|
|
9050
|
+
/**
|
|
9051
|
+
* Maps SDK emit arguments to the contract's `LoanExecutionData`.
|
|
9052
|
+
*
|
|
9053
|
+
* @remarks
|
|
9054
|
+
* Without an `expirationTime` the execution data expires `lifetime` seconds from now: a day for
|
|
9055
|
+
* a loan the borrower sends, `BORROWER_SIGNATURE_LIFETIME` when the borrower signs it.
|
|
9056
|
+
*/
|
|
9050
9057
|
private mapEmitLoanToMslEmitLoanArgs;
|
|
9051
9058
|
emitLoan(emitArgs: EmitLoanArgs): Promise<{
|
|
9052
9059
|
txHash: `0x${string}`;
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -315,6 +315,8 @@ export type BnplOrderInput = {
|
|
|
315
315
|
amounts: Array<Scalars['BigInt']>;
|
|
316
316
|
contractAddress: Scalars['Address'];
|
|
317
317
|
creditPurchaseExecution?: InputMaybe<CreditPurchaseExecutionInput>;
|
|
318
|
+
/** When the borrower's signed loan execution data expires, at most the server's configured lifetime ahead (five minutes by default). Required unless creditPurchaseExecution sets the deadline. */
|
|
319
|
+
emitExpirationTime?: InputMaybe<Scalars['BigInt']>;
|
|
318
320
|
emitSignature?: InputMaybe<Scalars['Signature']>;
|
|
319
321
|
extraSeaportData?: InputMaybe<Scalars['Hex']>;
|
|
320
322
|
loanDuration: Scalars['BigInt'];
|
|
@@ -6360,6 +6362,23 @@ export type ListLoansQuery = {
|
|
|
6360
6362
|
}>;
|
|
6361
6363
|
};
|
|
6362
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
|
+
};
|
|
6363
6382
|
export type NftIdByContractAddressAndTokenIdQueryVariables = Exact<{
|
|
6364
6383
|
contractAddress: Scalars['Address'];
|
|
6365
6384
|
tokenId: Scalars['BigInt'];
|
|
@@ -10743,6 +10762,7 @@ export declare const CollectionIdBySlugDocument: DocumentNode;
|
|
|
10743
10762
|
export declare const CollectionStepsByIdDocument: DocumentNode;
|
|
10744
10763
|
export declare const ListListingsDocument: DocumentNode;
|
|
10745
10764
|
export declare const ListLoansDocument: DocumentNode;
|
|
10765
|
+
export declare const NftFlaggedByContractAddressAndTokenIdDocument: DocumentNode;
|
|
10746
10766
|
export declare const NftIdByContractAddressAndTokenIdDocument: DocumentNode;
|
|
10747
10767
|
export declare const NftIdBySlugTokenIdDocument: DocumentNode;
|
|
10748
10768
|
export declare const OwnedNftsDocument: DocumentNode;
|
|
@@ -10784,6 +10804,7 @@ export declare function getSdk<C, E>(requester: Requester<C, E>): {
|
|
|
10784
10804
|
collectionStepsById(variables: CollectionStepsByIdQueryVariables, options?: C): Promise<CollectionStepsByIdQuery>;
|
|
10785
10805
|
listListings(variables?: ListListingsQueryVariables, options?: C): Promise<ListListingsQuery>;
|
|
10786
10806
|
listLoans(variables?: ListLoansQueryVariables, options?: C): Promise<ListLoansQuery>;
|
|
10807
|
+
nftFlaggedByContractAddressAndTokenId(variables: NftFlaggedByContractAddressAndTokenIdQueryVariables, options?: C): Promise<NftFlaggedByContractAddressAndTokenIdQuery>;
|
|
10787
10808
|
nftIdByContractAddressAndTokenId(variables: NftIdByContractAddressAndTokenIdQueryVariables, options?: C): Promise<NftIdByContractAddressAndTokenIdQuery>;
|
|
10788
10809
|
nftIdBySlugTokenId(variables: NftIdBySlugTokenIdQueryVariables, options?: C): Promise<NftIdBySlugTokenIdQuery>;
|
|
10789
10810
|
ownedNfts(variables?: OwnedNftsQueryVariables, options?: C): Promise<OwnedNftsQuery>;
|
package/dist/src/gondi.d.ts
CHANGED
|
@@ -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
|
-
|
|
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<{
|
package/dist/src/index.d.ts
CHANGED