pepay-streams-sdk 0.1.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 +405 -0
- package/dist/api/index.d.mts +321 -0
- package/dist/api/index.d.ts +321 -0
- package/dist/api/index.js +312 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +306 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/automation/index.d.mts +140 -0
- package/dist/automation/index.d.ts +140 -0
- package/dist/automation/index.js +331 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/index.mjs +326 -0
- package/dist/automation/index.mjs.map +1 -0
- package/dist/campaigns/index.d.mts +286 -0
- package/dist/campaigns/index.d.ts +286 -0
- package/dist/campaigns/index.js +652 -0
- package/dist/campaigns/index.js.map +1 -0
- package/dist/campaigns/index.mjs +645 -0
- package/dist/campaigns/index.mjs.map +1 -0
- package/dist/claims/index.d.mts +190 -0
- package/dist/claims/index.d.ts +190 -0
- package/dist/claims/index.js +414 -0
- package/dist/claims/index.js.map +1 -0
- package/dist/claims/index.mjs +409 -0
- package/dist/claims/index.mjs.map +1 -0
- package/dist/index-BTG0TRJt.d.mts +555 -0
- package/dist/index-BTG0TRJt.d.ts +555 -0
- package/dist/index.d.mts +170 -0
- package/dist/index.d.ts +170 -0
- package/dist/index.js +2926 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2888 -0
- package/dist/index.mjs.map +1 -0
- package/dist/marketplace/index.d.mts +225 -0
- package/dist/marketplace/index.d.ts +225 -0
- package/dist/marketplace/index.js +529 -0
- package/dist/marketplace/index.js.map +1 -0
- package/dist/marketplace/index.mjs +524 -0
- package/dist/marketplace/index.mjs.map +1 -0
- package/dist/react/index.d.mts +185 -0
- package/dist/react/index.d.ts +185 -0
- package/dist/react/index.js +340 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +333 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/staking/index.d.mts +158 -0
- package/dist/staking/index.d.ts +158 -0
- package/dist/staking/index.js +359 -0
- package/dist/staking/index.js.map +1 -0
- package/dist/staking/index.mjs +354 -0
- package/dist/staking/index.mjs.map +1 -0
- package/package.json +106 -0
- package/src/api/index.ts +577 -0
- package/src/automation/index.ts +436 -0
- package/src/campaigns/index.ts +835 -0
- package/src/claims/index.ts +530 -0
- package/src/client.ts +518 -0
- package/src/index.ts +101 -0
- package/src/marketplace/index.ts +730 -0
- package/src/react/index.ts +498 -0
- package/src/staking/index.ts +449 -0
- package/src/types/index.ts +631 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { PublicClient, WalletClient, Address, Hex } from 'viem';
|
|
2
|
+
import { d as CreateInstantOrderParams, T as TransactionResult, e as CreateVestedOrderParams, f as CreateTradableOrderParams, O as OrderInfo, g as OrderQuote } from '../index-BTG0TRJt.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Marketplace Module
|
|
6
|
+
*
|
|
7
|
+
* Provides methods for P2P vesting marketplace:
|
|
8
|
+
* - Create orders (INSTANT, VESTED, TRADABLE)
|
|
9
|
+
* - Fill orders
|
|
10
|
+
* - Cancel orders
|
|
11
|
+
* - Order queries
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Marketplace module for P2P trading of token positions
|
|
16
|
+
*/
|
|
17
|
+
declare class MarketplaceModule {
|
|
18
|
+
private readonly publicClient;
|
|
19
|
+
private readonly walletClient;
|
|
20
|
+
private readonly diamondAddress;
|
|
21
|
+
constructor(publicClient: PublicClient, walletClient: WalletClient | undefined, diamondAddress: Address);
|
|
22
|
+
/**
|
|
23
|
+
* Create an INSTANT order
|
|
24
|
+
*
|
|
25
|
+
* Seller deposits tokens upfront, buyer pays and receives immediately.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Approve first
|
|
30
|
+
* await sdk.approve(sellToken, amount);
|
|
31
|
+
*
|
|
32
|
+
* const result = await sdk.marketplace.createInstantOrder({
|
|
33
|
+
* sellToken: '0x...',
|
|
34
|
+
* sellAmount: parseEther('1000'),
|
|
35
|
+
* payToken: zeroAddress, // Native ETH
|
|
36
|
+
* pricePerToken: parseEther('0.001'), // 0.001 ETH per token
|
|
37
|
+
* expiryTTL: 7 * 24 * 60 * 60, // 7 days
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
createInstantOrder(params: CreateInstantOrderParams): Promise<TransactionResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Create a VESTED order
|
|
44
|
+
*
|
|
45
|
+
* Seller deposits tokens that vest over time for the buyer.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const result = await sdk.marketplace.createVestedOrder({
|
|
50
|
+
* sellToken: '0x...',
|
|
51
|
+
* sellAmount: parseEther('10000'),
|
|
52
|
+
* payToken: '0x...', // USDC
|
|
53
|
+
* pricePerToken: 1000000n, // 1 USDC (6 decimals)
|
|
54
|
+
* vestingDuration: 365 * 24 * 60 * 60, // 1 year
|
|
55
|
+
* cliffDuration: 30 * 24 * 60 * 60, // 30 day cliff
|
|
56
|
+
* startMode: 'upon_fill', // Vesting starts when order is filled
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
createVestedOrder(params: CreateVestedOrderParams): Promise<TransactionResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a TRADABLE order
|
|
63
|
+
*
|
|
64
|
+
* List an unvested campaign position for sale. No upfront deposit -
|
|
65
|
+
* the position is transferred when the order is filled.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Must have a position in a VestedAirdrop campaign with trading enabled
|
|
70
|
+
* const result = await sdk.marketplace.createTradableOrder({
|
|
71
|
+
* campaignId: 10n,
|
|
72
|
+
* pricePerToken: parseEther('0.05'), // 0.05 ETH per token
|
|
73
|
+
* payToken: zeroAddress, // Native ETH
|
|
74
|
+
* expiryTTL: 30 * 24 * 60 * 60, // 30 days
|
|
75
|
+
* });
|
|
76
|
+
* console.log('Order created, tx:', result.hash);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
createTradableOrder(params: CreateTradableOrderParams): Promise<TransactionResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Fill an order (buy)
|
|
82
|
+
*
|
|
83
|
+
* For native payment orders, send ETH as value.
|
|
84
|
+
* For token payment orders, approve the Diamond first.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* // Get quote first
|
|
89
|
+
* const quote = await sdk.marketplace.getQuote(orderId);
|
|
90
|
+
*
|
|
91
|
+
* // Fill with native ETH
|
|
92
|
+
* const result = await sdk.marketplace.fillOrder(orderId, {
|
|
93
|
+
* value: quote.totalPrice,
|
|
94
|
+
* });
|
|
95
|
+
*
|
|
96
|
+
* // Or fill with ERC20 (approve first)
|
|
97
|
+
* await sdk.approve(payToken, quote.totalPrice);
|
|
98
|
+
* await sdk.marketplace.fillOrder(orderId);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
fillOrder(orderId: bigint, options?: {
|
|
102
|
+
value?: bigint;
|
|
103
|
+
}): Promise<TransactionResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Fill an order using Permit2 (gasless token approval)
|
|
106
|
+
*/
|
|
107
|
+
fillOrderWithPermit(params: {
|
|
108
|
+
orderId: bigint;
|
|
109
|
+
permit2Payload: Hex;
|
|
110
|
+
}): Promise<TransactionResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Cancel an order (seller only)
|
|
113
|
+
*
|
|
114
|
+
* Returns deposited tokens to seller.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const result = await sdk.marketplace.cancelOrder(orderId);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
cancelOrder(orderId: bigint): Promise<TransactionResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Expire an order (anyone can call after expiry)
|
|
124
|
+
*
|
|
125
|
+
* Returns deposited tokens to seller.
|
|
126
|
+
*/
|
|
127
|
+
expireOrder(orderId: bigint): Promise<TransactionResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Get order information by ID
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const order = await sdk.marketplace.getOrder(1n);
|
|
134
|
+
* console.log('Seller:', order.seller);
|
|
135
|
+
* console.log('Price:', formatEther(order.totalPrice));
|
|
136
|
+
* console.log('Status:', order.status);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
getOrder(orderId: bigint): Promise<OrderInfo>;
|
|
140
|
+
/**
|
|
141
|
+
* Get order quote (price breakdown)
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const quote = await sdk.marketplace.getQuote(orderId);
|
|
146
|
+
* console.log('Total price:', formatEther(quote.totalPrice));
|
|
147
|
+
* console.log('Protocol fee:', formatEther(quote.protocolFee));
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
getQuote(orderId: bigint): Promise<OrderQuote>;
|
|
151
|
+
/**
|
|
152
|
+
* Get detailed quote for filling an order
|
|
153
|
+
*/
|
|
154
|
+
getQuoteFill(orderId: bigint): Promise<{
|
|
155
|
+
payToken: Address;
|
|
156
|
+
price: bigint;
|
|
157
|
+
feeBps: number;
|
|
158
|
+
feeAmount: bigint;
|
|
159
|
+
feeReceiver: Address;
|
|
160
|
+
proceeds: bigint;
|
|
161
|
+
seller: Address;
|
|
162
|
+
sellToken: Address;
|
|
163
|
+
sellAmount: bigint;
|
|
164
|
+
deliveryKind: number;
|
|
165
|
+
escrowFlushedToRouting: boolean;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Get next order ID (also indicates total orders created)
|
|
169
|
+
*/
|
|
170
|
+
getNextOrderId(): Promise<bigint>;
|
|
171
|
+
/**
|
|
172
|
+
* Get orders by seller with pagination
|
|
173
|
+
*/
|
|
174
|
+
getOrdersBySeller(seller: Address, offset?: number, limit?: number): Promise<OrderInfo[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Get orders for a campaign
|
|
177
|
+
*/
|
|
178
|
+
getOrdersForCampaign(campaignId: bigint): Promise<{
|
|
179
|
+
activeOrderId: bigint;
|
|
180
|
+
historicalOrderIds: bigint[];
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* Get active order for a campaign
|
|
184
|
+
*/
|
|
185
|
+
getActiveOrderForCampaign(campaignId: bigint): Promise<bigint>;
|
|
186
|
+
/**
|
|
187
|
+
* Preview available amount to sell for a campaign
|
|
188
|
+
*/
|
|
189
|
+
previewAvailableToSell(campaignId: bigint): Promise<{
|
|
190
|
+
futureUnlockable: bigint;
|
|
191
|
+
claimableNow: bigint;
|
|
192
|
+
asOf: number;
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Get all open orders
|
|
196
|
+
*/
|
|
197
|
+
getOpenOrders(limit?: number): Promise<OrderInfo[]>;
|
|
198
|
+
/**
|
|
199
|
+
* Check if trading is allowed for a campaign
|
|
200
|
+
*/
|
|
201
|
+
isTradingEnabled(campaignId: bigint): Promise<boolean>;
|
|
202
|
+
/**
|
|
203
|
+
* Lock trading for a campaign (creator only)
|
|
204
|
+
*
|
|
205
|
+
* Prevents new orders from being created for this campaign.
|
|
206
|
+
*/
|
|
207
|
+
lockTrading(campaignId: bigint): Promise<TransactionResult>;
|
|
208
|
+
/**
|
|
209
|
+
* Unlock trading for a campaign (creator only)
|
|
210
|
+
*/
|
|
211
|
+
unlockTrading(campaignId: bigint): Promise<TransactionResult>;
|
|
212
|
+
/**
|
|
213
|
+
* Calculate total price for a given amount at price per token
|
|
214
|
+
*/
|
|
215
|
+
calculateTotalPrice(amount: bigint, pricePerToken: bigint): bigint;
|
|
216
|
+
/**
|
|
217
|
+
* Check if payment is in native token (ETH/BNB/etc)
|
|
218
|
+
*/
|
|
219
|
+
isNativePayment(payToken: Address): boolean;
|
|
220
|
+
private requireWallet;
|
|
221
|
+
private parseOrderInfo;
|
|
222
|
+
private createTransactionResult;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export { MarketplaceModule, MarketplaceModule as default };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { PublicClient, WalletClient, Address, Hex } from 'viem';
|
|
2
|
+
import { d as CreateInstantOrderParams, T as TransactionResult, e as CreateVestedOrderParams, f as CreateTradableOrderParams, O as OrderInfo, g as OrderQuote } from '../index-BTG0TRJt.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Marketplace Module
|
|
6
|
+
*
|
|
7
|
+
* Provides methods for P2P vesting marketplace:
|
|
8
|
+
* - Create orders (INSTANT, VESTED, TRADABLE)
|
|
9
|
+
* - Fill orders
|
|
10
|
+
* - Cancel orders
|
|
11
|
+
* - Order queries
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Marketplace module for P2P trading of token positions
|
|
16
|
+
*/
|
|
17
|
+
declare class MarketplaceModule {
|
|
18
|
+
private readonly publicClient;
|
|
19
|
+
private readonly walletClient;
|
|
20
|
+
private readonly diamondAddress;
|
|
21
|
+
constructor(publicClient: PublicClient, walletClient: WalletClient | undefined, diamondAddress: Address);
|
|
22
|
+
/**
|
|
23
|
+
* Create an INSTANT order
|
|
24
|
+
*
|
|
25
|
+
* Seller deposits tokens upfront, buyer pays and receives immediately.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Approve first
|
|
30
|
+
* await sdk.approve(sellToken, amount);
|
|
31
|
+
*
|
|
32
|
+
* const result = await sdk.marketplace.createInstantOrder({
|
|
33
|
+
* sellToken: '0x...',
|
|
34
|
+
* sellAmount: parseEther('1000'),
|
|
35
|
+
* payToken: zeroAddress, // Native ETH
|
|
36
|
+
* pricePerToken: parseEther('0.001'), // 0.001 ETH per token
|
|
37
|
+
* expiryTTL: 7 * 24 * 60 * 60, // 7 days
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
createInstantOrder(params: CreateInstantOrderParams): Promise<TransactionResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Create a VESTED order
|
|
44
|
+
*
|
|
45
|
+
* Seller deposits tokens that vest over time for the buyer.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const result = await sdk.marketplace.createVestedOrder({
|
|
50
|
+
* sellToken: '0x...',
|
|
51
|
+
* sellAmount: parseEther('10000'),
|
|
52
|
+
* payToken: '0x...', // USDC
|
|
53
|
+
* pricePerToken: 1000000n, // 1 USDC (6 decimals)
|
|
54
|
+
* vestingDuration: 365 * 24 * 60 * 60, // 1 year
|
|
55
|
+
* cliffDuration: 30 * 24 * 60 * 60, // 30 day cliff
|
|
56
|
+
* startMode: 'upon_fill', // Vesting starts when order is filled
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
createVestedOrder(params: CreateVestedOrderParams): Promise<TransactionResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a TRADABLE order
|
|
63
|
+
*
|
|
64
|
+
* List an unvested campaign position for sale. No upfront deposit -
|
|
65
|
+
* the position is transferred when the order is filled.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Must have a position in a VestedAirdrop campaign with trading enabled
|
|
70
|
+
* const result = await sdk.marketplace.createTradableOrder({
|
|
71
|
+
* campaignId: 10n,
|
|
72
|
+
* pricePerToken: parseEther('0.05'), // 0.05 ETH per token
|
|
73
|
+
* payToken: zeroAddress, // Native ETH
|
|
74
|
+
* expiryTTL: 30 * 24 * 60 * 60, // 30 days
|
|
75
|
+
* });
|
|
76
|
+
* console.log('Order created, tx:', result.hash);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
createTradableOrder(params: CreateTradableOrderParams): Promise<TransactionResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Fill an order (buy)
|
|
82
|
+
*
|
|
83
|
+
* For native payment orders, send ETH as value.
|
|
84
|
+
* For token payment orders, approve the Diamond first.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* // Get quote first
|
|
89
|
+
* const quote = await sdk.marketplace.getQuote(orderId);
|
|
90
|
+
*
|
|
91
|
+
* // Fill with native ETH
|
|
92
|
+
* const result = await sdk.marketplace.fillOrder(orderId, {
|
|
93
|
+
* value: quote.totalPrice,
|
|
94
|
+
* });
|
|
95
|
+
*
|
|
96
|
+
* // Or fill with ERC20 (approve first)
|
|
97
|
+
* await sdk.approve(payToken, quote.totalPrice);
|
|
98
|
+
* await sdk.marketplace.fillOrder(orderId);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
fillOrder(orderId: bigint, options?: {
|
|
102
|
+
value?: bigint;
|
|
103
|
+
}): Promise<TransactionResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Fill an order using Permit2 (gasless token approval)
|
|
106
|
+
*/
|
|
107
|
+
fillOrderWithPermit(params: {
|
|
108
|
+
orderId: bigint;
|
|
109
|
+
permit2Payload: Hex;
|
|
110
|
+
}): Promise<TransactionResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Cancel an order (seller only)
|
|
113
|
+
*
|
|
114
|
+
* Returns deposited tokens to seller.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const result = await sdk.marketplace.cancelOrder(orderId);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
cancelOrder(orderId: bigint): Promise<TransactionResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Expire an order (anyone can call after expiry)
|
|
124
|
+
*
|
|
125
|
+
* Returns deposited tokens to seller.
|
|
126
|
+
*/
|
|
127
|
+
expireOrder(orderId: bigint): Promise<TransactionResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Get order information by ID
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const order = await sdk.marketplace.getOrder(1n);
|
|
134
|
+
* console.log('Seller:', order.seller);
|
|
135
|
+
* console.log('Price:', formatEther(order.totalPrice));
|
|
136
|
+
* console.log('Status:', order.status);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
getOrder(orderId: bigint): Promise<OrderInfo>;
|
|
140
|
+
/**
|
|
141
|
+
* Get order quote (price breakdown)
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const quote = await sdk.marketplace.getQuote(orderId);
|
|
146
|
+
* console.log('Total price:', formatEther(quote.totalPrice));
|
|
147
|
+
* console.log('Protocol fee:', formatEther(quote.protocolFee));
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
getQuote(orderId: bigint): Promise<OrderQuote>;
|
|
151
|
+
/**
|
|
152
|
+
* Get detailed quote for filling an order
|
|
153
|
+
*/
|
|
154
|
+
getQuoteFill(orderId: bigint): Promise<{
|
|
155
|
+
payToken: Address;
|
|
156
|
+
price: bigint;
|
|
157
|
+
feeBps: number;
|
|
158
|
+
feeAmount: bigint;
|
|
159
|
+
feeReceiver: Address;
|
|
160
|
+
proceeds: bigint;
|
|
161
|
+
seller: Address;
|
|
162
|
+
sellToken: Address;
|
|
163
|
+
sellAmount: bigint;
|
|
164
|
+
deliveryKind: number;
|
|
165
|
+
escrowFlushedToRouting: boolean;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Get next order ID (also indicates total orders created)
|
|
169
|
+
*/
|
|
170
|
+
getNextOrderId(): Promise<bigint>;
|
|
171
|
+
/**
|
|
172
|
+
* Get orders by seller with pagination
|
|
173
|
+
*/
|
|
174
|
+
getOrdersBySeller(seller: Address, offset?: number, limit?: number): Promise<OrderInfo[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Get orders for a campaign
|
|
177
|
+
*/
|
|
178
|
+
getOrdersForCampaign(campaignId: bigint): Promise<{
|
|
179
|
+
activeOrderId: bigint;
|
|
180
|
+
historicalOrderIds: bigint[];
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* Get active order for a campaign
|
|
184
|
+
*/
|
|
185
|
+
getActiveOrderForCampaign(campaignId: bigint): Promise<bigint>;
|
|
186
|
+
/**
|
|
187
|
+
* Preview available amount to sell for a campaign
|
|
188
|
+
*/
|
|
189
|
+
previewAvailableToSell(campaignId: bigint): Promise<{
|
|
190
|
+
futureUnlockable: bigint;
|
|
191
|
+
claimableNow: bigint;
|
|
192
|
+
asOf: number;
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Get all open orders
|
|
196
|
+
*/
|
|
197
|
+
getOpenOrders(limit?: number): Promise<OrderInfo[]>;
|
|
198
|
+
/**
|
|
199
|
+
* Check if trading is allowed for a campaign
|
|
200
|
+
*/
|
|
201
|
+
isTradingEnabled(campaignId: bigint): Promise<boolean>;
|
|
202
|
+
/**
|
|
203
|
+
* Lock trading for a campaign (creator only)
|
|
204
|
+
*
|
|
205
|
+
* Prevents new orders from being created for this campaign.
|
|
206
|
+
*/
|
|
207
|
+
lockTrading(campaignId: bigint): Promise<TransactionResult>;
|
|
208
|
+
/**
|
|
209
|
+
* Unlock trading for a campaign (creator only)
|
|
210
|
+
*/
|
|
211
|
+
unlockTrading(campaignId: bigint): Promise<TransactionResult>;
|
|
212
|
+
/**
|
|
213
|
+
* Calculate total price for a given amount at price per token
|
|
214
|
+
*/
|
|
215
|
+
calculateTotalPrice(amount: bigint, pricePerToken: bigint): bigint;
|
|
216
|
+
/**
|
|
217
|
+
* Check if payment is in native token (ETH/BNB/etc)
|
|
218
|
+
*/
|
|
219
|
+
isNativePayment(payToken: Address): boolean;
|
|
220
|
+
private requireWallet;
|
|
221
|
+
private parseOrderInfo;
|
|
222
|
+
private createTransactionResult;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export { MarketplaceModule, MarketplaceModule as default };
|