-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel.ts
106 lines (91 loc) · 2.29 KB
/
model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { Address, Hash } from "viem";
import {
Auction as BlockchainAuction,
Signature,
} from "@/blockchain";
import {
CollectionOfferInput as ApiCollectionOfferInput,
CollectionSignedOfferInput,
MarketplaceEnum,
OffersSortInput,
OfferStatus,
RenegotiationOfferInput as ApiRenegotiationInput,
SignedRenegotiationOfferInput,
SingleNftOfferInput as ApiSingleNftOfferInput,
SingleNftSignedOfferInput,
UserFilter,
} from "@/generated/graphql";
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type SingleNftOfferInput = Optional<
ApiSingleNftOfferInput,
| "borrowerAddress"
| "lenderAddress"
| "signerAddress"
| "offerValidators"
| "contractAddress"
>;
export type UnsignedSingleNftOffer = Omit<
SingleNftSignedOfferInput,
"signature"
> & {
nftCollateralAddress: Address;
nftCollateralTokenId: bigint;
};
export type SingleNftOffer = UnsignedSingleNftOffer &
SingleNftSignedOfferInput & {
signature: Hash;
};
export type CollectionOfferInput = Optional<
ApiCollectionOfferInput,
| "borrowerAddress"
| "lenderAddress"
| "signerAddress"
| "offerValidators"
| "contractAddress"
>;
export type UnsignedCollectionOffer = Omit<
CollectionSignedOfferInput,
"signature"
> & {
nftCollateralAddress: Address;
};
export type CollectionOffer = UnsignedCollectionOffer & {
signature: Hash;
nftCollateralTokenId: 0n;
};
export type RenegotiationInput = Optional<
ApiRenegotiationInput,
"lenderAddress" | "signerAddress"
>;
export type UnsignedRenegotiationOffer = Omit<
SignedRenegotiationOfferInput,
"signature"
>;
export type RenegotiationOffer = UnsignedRenegotiationOffer & {
signature: Signature;
};
/** @ignore */
export const MAX_NUMBER =
115792089237316195423570985008687907853269984665640564039457584007913129639935n;
export type Auction = BlockchainAuction;
export type ListOffersProps = {
limit?: number;
cursor?: string;
sortBy?: OffersSortInput;
filterBy?: {
nft?: number;
onlySingleNftOffers?: boolean;
collection?: number;
onlyCollectionOffers?: boolean;
borrower?: Address;
lender?: Address;
status?: OfferStatus[];
};
};
export type ListListingsProps = {
collections?: number[];
user?: UserFilter;
marketPlaces?: MarketplaceEnum[];
limit?: number;
cursor?: string;
};