@helium/blockchain-api 0.3.13 → 0.11.11
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/dist/chunk-2SBYC2AH.js +466 -0
- package/dist/chunk-4CY5D37F.js +176 -0
- package/dist/chunk-4RVSLJOU.js +9 -0
- package/dist/chunk-5ZPW3MRC.js +53 -0
- package/dist/chunk-6EPXJJY5.js +60 -0
- package/dist/chunk-6LMSAIIW.js +230 -0
- package/dist/chunk-7CTJX35S.js +16 -0
- package/dist/chunk-7R4XQ5SN.js +116 -0
- package/dist/chunk-KTADG6LO.js +1 -0
- package/dist/chunk-LHKDTWB2.js +177 -0
- package/dist/chunk-MSIA3ZUI.js +36 -0
- package/dist/chunk-NBOSJXWK.js +50 -0
- package/dist/chunk-RD5LUTM5.js +97 -0
- package/dist/chunk-T7OKPHTD.js +68 -0
- package/dist/chunk-TEWZC6CW.js +1 -0
- package/dist/chunk-YVB4ENKX.js +119 -0
- package/dist/contracts.d.ts +8671 -0
- package/dist/contracts.js +14 -0
- package/dist/errors.d.ts +69 -0
- package/dist/errors.js +2 -0
- package/dist/index.d.ts +16 -8128
- package/dist/index.js +16 -1597
- package/dist/schemas/common.d.ts +219 -0
- package/dist/schemas/common.js +1 -0
- package/dist/schemas/fiat.d.ts +175 -0
- package/dist/schemas/fiat.js +3 -0
- package/dist/schemas/governance.d.ts +470 -0
- package/dist/schemas/governance.js +2 -0
- package/dist/schemas/health.d.ts +9 -0
- package/dist/schemas/health.js +1 -0
- package/dist/schemas/hotspots.d.ts +540 -0
- package/dist/schemas/hotspots.js +2 -0
- package/dist/schemas/migration.d.ts +145 -0
- package/dist/schemas/migration.js +3 -0
- package/dist/schemas/reward-contract.d.ts +209 -0
- package/dist/schemas/reward-contract.js +2 -0
- package/dist/schemas/swap.d.ts +95 -0
- package/dist/schemas/swap.js +2 -0
- package/dist/schemas/tokens.d.ts +94 -0
- package/dist/schemas/tokens.js +2 -0
- package/dist/schemas/transactions.d.ts +200 -0
- package/dist/schemas/transactions.js +2 -0
- package/dist/schemas/webhooks.d.ts +17 -0
- package/dist/schemas/webhooks.js +1 -0
- package/dist/schemas/welcome-packs.d.ts +305 -0
- package/dist/schemas/welcome-packs.js +3 -0
- package/dist/schemas.d.ts +12 -0
- package/dist/schemas.js +12 -0
- package/package.json +31 -9
- package/README.md +0 -78
package/dist/index.js
CHANGED
|
@@ -1,1597 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
var TransactionBatchRequestSchema = z.object({
|
|
19
|
-
transactions: z.array(TransactionItemSchema),
|
|
20
|
-
parallel: z.boolean(),
|
|
21
|
-
tag: z.string().optional()
|
|
22
|
-
});
|
|
23
|
-
var TransactionBatchResponseSchema = z.object({
|
|
24
|
-
batchId: z.string(),
|
|
25
|
-
message: z.string().optional()
|
|
26
|
-
});
|
|
27
|
-
var ErrorResponseSchema = z.object({
|
|
28
|
-
error: z.string(),
|
|
29
|
-
details: z.array(z.string()).optional()
|
|
30
|
-
});
|
|
31
|
-
var WalletAddressSchema = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Invalid Solana wallet address");
|
|
32
|
-
var PublicKeySchema = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Invalid Solana public key");
|
|
33
|
-
var HeliumPublicKeySchema = z.string().min(32).max(400);
|
|
34
|
-
var PaginationInputSchema = z.object({
|
|
35
|
-
page: z.coerce.number().int().min(1).default(1),
|
|
36
|
-
limit: z.coerce.number().int().min(1).max(100).default(10)
|
|
37
|
-
});
|
|
38
|
-
var PaginationOutputSchema = z.object({
|
|
39
|
-
total: z.number(),
|
|
40
|
-
page: z.number(),
|
|
41
|
-
totalPages: z.number()
|
|
42
|
-
});
|
|
43
|
-
var ScheduleInputSchema = z.object({
|
|
44
|
-
frequency: z.enum(["daily", "weekly", "monthly"]),
|
|
45
|
-
time: z.string(),
|
|
46
|
-
timezone: z.string(),
|
|
47
|
-
dayOfWeek: z.string().optional(),
|
|
48
|
-
dayOfMonth: z.string().optional()
|
|
49
|
-
});
|
|
50
|
-
var TokenAmountInputSchema = z.object({
|
|
51
|
-
amount: z.string().regex(/^\d+$/, "Amount must be a whole number in smallest unit").describe(
|
|
52
|
-
'Raw token amount in smallest unit (bones). e.g. for a mint with 8 decimals, 1 full token = "100000000"'
|
|
53
|
-
),
|
|
54
|
-
mint: PublicKeySchema.describe("Mint address of the token")
|
|
55
|
-
});
|
|
56
|
-
var TokenAmountOutputSchema = z.object({
|
|
57
|
-
amount: z.string().describe(
|
|
58
|
-
'Raw token amount in smallest unit (bones). e.g. for a mint with 8 decimals, 1 full token = "100000000"'
|
|
59
|
-
),
|
|
60
|
-
decimals: z.number().describe("Number of decimals for the mint"),
|
|
61
|
-
uiAmount: z.number().nullable().describe("Numeric amount if <= Number.MAX_SAFE_INTEGER, otherwise null"),
|
|
62
|
-
uiAmountString: z.string().describe("String representation of the uiAmount"),
|
|
63
|
-
mint: PublicKeySchema.describe("Mint address of the token")
|
|
64
|
-
});
|
|
65
|
-
var RewardSplitInputSchema = z.discriminatedUnion("type", [
|
|
66
|
-
z.object({
|
|
67
|
-
address: WalletAddressSchema,
|
|
68
|
-
type: z.literal("percentage"),
|
|
69
|
-
amount: z.number().describe("0-100 (e.g. 50 = 50%)")
|
|
70
|
-
}),
|
|
71
|
-
z.object({
|
|
72
|
-
address: WalletAddressSchema,
|
|
73
|
-
type: z.literal("fixed"),
|
|
74
|
-
tokenAmount: TokenAmountInputSchema
|
|
75
|
-
})
|
|
76
|
-
]);
|
|
77
|
-
function typedTransactionData(metadataSchema) {
|
|
78
|
-
return z.object({
|
|
79
|
-
transactions: z.array(
|
|
80
|
-
z.object({
|
|
81
|
-
serializedTransaction: z.string(),
|
|
82
|
-
metadata: metadataSchema.optional()
|
|
83
|
-
})
|
|
84
|
-
),
|
|
85
|
-
parallel: z.boolean(),
|
|
86
|
-
tag: z.string().optional()
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function createTransactionResponse() {
|
|
90
|
-
return z.object({
|
|
91
|
-
transactionData: TransactionDataSchema,
|
|
92
|
-
estimatedSolFee: TokenAmountOutputSchema.describe(
|
|
93
|
-
"Estimated total SOL fee including rent, priority fees, and automation costs"
|
|
94
|
-
)
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function createTypedTransactionResponse(metadataSchema) {
|
|
98
|
-
return z.object({
|
|
99
|
-
transactionData: typedTransactionData(metadataSchema),
|
|
100
|
-
estimatedSolFee: TokenAmountOutputSchema.describe(
|
|
101
|
-
"Estimated total SOL fee including rent, priority fees, and automation costs"
|
|
102
|
-
)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
function createPaginatedTransactionResponse() {
|
|
106
|
-
return createTransactionResponse().extend({
|
|
107
|
-
hasMore: z.boolean().describe(
|
|
108
|
-
"True if more work remains \u2014 call again with the same arguments to continue."
|
|
109
|
-
)
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function createTypedPaginatedTransactionResponse(metadataSchema) {
|
|
113
|
-
return createTypedTransactionResponse(metadataSchema).extend({
|
|
114
|
-
hasMore: z.boolean().describe(
|
|
115
|
-
"True if more work remains \u2014 call again with the same arguments to continue."
|
|
116
|
-
)
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
var GetTokensInputSchema = z.object({
|
|
120
|
-
limit: z.coerce.number().int().min(1).max(100).default(50)
|
|
121
|
-
});
|
|
122
|
-
var GetQuoteInputSchema = z.object({
|
|
123
|
-
inputMint: z.string().min(1),
|
|
124
|
-
outputMint: z.string().min(1),
|
|
125
|
-
amount: z.string().min(1),
|
|
126
|
-
swapMode: z.enum(["ExactIn", "ExactOut"]).default("ExactIn"),
|
|
127
|
-
slippageBps: z.coerce.number().min(0).max(1e4).default(50)
|
|
128
|
-
});
|
|
129
|
-
var QuoteResponseSchema = z.object({
|
|
130
|
-
inputMint: z.string(),
|
|
131
|
-
inAmount: z.string(),
|
|
132
|
-
outputMint: z.string(),
|
|
133
|
-
outAmount: z.string(),
|
|
134
|
-
otherAmountThreshold: z.string(),
|
|
135
|
-
swapMode: z.string(),
|
|
136
|
-
slippageBps: z.number(),
|
|
137
|
-
platformFee: z.unknown().optional(),
|
|
138
|
-
priceImpactPct: z.string(),
|
|
139
|
-
routePlan: z.array(z.unknown()),
|
|
140
|
-
contextSlot: z.number().optional(),
|
|
141
|
-
timeTaken: z.number().optional()
|
|
142
|
-
}).passthrough();
|
|
143
|
-
var GetInstructionsInputSchema = z.object({
|
|
144
|
-
quoteResponse: QuoteResponseSchema,
|
|
145
|
-
userPublicKey: z.string().min(1),
|
|
146
|
-
destinationTokenAccount: z.string().optional(),
|
|
147
|
-
dynamicComputeUnitLimit: z.boolean().default(true),
|
|
148
|
-
prioritizationFeeLamports: z.object({
|
|
149
|
-
priorityLevelWithMaxLamports: z.object({
|
|
150
|
-
maxLamports: z.number().default(1e6),
|
|
151
|
-
priorityLevel: z.enum(["low", "medium", "high"]).default("medium")
|
|
152
|
-
})
|
|
153
|
-
}).optional()
|
|
154
|
-
});
|
|
155
|
-
var TokenSchema = z.object({
|
|
156
|
-
address: z.string(),
|
|
157
|
-
symbol: z.string(),
|
|
158
|
-
name: z.string(),
|
|
159
|
-
decimals: z.number(),
|
|
160
|
-
logoURI: z.string().optional(),
|
|
161
|
-
tags: z.array(z.string()).optional()
|
|
162
|
-
});
|
|
163
|
-
var TokenListOutputSchema = z.object({
|
|
164
|
-
tokens: z.array(TokenSchema)
|
|
165
|
-
});
|
|
166
|
-
var SwapTransactionDataSchema = TransactionDataSchema;
|
|
167
|
-
|
|
168
|
-
// src/schemas/fiat.ts
|
|
169
|
-
var InitKycInputSchema = z.object({
|
|
170
|
-
type: z.enum(["individual", "business"]).optional()
|
|
171
|
-
});
|
|
172
|
-
var CreateBankAccountInputSchema = z.object({
|
|
173
|
-
currency: z.string(),
|
|
174
|
-
account_type: z.string(),
|
|
175
|
-
bank_name: z.string(),
|
|
176
|
-
account_name: z.string(),
|
|
177
|
-
first_name: z.string().optional(),
|
|
178
|
-
last_name: z.string().optional(),
|
|
179
|
-
account_owner_name: z.string().optional(),
|
|
180
|
-
business_name: z.string().optional(),
|
|
181
|
-
account: z.object({
|
|
182
|
-
account_number: z.string(),
|
|
183
|
-
routing_number: z.string(),
|
|
184
|
-
checking_or_savings: z.string()
|
|
185
|
-
}),
|
|
186
|
-
address: z.object({
|
|
187
|
-
street_line_1: z.string(),
|
|
188
|
-
line2: z.string().optional(),
|
|
189
|
-
city: z.string(),
|
|
190
|
-
state: z.string(),
|
|
191
|
-
postal_code: z.string(),
|
|
192
|
-
country: z.string()
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
var GetBankAccountInputSchema = z.object({
|
|
196
|
-
id: z.string()
|
|
197
|
-
});
|
|
198
|
-
var DeleteBankAccountInputSchema = z.object({
|
|
199
|
-
id: z.number()
|
|
200
|
-
});
|
|
201
|
-
var GetSendQuoteInputSchema = z.object({
|
|
202
|
-
id: z.string(),
|
|
203
|
-
usdAmount: z.string()
|
|
204
|
-
});
|
|
205
|
-
var SendFundsInputSchema = z.object({
|
|
206
|
-
id: z.string(),
|
|
207
|
-
userAddress: z.string(),
|
|
208
|
-
quoteResponse: QuoteResponseSchema
|
|
209
|
-
});
|
|
210
|
-
var GetTransferInputSchema = z.object({
|
|
211
|
-
id: z.string()
|
|
212
|
-
});
|
|
213
|
-
var UpdateTransferInputSchema = z.object({
|
|
214
|
-
id: z.string(),
|
|
215
|
-
solanaSignature: z.string()
|
|
216
|
-
});
|
|
217
|
-
var KycStatusOutputSchema = z.object({
|
|
218
|
-
kycStatus: z.string(),
|
|
219
|
-
tosStatus: z.string(),
|
|
220
|
-
tosLink: z.string().nullable(),
|
|
221
|
-
kycLink: z.string().nullable(),
|
|
222
|
-
kycLinkId: z.string().nullable(),
|
|
223
|
-
accountType: z.string().optional(),
|
|
224
|
-
rejectionReasons: z.array(z.string()).optional()
|
|
225
|
-
});
|
|
226
|
-
var FeesOutputSchema = z.object({
|
|
227
|
-
developer_fee: z.string(),
|
|
228
|
-
developer_fee_percent: z.number()
|
|
229
|
-
});
|
|
230
|
-
var BankAccountSchema = z.object({
|
|
231
|
-
id: z.number().optional(),
|
|
232
|
-
bridgeUserId: z.number().optional(),
|
|
233
|
-
bridgeExternalAccountId: z.string().optional(),
|
|
234
|
-
accountName: z.string().optional(),
|
|
235
|
-
bankName: z.string().optional(),
|
|
236
|
-
lastFourDigits: z.string().optional(),
|
|
237
|
-
routingNumber: z.string().optional(),
|
|
238
|
-
accountType: z.string().optional(),
|
|
239
|
-
createdAt: z.union([z.string(), z.date()]).optional(),
|
|
240
|
-
updatedAt: z.union([z.string(), z.date()]).optional()
|
|
241
|
-
}).passthrough();
|
|
242
|
-
var BankAccountListOutputSchema = z.array(BankAccountSchema);
|
|
243
|
-
var DeleteBankAccountOutputSchema = z.object({
|
|
244
|
-
success: z.boolean()
|
|
245
|
-
});
|
|
246
|
-
var BridgeTransferSchema = z.object({
|
|
247
|
-
id: z.string(),
|
|
248
|
-
state: z.string(),
|
|
249
|
-
source_deposit_instructions: z.object({
|
|
250
|
-
to_address: z.string()
|
|
251
|
-
})
|
|
252
|
-
}).passthrough();
|
|
253
|
-
var SendFundsOutputSchema = createTransactionResponse().extend({
|
|
254
|
-
bridgeTransfer: BridgeTransferSchema
|
|
255
|
-
});
|
|
256
|
-
var UpdateTransferOutputSchema = z.object({
|
|
257
|
-
success: z.boolean()
|
|
258
|
-
});
|
|
259
|
-
var QuoteOutputSchema = QuoteResponseSchema;
|
|
260
|
-
var LockupKindSchema = z.enum(["cliff", "constant"]);
|
|
261
|
-
var CreatePositionInputSchema = z.object({
|
|
262
|
-
walletAddress: WalletAddressSchema.describe(
|
|
263
|
-
"Wallet address that will own the position"
|
|
264
|
-
),
|
|
265
|
-
tokenAmount: TokenAmountInputSchema.describe(
|
|
266
|
-
"Token amount and mint to deposit"
|
|
267
|
-
),
|
|
268
|
-
lockupKind: LockupKindSchema.describe("Type of lockup: cliff or constant"),
|
|
269
|
-
lockupPeriodsInDays: z.number().int().min(1).max(2920).describe("Number of days to lock the position (max ~8 years)"),
|
|
270
|
-
subDaoMint: PublicKeySchema.optional().describe(
|
|
271
|
-
"Sub-DAO mint to delegate to immediately after creation (optional)"
|
|
272
|
-
),
|
|
273
|
-
automationEnabled: z.boolean().optional().describe("Enable delegation claim bot automation (optional)")
|
|
274
|
-
});
|
|
275
|
-
var ClosePositionInputSchema = z.object({
|
|
276
|
-
walletAddress: WalletAddressSchema.describe(
|
|
277
|
-
"Wallet address that owns the position"
|
|
278
|
-
),
|
|
279
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
280
|
-
});
|
|
281
|
-
var ExtendPositionInputSchema = z.object({
|
|
282
|
-
walletAddress: WalletAddressSchema.describe(
|
|
283
|
-
"Wallet address that owns the position"
|
|
284
|
-
),
|
|
285
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
286
|
-
lockupPeriodsInDays: z.number().int().min(1).describe("New lockup period in days")
|
|
287
|
-
});
|
|
288
|
-
var FlipLockupKindInputSchema = z.object({
|
|
289
|
-
walletAddress: WalletAddressSchema.describe(
|
|
290
|
-
"Wallet address that owns the position"
|
|
291
|
-
),
|
|
292
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
293
|
-
});
|
|
294
|
-
var ResetLockupInputSchema = z.object({
|
|
295
|
-
walletAddress: WalletAddressSchema.describe(
|
|
296
|
-
"Wallet address that owns the position"
|
|
297
|
-
),
|
|
298
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
299
|
-
lockupKind: LockupKindSchema.describe("New lockup type: cliff or constant"),
|
|
300
|
-
lockupPeriodsInDays: z.number().int().min(1).max(1460).describe("New lockup period in days (max 4 years)")
|
|
301
|
-
});
|
|
302
|
-
var SplitPositionInputSchema = z.object({
|
|
303
|
-
walletAddress: WalletAddressSchema.describe(
|
|
304
|
-
"Wallet address that owns the position"
|
|
305
|
-
),
|
|
306
|
-
positionMint: PublicKeySchema.describe(
|
|
307
|
-
"Mint address of the source position NFT"
|
|
308
|
-
),
|
|
309
|
-
amount: z.string().regex(/^\d+$/, "Amount must be a whole number in smallest unit (bones)").describe(
|
|
310
|
-
"Raw token amount to transfer to new position (in smallest unit)"
|
|
311
|
-
),
|
|
312
|
-
lockupKind: LockupKindSchema.describe("Lockup type for new position"),
|
|
313
|
-
lockupPeriodsInDays: z.number().int().min(1).describe("Lockup period for new position in days")
|
|
314
|
-
});
|
|
315
|
-
var TransferPositionInputSchema = z.object({
|
|
316
|
-
walletAddress: WalletAddressSchema.describe(
|
|
317
|
-
"Wallet address that owns both positions"
|
|
318
|
-
),
|
|
319
|
-
positionMint: PublicKeySchema.describe(
|
|
320
|
-
"Mint address of the source position NFT"
|
|
321
|
-
),
|
|
322
|
-
targetPositionMint: PublicKeySchema.describe(
|
|
323
|
-
"Mint address of the target position NFT"
|
|
324
|
-
),
|
|
325
|
-
amount: z.string().regex(/^\d+$/, "Amount must be a whole number in smallest unit (bones)").describe("Raw token amount to transfer (in smallest unit)")
|
|
326
|
-
});
|
|
327
|
-
var DelegatePositionInputSchema = z.object({
|
|
328
|
-
walletAddress: WalletAddressSchema.describe(
|
|
329
|
-
"Wallet address that owns the positions"
|
|
330
|
-
),
|
|
331
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to delegate"),
|
|
332
|
-
subDaoMint: PublicKeySchema.describe("Sub-DAO mint address to delegate to"),
|
|
333
|
-
automationEnabled: z.boolean().optional().describe("Enable delegation claim bot automation")
|
|
334
|
-
});
|
|
335
|
-
var ExtendDelegationInputSchema = z.object({
|
|
336
|
-
walletAddress: WalletAddressSchema.describe(
|
|
337
|
-
"Wallet address that owns the position"
|
|
338
|
-
),
|
|
339
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
340
|
-
});
|
|
341
|
-
var UndelegateInputSchema = z.object({
|
|
342
|
-
walletAddress: WalletAddressSchema.describe(
|
|
343
|
-
"Wallet address that owns the position"
|
|
344
|
-
),
|
|
345
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
346
|
-
});
|
|
347
|
-
var ClaimDelegationRewardsInputSchema = z.object({
|
|
348
|
-
walletAddress: WalletAddressSchema.describe(
|
|
349
|
-
"Wallet address that owns the positions"
|
|
350
|
-
),
|
|
351
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to claim rewards for")
|
|
352
|
-
});
|
|
353
|
-
var VoteInputSchema = z.object({
|
|
354
|
-
walletAddress: WalletAddressSchema.describe(
|
|
355
|
-
"Wallet address that owns the positions"
|
|
356
|
-
),
|
|
357
|
-
proposalKey: PublicKeySchema.describe("Public key of the proposal to vote on"),
|
|
358
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to vote with"),
|
|
359
|
-
choice: z.number().int().min(0).describe("The choice index to vote for")
|
|
360
|
-
});
|
|
361
|
-
var RelinquishVoteInputSchema = z.object({
|
|
362
|
-
walletAddress: WalletAddressSchema.describe(
|
|
363
|
-
"Wallet address that owns the positions"
|
|
364
|
-
),
|
|
365
|
-
proposalKey: PublicKeySchema.describe(
|
|
366
|
-
"Public key of the proposal to relinquish vote from"
|
|
367
|
-
),
|
|
368
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to relinquish votes for"),
|
|
369
|
-
choice: z.number().int().min(0).describe("The choice index to relinquish")
|
|
370
|
-
});
|
|
371
|
-
var RelinquishPositionVotesInputSchema = z.object({
|
|
372
|
-
walletAddress: WalletAddressSchema.describe(
|
|
373
|
-
"Wallet address that owns the position"
|
|
374
|
-
),
|
|
375
|
-
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
376
|
-
organization: PublicKeySchema.describe(
|
|
377
|
-
"Public key of the DAO organization to relinquish votes from"
|
|
378
|
-
)
|
|
379
|
-
});
|
|
380
|
-
var AssignProxiesInputSchema = z.object({
|
|
381
|
-
walletAddress: WalletAddressSchema.describe(
|
|
382
|
-
"Wallet address that owns the positions"
|
|
383
|
-
),
|
|
384
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to assign proxy for"),
|
|
385
|
-
proxyKey: PublicKeySchema.describe(
|
|
386
|
-
"Public key of the proxy recipient who will vote on your behalf"
|
|
387
|
-
),
|
|
388
|
-
expirationTime: z.number().int().describe("Unix timestamp when the proxy assignment expires")
|
|
389
|
-
});
|
|
390
|
-
var UnassignProxiesInputSchema = z.object({
|
|
391
|
-
walletAddress: WalletAddressSchema.describe(
|
|
392
|
-
"Wallet address that owns the positions"
|
|
393
|
-
),
|
|
394
|
-
proxyKey: PublicKeySchema.describe("Public key of the proxy to unassign"),
|
|
395
|
-
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to unassign proxy for")
|
|
396
|
-
});
|
|
397
|
-
var CreatePositionMetadataSchema = z.object({
|
|
398
|
-
type: z.string(),
|
|
399
|
-
description: z.string(),
|
|
400
|
-
positionMint: z.string().optional()
|
|
401
|
-
});
|
|
402
|
-
var SplitPositionMetadataSchema = z.object({
|
|
403
|
-
type: z.string(),
|
|
404
|
-
description: z.string(),
|
|
405
|
-
newPositionMint: z.string().optional()
|
|
406
|
-
});
|
|
407
|
-
var RelinquishAllVotesMetadataSchema = z.object({
|
|
408
|
-
type: z.string(),
|
|
409
|
-
description: z.string(),
|
|
410
|
-
votesRelinquished: z.number().optional()
|
|
411
|
-
});
|
|
412
|
-
var CreatePositionResponseSchema = createTypedTransactionResponse(
|
|
413
|
-
CreatePositionMetadataSchema
|
|
414
|
-
);
|
|
415
|
-
var ClosePositionResponseSchema = createTransactionResponse();
|
|
416
|
-
var ExtendPositionResponseSchema = createTransactionResponse();
|
|
417
|
-
var FlipLockupKindResponseSchema = createTransactionResponse();
|
|
418
|
-
var ResetLockupResponseSchema = createTransactionResponse();
|
|
419
|
-
var SplitPositionResponseSchema = createTypedTransactionResponse(
|
|
420
|
-
SplitPositionMetadataSchema
|
|
421
|
-
);
|
|
422
|
-
var TransferPositionResponseSchema = createTransactionResponse();
|
|
423
|
-
var ExtendDelegationResponseSchema = createTransactionResponse();
|
|
424
|
-
var DelegatePositionsResponseSchema = createPaginatedTransactionResponse();
|
|
425
|
-
var ClaimDelegationRewardsResponseSchema = createPaginatedTransactionResponse();
|
|
426
|
-
var UndelegatePositionResponseSchema = createPaginatedTransactionResponse();
|
|
427
|
-
var VoteResponseSchema = createPaginatedTransactionResponse();
|
|
428
|
-
var RelinquishVoteResponseSchema = createPaginatedTransactionResponse();
|
|
429
|
-
var RelinquishPositionVotesResponseSchema = createTypedPaginatedTransactionResponse(RelinquishAllVotesMetadataSchema);
|
|
430
|
-
var AssignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
431
|
-
var UnassignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
432
|
-
var HealthResponseSchema = z.object({
|
|
433
|
-
ok: z.boolean(),
|
|
434
|
-
error: z.string().optional()
|
|
435
|
-
});
|
|
436
|
-
var GetBalancesInputSchema = z.object({
|
|
437
|
-
walletAddress: WalletAddressSchema
|
|
438
|
-
});
|
|
439
|
-
var TransferInputSchema = z.object({
|
|
440
|
-
walletAddress: WalletAddressSchema,
|
|
441
|
-
destination: z.string().min(32),
|
|
442
|
-
tokenAmount: TokenAmountInputSchema
|
|
443
|
-
});
|
|
444
|
-
var CreateHntAccountInputSchema = z.object({
|
|
445
|
-
walletAddress: WalletAddressSchema
|
|
446
|
-
});
|
|
447
|
-
var TokenAccountSchema = z.object({
|
|
448
|
-
mint: z.string(),
|
|
449
|
-
address: z.string(),
|
|
450
|
-
balance: z.string(),
|
|
451
|
-
decimals: z.number(),
|
|
452
|
-
uiAmount: z.number(),
|
|
453
|
-
symbol: z.string().optional(),
|
|
454
|
-
name: z.string().optional(),
|
|
455
|
-
logoURI: z.string().optional(),
|
|
456
|
-
priceUsd: z.number().optional(),
|
|
457
|
-
balanceUsd: z.number().optional()
|
|
458
|
-
});
|
|
459
|
-
var TokenBalanceDataSchema = z.object({
|
|
460
|
-
totalBalanceUsd: z.number(),
|
|
461
|
-
solBalance: z.number(),
|
|
462
|
-
solBalanceUsd: z.number(),
|
|
463
|
-
tokens: z.array(TokenAccountSchema)
|
|
464
|
-
});
|
|
465
|
-
var TransferOutputSchema = createTransactionResponse();
|
|
466
|
-
var CreateHntAccountOutputSchema = createTransactionResponse();
|
|
467
|
-
var HotspotTypeSchema = z.enum(["iot", "mobile", "all"]);
|
|
468
|
-
var GetHotspotsInputSchema = z.object({
|
|
469
|
-
walletAddress: WalletAddressSchema,
|
|
470
|
-
type: HotspotTypeSchema.optional(),
|
|
471
|
-
page: z.coerce.number().int().min(1).default(1),
|
|
472
|
-
limit: z.coerce.number().int().min(1).max(100).default(10)
|
|
473
|
-
});
|
|
474
|
-
var ClaimRewardsInputSchema = z.object({
|
|
475
|
-
walletAddress: WalletAddressSchema
|
|
476
|
-
});
|
|
477
|
-
var GetPendingRewardsInputSchema = z.object({
|
|
478
|
-
walletAddress: WalletAddressSchema
|
|
479
|
-
});
|
|
480
|
-
var PendingRewards = z.object({
|
|
481
|
-
total: TokenAmountOutputSchema.describe("Total rewards pending for the requested wallet, including rewards which may be directly claimable or paid indirectly through automation to this wallet."),
|
|
482
|
-
claimable: TokenAmountOutputSchema.describe("Total rewards that can be manually claimed now. Should be a subset of total."),
|
|
483
|
-
automated: TokenAmountOutputSchema.describe("Total rewards that are pending but will be automatically claimed in the future based on existing automation setups. Should be a subset of total.")
|
|
484
|
-
});
|
|
485
|
-
var GetPendingRewardsOutputSchema = z.object({
|
|
486
|
-
pending: PendingRewards.describe("Total rewards pending for the requested wallet - across all relevant hotspots."),
|
|
487
|
-
byHotspot: z.array(z.object({
|
|
488
|
-
hotspotPubKey: HeliumPublicKeySchema,
|
|
489
|
-
pending: PendingRewards
|
|
490
|
-
}))
|
|
491
|
-
});
|
|
492
|
-
var TransferHotspotInputSchema = z.object({
|
|
493
|
-
walletAddress: WalletAddressSchema,
|
|
494
|
-
hotspotPubkey: HeliumPublicKeySchema,
|
|
495
|
-
recipient: WalletAddressSchema
|
|
496
|
-
});
|
|
497
|
-
var UpdateRewardsDestinationInputSchema = z.object({
|
|
498
|
-
walletAddress: WalletAddressSchema,
|
|
499
|
-
hotspotPubkey: HeliumPublicKeySchema,
|
|
500
|
-
destination: WalletAddressSchema,
|
|
501
|
-
lazyDistributors: z.array(z.string().min(32)).min(1)
|
|
502
|
-
});
|
|
503
|
-
var GetSplitInputSchema = z.object({
|
|
504
|
-
walletAddress: WalletAddressSchema,
|
|
505
|
-
hotspotPubkey: HeliumPublicKeySchema
|
|
506
|
-
});
|
|
507
|
-
var CreateSplitInputSchema = z.object({
|
|
508
|
-
walletAddress: WalletAddressSchema,
|
|
509
|
-
hotspotPubkey: HeliumPublicKeySchema,
|
|
510
|
-
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
511
|
-
schedule: ScheduleInputSchema,
|
|
512
|
-
lazyDistributor: z.string().min(32)
|
|
513
|
-
});
|
|
514
|
-
var DeleteSplitInputSchema = z.object({
|
|
515
|
-
walletAddress: WalletAddressSchema,
|
|
516
|
-
hotspotPubkey: HeliumPublicKeySchema
|
|
517
|
-
});
|
|
518
|
-
var GetAutomationStatusInputSchema = z.object({
|
|
519
|
-
walletAddress: WalletAddressSchema
|
|
520
|
-
});
|
|
521
|
-
var AutomationScheduleSchema = z.enum(["daily", "weekly", "monthly"]);
|
|
522
|
-
var SetupAutomationInputSchema = z.object({
|
|
523
|
-
walletAddress: WalletAddressSchema,
|
|
524
|
-
schedule: AutomationScheduleSchema,
|
|
525
|
-
duration: z.number().int().min(1),
|
|
526
|
-
// Number of claims
|
|
527
|
-
totalHotspots: z.number().int().min(1)
|
|
528
|
-
});
|
|
529
|
-
var FundAutomationInputSchema = z.object({
|
|
530
|
-
walletAddress: WalletAddressSchema,
|
|
531
|
-
additionalDuration: z.number().int().min(1)
|
|
532
|
-
// Additional number of claims
|
|
533
|
-
});
|
|
534
|
-
var GetFundingEstimateInputSchema = z.object({
|
|
535
|
-
walletAddress: WalletAddressSchema,
|
|
536
|
-
duration: z.coerce.number().int().min(1)
|
|
537
|
-
// Number of claims to estimate funding for
|
|
538
|
-
});
|
|
539
|
-
var CloseAutomationInputSchema = z.object({
|
|
540
|
-
walletAddress: WalletAddressSchema
|
|
541
|
-
});
|
|
542
|
-
var DeviceTypeSchema = z.enum([
|
|
543
|
-
"iot-gateway",
|
|
544
|
-
"wifiIndoor",
|
|
545
|
-
"wifiOutdoor",
|
|
546
|
-
"wifiDataOnly",
|
|
547
|
-
"cbrs"
|
|
548
|
-
]);
|
|
549
|
-
var OwnershipTypeSchema = z.enum(["owner", "direct", "fanout", "all"]);
|
|
550
|
-
var HotspotSharesSchema = z.object({
|
|
551
|
-
fixed: z.string().optional(),
|
|
552
|
-
percentage: z.number().optional()
|
|
553
|
-
});
|
|
554
|
-
var HotspotSchema = z.object({
|
|
555
|
-
address: z.string(),
|
|
556
|
-
entityKey: z.string(),
|
|
557
|
-
name: z.string(),
|
|
558
|
-
type: HotspotTypeSchema,
|
|
559
|
-
deviceType: DeviceTypeSchema,
|
|
560
|
-
city: z.string().optional(),
|
|
561
|
-
state: z.string().optional(),
|
|
562
|
-
country: z.string().optional(),
|
|
563
|
-
asset: z.string(),
|
|
564
|
-
isOnline: z.boolean().optional(),
|
|
565
|
-
owner: z.string().optional(),
|
|
566
|
-
shares: HotspotSharesSchema.optional(),
|
|
567
|
-
ownershipType: z.string()
|
|
568
|
-
});
|
|
569
|
-
var HotspotsDataSchema = z.object({
|
|
570
|
-
hotspots: z.array(HotspotSchema),
|
|
571
|
-
total: z.number(),
|
|
572
|
-
page: z.number(),
|
|
573
|
-
totalPages: z.number()
|
|
574
|
-
});
|
|
575
|
-
var ClaimRewardsOutputSchema = createTransactionResponse();
|
|
576
|
-
var TransferHotspotOutputSchema = createTransactionResponse();
|
|
577
|
-
var UpdateRewardsDestinationOutputSchema = createTransactionResponse();
|
|
578
|
-
var CreateSplitOutputSchema = createTransactionResponse();
|
|
579
|
-
var DeleteSplitOutputSchema = createTransactionResponse();
|
|
580
|
-
var SetupAutomationOutputSchema = createTransactionResponse();
|
|
581
|
-
var FundAutomationOutputSchema = createTransactionResponse();
|
|
582
|
-
var CloseAutomationOutputSchema = createTransactionResponse();
|
|
583
|
-
var SplitShareSchema = z.object({
|
|
584
|
-
wallet: z.string(),
|
|
585
|
-
delegate: z.string(),
|
|
586
|
-
fixed: TokenAmountOutputSchema,
|
|
587
|
-
shares: z.number()
|
|
588
|
-
});
|
|
589
|
-
var SplitResponseSchema = z.object({
|
|
590
|
-
walletAddress: z.string(),
|
|
591
|
-
hotspotPubkey: z.string(),
|
|
592
|
-
splitAddress: z.string(),
|
|
593
|
-
shares: z.array(SplitShareSchema)
|
|
594
|
-
});
|
|
595
|
-
var AutomationStatusOutputSchema = z.object({
|
|
596
|
-
hasExistingAutomation: z.boolean(),
|
|
597
|
-
isOutOfSol: z.boolean(),
|
|
598
|
-
currentSchedule: z.object({
|
|
599
|
-
schedule: AutomationScheduleSchema,
|
|
600
|
-
time: z.string(),
|
|
601
|
-
nextRun: z.string()
|
|
602
|
-
// ISO date string
|
|
603
|
-
}).optional(),
|
|
604
|
-
rentFee: z.number(),
|
|
605
|
-
// Initial setup rent (BASE_AUTOMATION_RENT + TASK_RETURN_ACCOUNT_SIZE) if automation doesn't exist, 0 otherwise
|
|
606
|
-
recipientFee: z.number(),
|
|
607
|
-
// SOL needed for recipient accounts (if any)
|
|
608
|
-
operationalSol: z.number(),
|
|
609
|
-
// Total operational SOL needed for automation claims (cronJobFunding + pdaWalletFunding)
|
|
610
|
-
remainingClaims: z.number().optional(),
|
|
611
|
-
fundingPeriodInfo: z.object({
|
|
612
|
-
periodLength: AutomationScheduleSchema,
|
|
613
|
-
periodsRemaining: z.number(),
|
|
614
|
-
// Minimum of both pools
|
|
615
|
-
cronJobPeriodsRemaining: z.number(),
|
|
616
|
-
pdaWalletPeriodsRemaining: z.number()
|
|
617
|
-
}).optional(),
|
|
618
|
-
cronJobBalance: z.string(),
|
|
619
|
-
// lamports as string
|
|
620
|
-
pdaWalletBalance: z.string()
|
|
621
|
-
// lamports as string
|
|
622
|
-
});
|
|
623
|
-
var FundingEstimateOutputSchema = z.object({
|
|
624
|
-
rentFee: z.number(),
|
|
625
|
-
// Initial setup rent (BASE_AUTOMATION_RENT + TASK_RETURN_ACCOUNT_SIZE) if automation doesn't exist, 0 otherwise
|
|
626
|
-
cronJobFunding: z.number(),
|
|
627
|
-
// SOL needed for cron job account operations
|
|
628
|
-
pdaWalletFunding: z.number(),
|
|
629
|
-
// SOL needed for PDA wallet operations
|
|
630
|
-
recipientFee: z.number(),
|
|
631
|
-
// SOL needed for recipient accounts (if any)
|
|
632
|
-
operationalSol: z.number(),
|
|
633
|
-
// Total operational SOL needed for automation claims (cronJobFunding + pdaWalletFunding)
|
|
634
|
-
totalSolNeeded: z.number(),
|
|
635
|
-
// Total SOL needed including all fees (rentFee + operationalSol + recipientFee)
|
|
636
|
-
currentCronJobBalance: z.string(),
|
|
637
|
-
// Current balance in cronJob (lamports as string)
|
|
638
|
-
currentPdaWalletBalance: z.string()
|
|
639
|
-
// Current balance in pdaWallet (lamports as string)
|
|
640
|
-
});
|
|
641
|
-
var WifiDeploymentInfoSchema = z.object({
|
|
642
|
-
type: z.literal("WIFI"),
|
|
643
|
-
antenna: z.number().int().optional(),
|
|
644
|
-
elevation: z.number().optional(),
|
|
645
|
-
azimuth: z.number().min(0).max(360).optional(),
|
|
646
|
-
mechanicalDownTilt: z.number().optional(),
|
|
647
|
-
electricalDownTilt: z.number().optional(),
|
|
648
|
-
serial: z.string().optional().nullable()
|
|
649
|
-
});
|
|
650
|
-
var CbrsRadioInfoSchema = z.object({
|
|
651
|
-
radioId: z.string(),
|
|
652
|
-
elevation: z.number()
|
|
653
|
-
});
|
|
654
|
-
var CbrsDeploymentInfoSchema = z.object({
|
|
655
|
-
type: z.literal("CBRS"),
|
|
656
|
-
radioInfos: z.array(CbrsRadioInfoSchema).min(1)
|
|
657
|
-
});
|
|
658
|
-
var DeploymentInfoSchema = z.discriminatedUnion("type", [
|
|
659
|
-
WifiDeploymentInfoSchema,
|
|
660
|
-
CbrsDeploymentInfoSchema
|
|
661
|
-
]);
|
|
662
|
-
var LocationSchema = z.object({
|
|
663
|
-
lat: z.number().min(-90).max(90),
|
|
664
|
-
lng: z.number().min(-180).max(180)
|
|
665
|
-
});
|
|
666
|
-
var IotUpdateSchema = z.object({
|
|
667
|
-
deviceType: z.literal("iot"),
|
|
668
|
-
entityPubKey: HeliumPublicKeySchema,
|
|
669
|
-
walletAddress: WalletAddressSchema,
|
|
670
|
-
location: LocationSchema.optional(),
|
|
671
|
-
gain: z.number().optional(),
|
|
672
|
-
elevation: z.number().optional(),
|
|
673
|
-
azimuth: z.number().min(0).max(360).optional()
|
|
674
|
-
});
|
|
675
|
-
var MobileUpdateSchema = z.object({
|
|
676
|
-
deviceType: z.literal("mobile"),
|
|
677
|
-
entityPubKey: HeliumPublicKeySchema,
|
|
678
|
-
walletAddress: WalletAddressSchema,
|
|
679
|
-
location: LocationSchema.optional(),
|
|
680
|
-
deploymentInfo: DeploymentInfoSchema.optional()
|
|
681
|
-
});
|
|
682
|
-
var UpdateHotspotInfoInputSchema = z.discriminatedUnion("deviceType", [
|
|
683
|
-
IotUpdateSchema,
|
|
684
|
-
MobileUpdateSchema
|
|
685
|
-
]);
|
|
686
|
-
var UpdateHotspotInfoOutputSchema = createTransactionResponse().extend({
|
|
687
|
-
appliedTo: z.object({
|
|
688
|
-
iot: z.boolean(),
|
|
689
|
-
mobile: z.boolean()
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
var CRON_REGEX = /^(\*|[0-9,\-\/]+)\s+(\*|[0-9,\-\/]+)\s+(\*|[0-9,\-\/]+)\s+(\*|[0-9,\-\/]+)\s+(\*|[0-9,\-\/]+)$/;
|
|
693
|
-
var RewardSchedule = z.string().regex(
|
|
694
|
-
CRON_REGEX,
|
|
695
|
-
"Invalid cron format. Expected 5 fields: minute hour day month weekday"
|
|
696
|
-
).describe(
|
|
697
|
-
`UTC cron expression with 5 fields (e.g. '30 9 * * *' or '0 0 1,15 * *')`
|
|
698
|
-
);
|
|
699
|
-
var RecipientShareInput = z.discriminatedUnion("type", [
|
|
700
|
-
z.object({
|
|
701
|
-
type: z.literal("FIXED"),
|
|
702
|
-
tokenAmount: TokenAmountInputSchema
|
|
703
|
-
}),
|
|
704
|
-
z.object({
|
|
705
|
-
type: z.literal("SHARES"),
|
|
706
|
-
shares: z.number().int().min(1).max(100).describe("Percentage share of rewards")
|
|
707
|
-
})
|
|
708
|
-
]);
|
|
709
|
-
var RecipientShareOutput = z.discriminatedUnion("type", [
|
|
710
|
-
z.object({
|
|
711
|
-
type: z.literal("FIXED"),
|
|
712
|
-
tokenAmount: TokenAmountOutputSchema
|
|
713
|
-
}),
|
|
714
|
-
z.object({
|
|
715
|
-
type: z.literal("SHARES"),
|
|
716
|
-
shares: z.number().int().min(1).max(100).describe("Percentage share of rewards")
|
|
717
|
-
})
|
|
718
|
-
]);
|
|
719
|
-
var RecipientConfigInput = z.discriminatedUnion("type", [
|
|
720
|
-
z.object({
|
|
721
|
-
type: z.literal("PRESET"),
|
|
722
|
-
walletAddress: WalletAddressSchema.describe(
|
|
723
|
-
"The wallet address of a preconfigured recipient"
|
|
724
|
-
),
|
|
725
|
-
receives: RecipientShareInput
|
|
726
|
-
}).describe("A recipient that uses a preset configuration"),
|
|
727
|
-
z.object({
|
|
728
|
-
type: z.literal("CLAIMABLE"),
|
|
729
|
-
giftedCurrency: TokenAmountInputSchema.describe(
|
|
730
|
-
"The amount of currency bundled in the contract, and gifted to the claimer upon creation"
|
|
731
|
-
),
|
|
732
|
-
receives: RecipientShareInput
|
|
733
|
-
}).describe(
|
|
734
|
-
"A recipient that in yet unknown, but will claim the pending contract"
|
|
735
|
-
)
|
|
736
|
-
]);
|
|
737
|
-
var RecipientConfigOutput = z.discriminatedUnion("type", [
|
|
738
|
-
z.object({
|
|
739
|
-
type: z.literal("PRESET"),
|
|
740
|
-
walletAddress: WalletAddressSchema.describe(
|
|
741
|
-
"The wallet address of a preconfigured recipient"
|
|
742
|
-
),
|
|
743
|
-
receives: RecipientShareOutput
|
|
744
|
-
}).describe("A recipient that uses a preset configuration"),
|
|
745
|
-
z.object({
|
|
746
|
-
type: z.literal("CLAIMABLE"),
|
|
747
|
-
giftedCurrency: TokenAmountOutputSchema.describe(
|
|
748
|
-
"The amount of currency bundled in the contract, and gifted to the claimer upon creation"
|
|
749
|
-
),
|
|
750
|
-
receives: RecipientShareOutput
|
|
751
|
-
}).describe(
|
|
752
|
-
"A recipient that in yet unknown, but will claim the pending contract"
|
|
753
|
-
)
|
|
754
|
-
]);
|
|
755
|
-
var PendingRewardContract = z.object({
|
|
756
|
-
delegateWalletAddress: WalletAddressSchema.describe(
|
|
757
|
-
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the pending contract."
|
|
758
|
-
),
|
|
759
|
-
recipients: z.array(RecipientConfigOutput).min(1).max(6).describe(
|
|
760
|
-
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
761
|
-
),
|
|
762
|
-
rewardSchedule: RewardSchedule.describe(
|
|
763
|
-
"The schedule on which rewards would be distributed to recipients"
|
|
764
|
-
)
|
|
765
|
-
});
|
|
766
|
-
var ActiveRewardContract = z.object({
|
|
767
|
-
delegateWalletAddress: WalletAddressSchema.describe(
|
|
768
|
-
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the active contract."
|
|
769
|
-
),
|
|
770
|
-
entityOwnerAddress: WalletAddressSchema.describe(
|
|
771
|
-
"The wallet address that owns the entity (hotspot)"
|
|
772
|
-
),
|
|
773
|
-
recipients: z.array(
|
|
774
|
-
z.object({
|
|
775
|
-
walletAddress: WalletAddressSchema.describe(
|
|
776
|
-
"The wallet address of the reward recipient"
|
|
777
|
-
),
|
|
778
|
-
receives: RecipientShareOutput
|
|
779
|
-
})
|
|
780
|
-
).min(1).max(6).describe(
|
|
781
|
-
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
782
|
-
),
|
|
783
|
-
rewardSchedule: RewardSchedule.describe(
|
|
784
|
-
"The schedule on which rewards are distributed to recipients"
|
|
785
|
-
)
|
|
786
|
-
});
|
|
787
|
-
var FindRewardContractResponseSchema = z.discriminatedUnion("status", [
|
|
788
|
-
z.object({
|
|
789
|
-
status: z.literal("PENDING"),
|
|
790
|
-
contract: PendingRewardContract
|
|
791
|
-
}),
|
|
792
|
-
z.object({
|
|
793
|
-
status: z.literal("ACTIVE"),
|
|
794
|
-
contract: ActiveRewardContract
|
|
795
|
-
}),
|
|
796
|
-
z.object({
|
|
797
|
-
status: z.literal("NONE")
|
|
798
|
-
})
|
|
799
|
-
]);
|
|
800
|
-
var CreateRewardContractTransactionInputSchema = z.object({
|
|
801
|
-
delegateWalletAddress: WalletAddressSchema.describe(
|
|
802
|
-
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the contract."
|
|
803
|
-
),
|
|
804
|
-
recipients: z.array(RecipientConfigInput).min(1).max(6).refine((arr) => arr.filter((s) => s.type === "CLAIMABLE").length <= 1, {
|
|
805
|
-
message: "At most one recipient can be of type CLAIMABLE."
|
|
806
|
-
}).refine(
|
|
807
|
-
(arr) => {
|
|
808
|
-
const shareEntries = arr.filter((s) => s.receives.type === "SHARES");
|
|
809
|
-
if (shareEntries.length === 0) {
|
|
810
|
-
return true;
|
|
811
|
-
}
|
|
812
|
-
return shareEntries.reduce(
|
|
813
|
-
(acc, curr) => acc + (curr.receives.type === "SHARES" ? curr.receives.shares : 0),
|
|
814
|
-
0
|
|
815
|
-
) === 100;
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
message: "Total shares must equal 100."
|
|
819
|
-
}
|
|
820
|
-
).describe(
|
|
821
|
-
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
822
|
-
),
|
|
823
|
-
rewardSchedule: RewardSchedule.describe(
|
|
824
|
-
"The schedule on which rewards would be distributed to recipients"
|
|
825
|
-
)
|
|
826
|
-
});
|
|
827
|
-
var EstimateCostToCreateRewardContractResponseSchema = z.object({
|
|
828
|
-
total: TokenAmountOutputSchema.describe("The total cost to create the contract."),
|
|
829
|
-
lineItems: z.object({
|
|
830
|
-
transactionFees: TokenAmountOutputSchema.describe("The cost of transaction fees, including funding for future scheduled transactions."),
|
|
831
|
-
rentFee: TokenAmountOutputSchema.describe("The cost of the rent fee."),
|
|
832
|
-
recipientGift: TokenAmountOutputSchema.describe("The total cost of gifted currency, bundled with the contract.")
|
|
833
|
-
}).describe("A breakdown of the costs invovled. Should sum to the total cost.")
|
|
834
|
-
});
|
|
835
|
-
var CreateRewardContractTransactionResponseSchema = z.object({
|
|
836
|
-
unsignedTransactionData: TransactionDataSchema.describe(
|
|
837
|
-
"The unsigned transaction data which, when signed and submitted will create the pending or finalized reward contract"
|
|
838
|
-
),
|
|
839
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
840
|
-
});
|
|
841
|
-
var DeleteRewardContractTransactionResponseSchema = z.object({
|
|
842
|
-
unsignedTransactionData: TransactionDataSchema.describe(
|
|
843
|
-
"The unsigned transaction data which, when signed and submitted will delete the contract"
|
|
844
|
-
),
|
|
845
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
846
|
-
});
|
|
847
|
-
var CreateInviteResponseSchema = z.object({
|
|
848
|
-
unsignedMessage: z.string().min(1).describe(
|
|
849
|
-
"The unsigned invite message which, when signed by the delegate's wallet, can be used by a recipient to claim the pending contract."
|
|
850
|
-
),
|
|
851
|
-
expiration: z.iso.datetime()
|
|
852
|
-
});
|
|
853
|
-
var ClaimInviteRequestSchema = z.object({
|
|
854
|
-
delegateSignature: z.string().min(1).describe("The signed invite message provided by the contract delegate."),
|
|
855
|
-
expiration: z.iso.datetime()
|
|
856
|
-
});
|
|
857
|
-
var ClaimInviteResponseSchema = z.object({
|
|
858
|
-
unsignedTransactionData: TransactionDataSchema.describe(
|
|
859
|
-
"The unsigned transaction data which, when signed and submitted will claim the pending reward contract"
|
|
860
|
-
),
|
|
861
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
862
|
-
});
|
|
863
|
-
var SubmitInputSchema = z.object({
|
|
864
|
-
transactions: z.array(TransactionItemSchema),
|
|
865
|
-
parallel: z.boolean(),
|
|
866
|
-
tag: z.string().optional(),
|
|
867
|
-
simulationCommitment: z.enum(["confirmed", "finalized"]).optional().default("confirmed"),
|
|
868
|
-
simulate: z.boolean().optional().default(true)
|
|
869
|
-
});
|
|
870
|
-
var GetInputSchema = z.object({
|
|
871
|
-
id: z.string(),
|
|
872
|
-
commitment: z.enum(["confirmed", "finalized"])
|
|
873
|
-
});
|
|
874
|
-
var ResubmitInputSchema = z.object({
|
|
875
|
-
id: z.string()
|
|
876
|
-
});
|
|
877
|
-
var GetByPayerInputSchema = z.object({
|
|
878
|
-
payer: z.string().min(32),
|
|
879
|
-
page: z.coerce.number().int().min(1).default(1),
|
|
880
|
-
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
881
|
-
status: z.string().optional().default("pending")
|
|
882
|
-
});
|
|
883
|
-
var GetByPayerAndTagInputSchema = z.object({
|
|
884
|
-
payer: z.string().min(32),
|
|
885
|
-
tag: z.string(),
|
|
886
|
-
page: z.coerce.number().int().min(1).default(1),
|
|
887
|
-
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
888
|
-
status: z.string().optional().default("pending")
|
|
889
|
-
});
|
|
890
|
-
var SubmitOutputSchema = z.object({
|
|
891
|
-
batchId: z.string(),
|
|
892
|
-
message: z.string().optional()
|
|
893
|
-
});
|
|
894
|
-
var TransactionStateSchema = z.union([
|
|
895
|
-
z.literal("pending"),
|
|
896
|
-
z.literal("confirmed"),
|
|
897
|
-
z.literal("failed"),
|
|
898
|
-
z.literal("expired"),
|
|
899
|
-
z.literal("partial")
|
|
900
|
-
]);
|
|
901
|
-
var TransactionStatusSchema = z.object({
|
|
902
|
-
signature: z.string(),
|
|
903
|
-
status: TransactionStateSchema,
|
|
904
|
-
transaction: z.unknown().optional()
|
|
905
|
-
});
|
|
906
|
-
var BatchStatusOutputSchema = z.object({
|
|
907
|
-
batchId: z.string(),
|
|
908
|
-
status: TransactionStateSchema,
|
|
909
|
-
submissionType: z.union([
|
|
910
|
-
z.literal("single"),
|
|
911
|
-
z.literal("parallel"),
|
|
912
|
-
z.literal("sequential"),
|
|
913
|
-
z.literal("jito_bundle")
|
|
914
|
-
]),
|
|
915
|
-
parallel: z.boolean(),
|
|
916
|
-
transactions: z.array(TransactionStatusSchema),
|
|
917
|
-
jitoBundleId: z.string().optional().nullable(),
|
|
918
|
-
jitoBundleStatus: z.unknown().optional().nullable()
|
|
919
|
-
});
|
|
920
|
-
var ResubmitOutputSchema = z.object({
|
|
921
|
-
success: z.boolean(),
|
|
922
|
-
message: z.string(),
|
|
923
|
-
error: z.string().optional(),
|
|
924
|
-
newSignatures: z.array(z.string()).optional()
|
|
925
|
-
});
|
|
926
|
-
var PayerBatchSummarySchema = z.object({
|
|
927
|
-
batchId: z.string(),
|
|
928
|
-
tag: z.string().optional(),
|
|
929
|
-
status: z.string(),
|
|
930
|
-
submissionType: z.string(),
|
|
931
|
-
parallel: z.boolean(),
|
|
932
|
-
createdAt: z.string(),
|
|
933
|
-
updatedAt: z.string(),
|
|
934
|
-
transactions: z.array(
|
|
935
|
-
z.object({
|
|
936
|
-
metadata: TransactionMetadataSchema.optional()
|
|
937
|
-
})
|
|
938
|
-
)
|
|
939
|
-
});
|
|
940
|
-
var PayerBatchesOutputSchema = z.object({
|
|
941
|
-
payer: z.string(),
|
|
942
|
-
batches: z.array(PayerBatchSummarySchema),
|
|
943
|
-
pagination: z.object({
|
|
944
|
-
page: z.number(),
|
|
945
|
-
limit: z.number(),
|
|
946
|
-
total: z.number(),
|
|
947
|
-
totalPages: z.number()
|
|
948
|
-
})
|
|
949
|
-
});
|
|
950
|
-
var EstimateInputSchema = z.object({
|
|
951
|
-
transactions: z.array(TransactionItemSchema),
|
|
952
|
-
parallel: z.boolean(),
|
|
953
|
-
tag: z.string().optional(),
|
|
954
|
-
simulationCommitment: z.enum(["confirmed", "finalized"]).optional().default("confirmed")
|
|
955
|
-
});
|
|
956
|
-
var CostBreakdownSchema = z.object({
|
|
957
|
-
transactionFees: TokenAmountOutputSchema,
|
|
958
|
-
rent: TokenAmountOutputSchema,
|
|
959
|
-
tokenTransfers: z.array(TokenAmountOutputSchema)
|
|
960
|
-
});
|
|
961
|
-
var TransactionEstimateSchema = z.object({
|
|
962
|
-
index: z.number(),
|
|
963
|
-
computeUnits: z.number(),
|
|
964
|
-
success: z.boolean(),
|
|
965
|
-
error: z.string().optional(),
|
|
966
|
-
logs: z.array(z.string()).optional(),
|
|
967
|
-
costs: CostBreakdownSchema
|
|
968
|
-
});
|
|
969
|
-
var EstimateOutputSchema = z.object({
|
|
970
|
-
totalSol: TokenAmountOutputSchema,
|
|
971
|
-
breakdown: CostBreakdownSchema,
|
|
972
|
-
transactions: z.array(TransactionEstimateSchema)
|
|
973
|
-
});
|
|
974
|
-
var WelcomePackListInputSchema = z.object({
|
|
975
|
-
walletAddress: WalletAddressSchema
|
|
976
|
-
});
|
|
977
|
-
var WelcomePackCreateInputSchema = z.object({
|
|
978
|
-
walletAddress: WalletAddressSchema,
|
|
979
|
-
assetId: z.string(),
|
|
980
|
-
solAmount: TokenAmountInputSchema,
|
|
981
|
-
rentRefund: z.string(),
|
|
982
|
-
assetReturnAddress: z.string(),
|
|
983
|
-
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
984
|
-
schedule: ScheduleInputSchema,
|
|
985
|
-
lazyDistributor: z.string()
|
|
986
|
-
});
|
|
987
|
-
var WelcomePackGetInputSchema = z.object({
|
|
988
|
-
walletAddress: WalletAddressSchema,
|
|
989
|
-
packId: z.number()
|
|
990
|
-
});
|
|
991
|
-
var WelcomePackDeleteInputSchema = z.object({
|
|
992
|
-
walletAddress: WalletAddressSchema,
|
|
993
|
-
packId: z.number()
|
|
994
|
-
});
|
|
995
|
-
var WelcomePackGetByAddressInputSchema = z.object({
|
|
996
|
-
packAddress: z.string().min(32)
|
|
997
|
-
});
|
|
998
|
-
var WelcomePackClaimInputSchema = z.object({
|
|
999
|
-
packAddress: z.string().min(32),
|
|
1000
|
-
walletAddress: WalletAddressSchema,
|
|
1001
|
-
signature: z.string(),
|
|
1002
|
-
expirationTs: z.string()
|
|
1003
|
-
});
|
|
1004
|
-
var WelcomePackInviteInputSchema = z.object({
|
|
1005
|
-
packAddress: z.string().min(32),
|
|
1006
|
-
walletAddress: WalletAddressSchema,
|
|
1007
|
-
expirationDays: z.number().int().positive().max(365).default(7)
|
|
1008
|
-
});
|
|
1009
|
-
var WelcomePackSchema = z.object({
|
|
1010
|
-
address: z.string(),
|
|
1011
|
-
id: z.number(),
|
|
1012
|
-
owner: z.string(),
|
|
1013
|
-
asset: z.string(),
|
|
1014
|
-
lazyDistributor: z.string(),
|
|
1015
|
-
rewardsMint: z.string(),
|
|
1016
|
-
rentRefund: z.string(),
|
|
1017
|
-
solAmount: z.string(),
|
|
1018
|
-
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
1019
|
-
rewardsSchedule: z.string(),
|
|
1020
|
-
assetReturnAddress: z.string(),
|
|
1021
|
-
bumpSeed: z.number(),
|
|
1022
|
-
uniqueId: z.string(),
|
|
1023
|
-
loading: z.boolean().optional(),
|
|
1024
|
-
hotspot: HotspotSchema.nullable()
|
|
1025
|
-
});
|
|
1026
|
-
var WelcomePackListOutputSchema = z.array(WelcomePackSchema);
|
|
1027
|
-
var WelcomePackCreateOutputSchema = createTransactionResponse().extend({
|
|
1028
|
-
welcomePack: WelcomePackSchema
|
|
1029
|
-
});
|
|
1030
|
-
var WelcomePackDeleteOutputSchema = createTransactionResponse();
|
|
1031
|
-
var WelcomePackClaimOutputSchema = createTransactionResponse();
|
|
1032
|
-
var WelcomePackInviteOutputSchema = z.object({
|
|
1033
|
-
message: z.string(),
|
|
1034
|
-
expirationTs: z.number()
|
|
1035
|
-
});
|
|
1036
|
-
var MigrateInputSchema = z.object({
|
|
1037
|
-
sourceWallet: WalletAddressSchema,
|
|
1038
|
-
destinationWallet: WalletAddressSchema,
|
|
1039
|
-
hotspots: z.array(z.string()).default([]),
|
|
1040
|
-
tokens: z.array(
|
|
1041
|
-
z.object({
|
|
1042
|
-
mint: z.string(),
|
|
1043
|
-
amount: z.string()
|
|
1044
|
-
})
|
|
1045
|
-
).default([]),
|
|
1046
|
-
password: z.string().optional()
|
|
1047
|
-
});
|
|
1048
|
-
var MigrateTransactionItemSchema = z.object({
|
|
1049
|
-
serializedTransaction: z.string(),
|
|
1050
|
-
metadata: TransactionMetadataSchema.extend({
|
|
1051
|
-
signers: z.array(z.enum(["source", "destination"]))
|
|
1052
|
-
}).optional()
|
|
1053
|
-
});
|
|
1054
|
-
var MigrateTransactionDataSchema = z.object({
|
|
1055
|
-
transactions: z.array(MigrateTransactionItemSchema),
|
|
1056
|
-
parallel: z.boolean(),
|
|
1057
|
-
tag: z.string().optional()
|
|
1058
|
-
});
|
|
1059
|
-
var MigrateOutputSchema = z.object({
|
|
1060
|
-
transactionData: MigrateTransactionDataSchema,
|
|
1061
|
-
estimatedSolFee: TokenAmountOutputSchema,
|
|
1062
|
-
warnings: z.array(z.string()).optional(),
|
|
1063
|
-
hasMore: z.boolean().optional().describe(
|
|
1064
|
-
"True if more work remains \u2014 submit these transactions, then call again with nextParams."
|
|
1065
|
-
),
|
|
1066
|
-
nextParams: MigrateInputSchema.optional().describe(
|
|
1067
|
-
"Input for the next call. Present when hasMore is true \u2014 pass directly to the next migrate call."
|
|
1068
|
-
)
|
|
1069
|
-
});
|
|
1070
|
-
var MigratableHotspotSchema = HotspotSchema.extend({
|
|
1071
|
-
inWelcomePack: z.boolean(),
|
|
1072
|
-
splitWallets: z.array(z.string()).optional()
|
|
1073
|
-
});
|
|
1074
|
-
var MigratableHotspotsInputSchema = z.object({
|
|
1075
|
-
walletAddress: WalletAddressSchema
|
|
1076
|
-
});
|
|
1077
|
-
var MigratableHotspotsOutputSchema = z.object({
|
|
1078
|
-
hotspots: z.array(MigratableHotspotSchema)
|
|
1079
|
-
});
|
|
1080
|
-
var UNAUTHENTICATED = {
|
|
1081
|
-
status: 401,
|
|
1082
|
-
message: "Authentication required. Please sign in to continue."
|
|
1083
|
-
};
|
|
1084
|
-
var UNAUTHORIZED = {
|
|
1085
|
-
status: 403,
|
|
1086
|
-
message: "You do not have permission to access this resource."
|
|
1087
|
-
};
|
|
1088
|
-
var NOT_FOUND = {
|
|
1089
|
-
status: 404,
|
|
1090
|
-
message: "The requested resource was not found."
|
|
1091
|
-
};
|
|
1092
|
-
var BAD_REQUEST = {
|
|
1093
|
-
status: 400,
|
|
1094
|
-
message: "Invalid input data provided.",
|
|
1095
|
-
data: z.object({
|
|
1096
|
-
fields: z.array(z.string()).optional()
|
|
1097
|
-
}).optional()
|
|
1098
|
-
};
|
|
1099
|
-
var INVALID_WALLET_ADDRESS = {
|
|
1100
|
-
status: 400,
|
|
1101
|
-
message: "The provided wallet address is invalid."
|
|
1102
|
-
};
|
|
1103
|
-
var RATE_LIMITED = {
|
|
1104
|
-
status: 429,
|
|
1105
|
-
message: "Too many requests. Please try again later."
|
|
1106
|
-
};
|
|
1107
|
-
var CONFLICT = {
|
|
1108
|
-
status: 409,
|
|
1109
|
-
message: "A resource with this identifier already exists."
|
|
1110
|
-
};
|
|
1111
|
-
var INSUFFICIENT_FUNDS = {
|
|
1112
|
-
status: 400,
|
|
1113
|
-
message: "Insufficient SOL balance to complete this transaction.",
|
|
1114
|
-
data: z.object({
|
|
1115
|
-
required: z.number(),
|
|
1116
|
-
available: z.number()
|
|
1117
|
-
})
|
|
1118
|
-
};
|
|
1119
|
-
var TRANSACTION_FAILED = {
|
|
1120
|
-
status: 500,
|
|
1121
|
-
message: "Transaction failed to execute.",
|
|
1122
|
-
data: z.object({
|
|
1123
|
-
logs: z.array(z.string()).optional(),
|
|
1124
|
-
signature: z.string().optional()
|
|
1125
|
-
})
|
|
1126
|
-
};
|
|
1127
|
-
var SIMULATION_FAILED = {
|
|
1128
|
-
status: 400,
|
|
1129
|
-
message: "Transaction simulation failed.",
|
|
1130
|
-
data: z.object({
|
|
1131
|
-
logs: z.array(z.string()).optional(),
|
|
1132
|
-
link: z.string().optional()
|
|
1133
|
-
})
|
|
1134
|
-
};
|
|
1135
|
-
var healthContract = oc.tag("Health").router({
|
|
1136
|
-
check: oc.route({ method: "GET", path: "/health", summary: "Health check" }).output(HealthResponseSchema),
|
|
1137
|
-
testSentry: oc.route({
|
|
1138
|
-
method: "GET",
|
|
1139
|
-
path: "/health/test-sentry",
|
|
1140
|
-
summary: "Test Sentry error reporting"
|
|
1141
|
-
}).output(HealthResponseSchema)
|
|
1142
|
-
});
|
|
1143
|
-
var tokensContract = oc.tag("Tokens").router({
|
|
1144
|
-
/** Public: Get token balances for a wallet */
|
|
1145
|
-
getBalances: oc.route({ method: "GET", path: "/tokens/{walletAddress}", summary: "Get token balances for a wallet" }).input(GetBalancesInputSchema).output(TokenBalanceDataSchema).errors({
|
|
1146
|
-
INVALID_WALLET_ADDRESS
|
|
1147
|
-
}),
|
|
1148
|
-
/** Protected: Transfer tokens */
|
|
1149
|
-
transfer: oc.route({ method: "POST", path: "/tokens/transfer", summary: "Transfer tokens" }).input(TransferInputSchema).output(TransferOutputSchema).errors({
|
|
1150
|
-
BAD_REQUEST,
|
|
1151
|
-
INSUFFICIENT_FUNDS
|
|
1152
|
-
}),
|
|
1153
|
-
/** Protected: Create HNT account */
|
|
1154
|
-
createHntAccount: oc.route({ method: "POST", path: "/tokens/hnt-account", summary: "Create HNT account" }).input(CreateHntAccountInputSchema).output(CreateHntAccountOutputSchema).errors({
|
|
1155
|
-
INVALID_WALLET_ADDRESS,
|
|
1156
|
-
INSUFFICIENT_FUNDS
|
|
1157
|
-
})
|
|
1158
|
-
});
|
|
1159
|
-
var hotspotsContract = oc.tag("Hotspot").prefix("/hotspots").router({
|
|
1160
|
-
/** Public: Get hotspots for a wallet */
|
|
1161
|
-
getHotspots: oc.route({ method: "GET", path: "/wallet/{walletAddress}", summary: "Get hotspots for a wallet" }).input(GetHotspotsInputSchema).output(HotspotsDataSchema).errors({
|
|
1162
|
-
INVALID_WALLET_ADDRESS
|
|
1163
|
-
}),
|
|
1164
|
-
/** Protected: Claim rewards for hotspots */
|
|
1165
|
-
claimRewards: oc.route({ method: "POST", path: "/claim-rewards", summary: "Claim all hotspot rewards" }).input(ClaimRewardsInputSchema).output(ClaimRewardsOutputSchema).errors({
|
|
1166
|
-
INSUFFICIENT_FUNDS
|
|
1167
|
-
}),
|
|
1168
|
-
/** Public: Get pending rewards for a wallet */
|
|
1169
|
-
getPendingRewards: oc.route({ method: "GET", path: "/pending-rewards/{walletAddress}", summary: "Get pending rewards" }).input(GetPendingRewardsInputSchema).output(GetPendingRewardsOutputSchema).errors({
|
|
1170
|
-
BAD_REQUEST: { message: "Invalid wallet address", status: 400 },
|
|
1171
|
-
INVALID_WALLET_ADDRESS
|
|
1172
|
-
}),
|
|
1173
|
-
/** Protected: Transfer hotspot ownership */
|
|
1174
|
-
transferHotspot: oc.route({ method: "POST", path: "/transfer", summary: "Transfer ownership" }).input(TransferHotspotInputSchema).output(TransferHotspotOutputSchema).errors({
|
|
1175
|
-
UNAUTHORIZED,
|
|
1176
|
-
NOT_FOUND,
|
|
1177
|
-
BAD_REQUEST: { message: "Invalid transfer parameters", status: 400 },
|
|
1178
|
-
INSUFFICIENT_FUNDS,
|
|
1179
|
-
CONFLICT
|
|
1180
|
-
}),
|
|
1181
|
-
/** Protected: Update rewards destination */
|
|
1182
|
-
updateRewardsDestination: oc.route({ method: "POST", path: "/update-rewards-destination", summary: "Update rewards destination" }).input(UpdateRewardsDestinationInputSchema).output(UpdateRewardsDestinationOutputSchema).errors({
|
|
1183
|
-
BAD_REQUEST: { message: "Invalid parameters", status: 400 },
|
|
1184
|
-
NOT_FOUND,
|
|
1185
|
-
INSUFFICIENT_FUNDS
|
|
1186
|
-
}),
|
|
1187
|
-
/** Public: Get split configuration for a hotspot */
|
|
1188
|
-
getSplit: oc.route({ method: "GET", path: "/split/{walletAddress}/{hotspotPubkey}", summary: "Get reward split" }).input(GetSplitInputSchema).output(SplitResponseSchema).errors({
|
|
1189
|
-
NOT_FOUND: { message: "Split not found", status: 404 },
|
|
1190
|
-
INVALID_WALLET_ADDRESS
|
|
1191
|
-
}),
|
|
1192
|
-
/** Protected: Create a split configuration */
|
|
1193
|
-
createSplit: oc.route({ method: "POST", path: "/split", summary: "Create a reward split" }).input(CreateSplitInputSchema).output(CreateSplitOutputSchema).errors({
|
|
1194
|
-
NOT_FOUND,
|
|
1195
|
-
BAD_REQUEST: { message: "Invalid split configuration", status: 400 },
|
|
1196
|
-
INSUFFICIENT_FUNDS
|
|
1197
|
-
}),
|
|
1198
|
-
/** Protected: Delete a split configuration */
|
|
1199
|
-
deleteSplit: oc.route({ method: "DELETE", path: "/split", summary: "Delete a reward split" }).input(DeleteSplitInputSchema).output(DeleteSplitOutputSchema).errors({
|
|
1200
|
-
NOT_FOUND,
|
|
1201
|
-
INSUFFICIENT_FUNDS
|
|
1202
|
-
}),
|
|
1203
|
-
/** Protected: Close automation */
|
|
1204
|
-
closeAutomation: oc.route({ method: "POST", path: "/wallet/{walletAddress}/automation/close", summary: "Close automation" }).input(CloseAutomationInputSchema).output(CloseAutomationOutputSchema).errors({
|
|
1205
|
-
NOT_FOUND,
|
|
1206
|
-
INSUFFICIENT_FUNDS
|
|
1207
|
-
}),
|
|
1208
|
-
/** Protected: Get automation status */
|
|
1209
|
-
getAutomationStatus: oc.route({ method: "GET", path: "/wallet/{walletAddress}/automation/status", summary: "Get automation status" }).input(GetAutomationStatusInputSchema).output(AutomationStatusOutputSchema).errors({
|
|
1210
|
-
NOT_FOUND
|
|
1211
|
-
}),
|
|
1212
|
-
/** Protected: Create automation */
|
|
1213
|
-
createAutomation: oc.route({
|
|
1214
|
-
method: "POST",
|
|
1215
|
-
path: "/wallet/{walletAddress}/automation",
|
|
1216
|
-
summary: "Setup automation"
|
|
1217
|
-
}).input(SetupAutomationInputSchema).output(SetupAutomationOutputSchema).errors({
|
|
1218
|
-
NOT_FOUND,
|
|
1219
|
-
INSUFFICIENT_FUNDS
|
|
1220
|
-
}),
|
|
1221
|
-
/** Protected: Fund automation */
|
|
1222
|
-
fundAutomation: oc.route({ method: "POST", path: "/wallet/{walletAddress}/automation/fund", summary: "Fund automation" }).input(FundAutomationInputSchema).output(FundAutomationOutputSchema).errors({
|
|
1223
|
-
NOT_FOUND,
|
|
1224
|
-
INSUFFICIENT_FUNDS
|
|
1225
|
-
}),
|
|
1226
|
-
/** Protected: Get funding estimate */
|
|
1227
|
-
getFundingEstimate: oc.route({ method: "GET", path: "/wallet/{walletAddress}/automation/funding-estimate", summary: "Get funding estimate" }).input(GetFundingEstimateInputSchema).output(FundingEstimateOutputSchema).errors({}),
|
|
1228
|
-
updateHotspotInfo: oc.route({ method: "POST", path: "/update-info", summary: "Update hotspot info", description: "Creates an unsigned transaction to update hotspot configuration. Requires deviceType discriminant (iot or mobile) to select the correct update path and validate against on-chain network." }).input(UpdateHotspotInfoInputSchema).output(UpdateHotspotInfoOutputSchema).errors({
|
|
1229
|
-
NOT_FOUND,
|
|
1230
|
-
UNAUTHORIZED,
|
|
1231
|
-
BAD_REQUEST: { message: "Device type mismatch", status: 400 },
|
|
1232
|
-
INSUFFICIENT_FUNDS
|
|
1233
|
-
})
|
|
1234
|
-
});
|
|
1235
|
-
var governanceContract = oc.tag("Governance").prefix("/governance").router({
|
|
1236
|
-
createPosition: oc.route({
|
|
1237
|
-
method: "POST",
|
|
1238
|
-
path: "/positions",
|
|
1239
|
-
summary: "Create staking position",
|
|
1240
|
-
description: "Create a new staking position with specified lockup parameters. Optionally delegate to a sub-DAO immediately."
|
|
1241
|
-
}).input(CreatePositionInputSchema).errors({ BAD_REQUEST, INSUFFICIENT_FUNDS }).output(CreatePositionResponseSchema),
|
|
1242
|
-
closePosition: oc.route({
|
|
1243
|
-
method: "POST",
|
|
1244
|
-
path: "/positions/{positionMint}/close",
|
|
1245
|
-
summary: "Close staking position",
|
|
1246
|
-
description: "Close an expired staking position and withdraw all deposited tokens. Position must have no active votes and lockup must be expired."
|
|
1247
|
-
}).input(ClosePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, INSUFFICIENT_FUNDS }).output(ClosePositionResponseSchema),
|
|
1248
|
-
extendPosition: oc.route({
|
|
1249
|
-
method: "POST",
|
|
1250
|
-
path: "/positions/{positionMint}/extend",
|
|
1251
|
-
summary: "Extend position lockup",
|
|
1252
|
-
description: "Extend the lockup period of an existing staking position."
|
|
1253
|
-
}).input(ExtendPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ExtendPositionResponseSchema),
|
|
1254
|
-
flipLockupKind: oc.route({
|
|
1255
|
-
method: "POST",
|
|
1256
|
-
path: "/positions/{positionMint}/flip-lockup",
|
|
1257
|
-
summary: "Flip lockup kind",
|
|
1258
|
-
description: "Switch position lockup between cliff and constant. Cliff unlocks at a specific time, constant never decays."
|
|
1259
|
-
}).input(FlipLockupKindInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(FlipLockupKindResponseSchema),
|
|
1260
|
-
resetLockup: oc.route({
|
|
1261
|
-
method: "POST",
|
|
1262
|
-
path: "/positions/{positionMint}/reset-lockup",
|
|
1263
|
-
summary: "Reset position lockup",
|
|
1264
|
-
description: "Reset both lockup kind and period for a position. Allows changing cliff/constant and duration in one transaction."
|
|
1265
|
-
}).input(ResetLockupInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ResetLockupResponseSchema),
|
|
1266
|
-
splitPosition: oc.route({
|
|
1267
|
-
method: "POST",
|
|
1268
|
-
path: "/positions/{positionMint}/split",
|
|
1269
|
-
summary: "Split position",
|
|
1270
|
-
description: "Split tokens from an existing position into a new position with its own lockup parameters."
|
|
1271
|
-
}).input(SplitPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(SplitPositionResponseSchema),
|
|
1272
|
-
transferPosition: oc.route({
|
|
1273
|
-
method: "POST",
|
|
1274
|
-
path: "/positions/{positionMint}/transfer",
|
|
1275
|
-
summary: "Transfer between positions",
|
|
1276
|
-
description: "Transfer tokens from one position to another. Both positions must have no active votes."
|
|
1277
|
-
}).input(TransferPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(TransferPositionResponseSchema),
|
|
1278
|
-
delegatePositions: oc.route({
|
|
1279
|
-
method: "POST",
|
|
1280
|
-
path: "/positions/delegate/{subDaoMint}",
|
|
1281
|
-
summary: "Delegate positions",
|
|
1282
|
-
description: "Delegate one or more positions to a sub-DAO. When changing delegation (already delegated to a different sub-DAO), automatically claims pending rewards first. If many epochs need claiming, may require multiple API calls - check hasMore in the response. Automatically handles expired delegations (claim, close, re-delegate) and renewable delegations (extend expiration). Optionally enable/disable automation for reward claiming. Safe to call repeatedly with the same positions. Supports proxy voting \u2014 positions proxied to the caller are auto-detected."
|
|
1283
|
-
}).input(DelegatePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(DelegatePositionsResponseSchema),
|
|
1284
|
-
claimDelegationRewards: oc.route({
|
|
1285
|
-
method: "POST",
|
|
1286
|
-
path: "/positions/claim-rewards",
|
|
1287
|
-
summary: "Claim delegation rewards",
|
|
1288
|
-
description: "Claim delegation rewards for one or more positions. May produce multiple transactions if rewards span many epochs. If many epochs need claiming, may require multiple API calls - check hasMore in the response. Safe to call repeatedly with the same positions - returns empty transactions when nothing left to claim."
|
|
1289
|
-
}).input(ClaimDelegationRewardsInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ClaimDelegationRewardsResponseSchema),
|
|
1290
|
-
undelegatePosition: oc.route({
|
|
1291
|
-
method: "POST",
|
|
1292
|
-
path: "/positions/{positionMint}/undelegate",
|
|
1293
|
-
summary: "Undelegate position",
|
|
1294
|
-
description: "Remove delegation from a position. Automatically claims any pending rewards before undelegating. If many epochs need claiming, may require multiple API calls - check hasMore in the response. Submit the returned transactions, then call again to get remaining claims or the final undelegate transaction."
|
|
1295
|
-
}).input(UndelegateInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(UndelegatePositionResponseSchema),
|
|
1296
|
-
extendDelegation: oc.route({
|
|
1297
|
-
method: "POST",
|
|
1298
|
-
path: "/positions/{positionMint}/delegation/extend",
|
|
1299
|
-
summary: "Extend delegation",
|
|
1300
|
-
description: "Extend the expiration of a delegated position to the current season end."
|
|
1301
|
-
}).input(ExtendDelegationInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ExtendDelegationResponseSchema),
|
|
1302
|
-
vote: oc.route({
|
|
1303
|
-
method: "POST",
|
|
1304
|
-
path: "/proposals/{proposalKey}/vote",
|
|
1305
|
-
summary: "Vote on proposal",
|
|
1306
|
-
description: "Cast votes on a proposal using one or more positions. Auto-detects owned vs proxied positions \u2014 proxied positions use proxy vote path. Automatically queues cleanup tasks to relinquish vote markers after the proposal ends. If many positions are provided, may require multiple API calls - check hasMore in the response."
|
|
1307
|
-
}).input(VoteInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(VoteResponseSchema),
|
|
1308
|
-
relinquishVote: oc.route({
|
|
1309
|
-
method: "POST",
|
|
1310
|
-
path: "/proposals/{proposalKey}/relinquish-votes",
|
|
1311
|
-
summary: "Relinquish vote",
|
|
1312
|
-
description: "Remove votes from a specific choice on a proposal for one or more positions. Auto-detects owned vs proxied positions \u2014 proxied positions use proxy relinquish path. If many positions are provided, may require multiple API calls - check hasMore in the response."
|
|
1313
|
-
}).input(RelinquishVoteInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(RelinquishVoteResponseSchema),
|
|
1314
|
-
relinquishPositionVotes: oc.route({
|
|
1315
|
-
method: "POST",
|
|
1316
|
-
path: "/positions/{positionMint}/relinquish-vote",
|
|
1317
|
-
summary: "Relinquish all position votes",
|
|
1318
|
-
description: "Remove ALL active votes from a single position across all proposals in an organization. If many votes exist, may require multiple API calls - check hasMore in the response."
|
|
1319
|
-
}).input(RelinquishPositionVotesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(RelinquishPositionVotesResponseSchema),
|
|
1320
|
-
assignProxies: oc.route({
|
|
1321
|
-
method: "POST",
|
|
1322
|
-
path: "/proxy/{proxyKey}/assign",
|
|
1323
|
-
summary: "Assign voting proxy",
|
|
1324
|
-
description: "Delegate voting power to a proxy recipient for one or more positions. The proxy can vote on your behalf until the expiration time. If the recipient has already voted on open proposals, automatically propagates those votes to delegated positions via countProxyVoteV0. If many positions are provided, may require multiple API calls - check hasMore in the response."
|
|
1325
|
-
}).input(AssignProxiesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(AssignProxiesResponseSchema),
|
|
1326
|
-
unassignProxies: oc.route({
|
|
1327
|
-
method: "POST",
|
|
1328
|
-
path: "/proxy/{proxyKey}/unassign",
|
|
1329
|
-
summary: "Unassign voting proxy",
|
|
1330
|
-
description: "Remove voting proxy delegation from one or more positions, returning voting power to the owner. If many positions are provided, may require multiple API calls - check hasMore in the response."
|
|
1331
|
-
}).input(UnassignProxiesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(UnassignProxiesResponseSchema)
|
|
1332
|
-
});
|
|
1333
|
-
var rewardContract = oc.tag("Reward Contract").prefix("/hotspots").router({
|
|
1334
|
-
find: oc.route({
|
|
1335
|
-
method: "GET",
|
|
1336
|
-
path: "/{entityPubKey}/reward-contract",
|
|
1337
|
-
summary: "Get Contract",
|
|
1338
|
-
description: "Retrieves the reward contract (pending or active) associated with a specific hotspot entity."
|
|
1339
|
-
}).input(z.object({
|
|
1340
|
-
entityPubKey: HeliumPublicKeySchema
|
|
1341
|
-
})).errors({
|
|
1342
|
-
NOT_FOUND,
|
|
1343
|
-
BAD_REQUEST
|
|
1344
|
-
}).output(FindRewardContractResponseSchema),
|
|
1345
|
-
estimateCreationCost: oc.route({
|
|
1346
|
-
method: "GET",
|
|
1347
|
-
path: "/{entityPubKey}/reward-contract/estimate-creation-cost",
|
|
1348
|
-
summary: "Estimate Creation Cost",
|
|
1349
|
-
description: "Estimates the cost to create a reward contract for a specific hotspot entity."
|
|
1350
|
-
}).input(CreateRewardContractTransactionInputSchema.extend({
|
|
1351
|
-
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity")
|
|
1352
|
-
})).output(EstimateCostToCreateRewardContractResponseSchema).errors({
|
|
1353
|
-
BAD_REQUEST,
|
|
1354
|
-
NOT_FOUND
|
|
1355
|
-
}),
|
|
1356
|
-
create: oc.route({
|
|
1357
|
-
method: "POST",
|
|
1358
|
-
path: "/{entityPubKey}/reward-contract",
|
|
1359
|
-
summary: "Create Reward Contract",
|
|
1360
|
-
description: "Assembles an unsigned transaction to create a claimable or finalized reward contract for a specific hotspot entity. If the input inlcudes a pending/claimable recipient, the contract will be created as a pending/claimable contract. If the input is defined exclusively with preset recipients, an active contract will be created directly."
|
|
1361
|
-
}).input(
|
|
1362
|
-
CreateRewardContractTransactionInputSchema.extend({
|
|
1363
|
-
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1364
|
-
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
1365
|
-
})
|
|
1366
|
-
).errors({
|
|
1367
|
-
BAD_REQUEST,
|
|
1368
|
-
CONFLICT,
|
|
1369
|
-
NOT_FOUND,
|
|
1370
|
-
UNAUTHORIZED,
|
|
1371
|
-
// Does this belong here to guard gifted currency check?
|
|
1372
|
-
INSUFFICIENT_FUNDS
|
|
1373
|
-
}).output(CreateRewardContractTransactionResponseSchema),
|
|
1374
|
-
delete: oc.route({
|
|
1375
|
-
method: "DELETE",
|
|
1376
|
-
path: "/{entityPubKey}/reward-contract",
|
|
1377
|
-
summary: "Delete Pending Contract",
|
|
1378
|
-
description: "Assembles an unsigned transaction to delete a reward contract (pending or active) for a specific hotspot entity."
|
|
1379
|
-
}).input(
|
|
1380
|
-
z.object({
|
|
1381
|
-
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1382
|
-
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
1383
|
-
})
|
|
1384
|
-
).errors({
|
|
1385
|
-
BAD_REQUEST,
|
|
1386
|
-
NOT_FOUND,
|
|
1387
|
-
// if wallet is not the delegate
|
|
1388
|
-
UNAUTHORIZED,
|
|
1389
|
-
INSUFFICIENT_FUNDS
|
|
1390
|
-
}).output(DeleteRewardContractTransactionResponseSchema),
|
|
1391
|
-
invite: oc.route({
|
|
1392
|
-
method: "POST",
|
|
1393
|
-
path: "/{entityPubKey}/reward-contract/invite",
|
|
1394
|
-
summary: "Create Invite",
|
|
1395
|
-
description: "Assembles details required to create a shareable invite to claim a pending reward contract."
|
|
1396
|
-
}).input(
|
|
1397
|
-
z.object({
|
|
1398
|
-
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1399
|
-
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller"),
|
|
1400
|
-
expirationDays: z.number().int().positive().max(365).default(7).describe("Number of days until the invite expires")
|
|
1401
|
-
})
|
|
1402
|
-
).errors({
|
|
1403
|
-
// if no hotspot or contract found
|
|
1404
|
-
NOT_FOUND,
|
|
1405
|
-
// if the contract is not pending
|
|
1406
|
-
BAD_REQUEST,
|
|
1407
|
-
// if wallet is not the delegate
|
|
1408
|
-
UNAUTHORIZED
|
|
1409
|
-
}).output(CreateInviteResponseSchema),
|
|
1410
|
-
claim: oc.route({
|
|
1411
|
-
method: "POST",
|
|
1412
|
-
path: "/{entityPubKey}/reward-contract/claim",
|
|
1413
|
-
summary: "Claim Invite",
|
|
1414
|
-
description: "Assembles an unsigned transaction which can be used to claim an invite."
|
|
1415
|
-
}).input(
|
|
1416
|
-
ClaimInviteRequestSchema.extend({
|
|
1417
|
-
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1418
|
-
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
1419
|
-
})
|
|
1420
|
-
).errors({
|
|
1421
|
-
// if no hotspot or contract found
|
|
1422
|
-
NOT_FOUND,
|
|
1423
|
-
// if the contract is not pending
|
|
1424
|
-
BAD_REQUEST,
|
|
1425
|
-
// if wallet is not the delegate
|
|
1426
|
-
UNAUTHORIZED
|
|
1427
|
-
}).output(ClaimInviteResponseSchema)
|
|
1428
|
-
});
|
|
1429
|
-
var swapContract = oc.tag("Swap").router({
|
|
1430
|
-
getTokens: oc.route({ method: "GET", path: "/swap/tokens" }).input(GetTokensInputSchema).output(TokenListOutputSchema).errors({
|
|
1431
|
-
JUPITER_ERROR: { message: "Failed to fetch tokens from Jupiter" }
|
|
1432
|
-
}),
|
|
1433
|
-
getQuote: oc.route({ method: "GET", path: "/swap/quote" }).input(GetQuoteInputSchema).output(QuoteResponseSchema).errors({
|
|
1434
|
-
BAD_REQUEST: { message: "Invalid quote parameters", status: 400 },
|
|
1435
|
-
JUPITER_ERROR: { message: "Failed to get quote from Jupiter" }
|
|
1436
|
-
}),
|
|
1437
|
-
getInstructions: oc.route({ method: "POST", path: "/swap/instructions" }).input(GetInstructionsInputSchema).output(TransactionDataSchema).errors({
|
|
1438
|
-
BAD_REQUEST: { message: "Invalid instruction parameters", status: 400 },
|
|
1439
|
-
JUPITER_ERROR: { message: "Failed to get swap instructions from Jupiter" },
|
|
1440
|
-
INSUFFICIENT_FUNDS
|
|
1441
|
-
})
|
|
1442
|
-
});
|
|
1443
|
-
var transactionsContract = oc.tag("Transactions").router({
|
|
1444
|
-
submit: oc.route({ method: "POST", path: "/transactions", summary: "Submit a transaction" }).input(SubmitInputSchema).output(SubmitOutputSchema).errors({
|
|
1445
|
-
BAD_REQUEST,
|
|
1446
|
-
CONFLICT,
|
|
1447
|
-
SIMULATION_FAILED
|
|
1448
|
-
}),
|
|
1449
|
-
get: oc.route({ method: "GET", path: "/transactions/{id}", summary: "Get transaction status" }).input(GetInputSchema).output(BatchStatusOutputSchema).errors({
|
|
1450
|
-
NOT_FOUND
|
|
1451
|
-
}),
|
|
1452
|
-
resubmit: oc.route({ method: "POST", path: "/transactions/{id}/resubmit", summary: "Resubmit a transaction" }).input(ResubmitInputSchema).output(ResubmitOutputSchema).errors({
|
|
1453
|
-
NOT_FOUND,
|
|
1454
|
-
BAD_REQUEST
|
|
1455
|
-
}),
|
|
1456
|
-
getByPayer: oc.route({ method: "GET", path: "/transactions/payer/{payer}", summary: "Get transactions by payer" }).input(GetByPayerInputSchema).output(PayerBatchesOutputSchema).errors({
|
|
1457
|
-
BAD_REQUEST
|
|
1458
|
-
}),
|
|
1459
|
-
getByPayerAndTag: oc.route({ method: "GET", path: "/transactions/payer/{payer}/tag/{tag}", summary: "Get transactions by payer and tag" }).input(GetByPayerAndTagInputSchema).output(PayerBatchesOutputSchema).errors({
|
|
1460
|
-
BAD_REQUEST
|
|
1461
|
-
}),
|
|
1462
|
-
estimate: oc.route({ method: "POST", path: "/transactions/estimate", summary: "Estimate transaction costs" }).input(EstimateInputSchema).output(EstimateOutputSchema).errors({
|
|
1463
|
-
BAD_REQUEST,
|
|
1464
|
-
SIMULATION_FAILED
|
|
1465
|
-
})
|
|
1466
|
-
});
|
|
1467
|
-
var welcomePacksContract = oc.tag("Welcome Packs").router({
|
|
1468
|
-
/** Public: List welcome packs for a wallet */
|
|
1469
|
-
list: oc.route({ method: "GET", path: "/welcome-packs/{walletAddress}", summary: "List welcome packs for a wallet" }).input(WelcomePackListInputSchema).output(WelcomePackListOutputSchema).errors({
|
|
1470
|
-
INVALID_WALLET_ADDRESS
|
|
1471
|
-
}),
|
|
1472
|
-
/** Protected: Create a new welcome pack */
|
|
1473
|
-
create: oc.route({ method: "POST", path: "/welcome-packs", summary: "Create a new welcome pack" }).input(WelcomePackCreateInputSchema).output(WelcomePackCreateOutputSchema).errors({
|
|
1474
|
-
BAD_REQUEST,
|
|
1475
|
-
CONFLICT,
|
|
1476
|
-
INSUFFICIENT_FUNDS
|
|
1477
|
-
}),
|
|
1478
|
-
/** Public: Get a specific welcome pack */
|
|
1479
|
-
get: oc.route({ method: "GET", path: "/welcome-packs/{walletAddress}/{packId}", summary: "Get a specific welcome pack" }).input(WelcomePackGetInputSchema).output(WelcomePackSchema).errors({
|
|
1480
|
-
NOT_FOUND,
|
|
1481
|
-
INVALID_WALLET_ADDRESS
|
|
1482
|
-
}),
|
|
1483
|
-
/** Protected: Delete a welcome pack */
|
|
1484
|
-
delete: oc.route({ method: "DELETE", path: "/welcome-packs/{walletAddress}/{packId}", summary: "Delete a welcome pack" }).input(WelcomePackDeleteInputSchema).output(WelcomePackDeleteOutputSchema).errors({
|
|
1485
|
-
BAD_REQUEST,
|
|
1486
|
-
INVALID_WALLET_ADDRESS,
|
|
1487
|
-
INSUFFICIENT_FUNDS
|
|
1488
|
-
}),
|
|
1489
|
-
/** Public: Get welcome pack by pack address */
|
|
1490
|
-
getByAddress: oc.route({ method: "GET", path: "/welcome-packs/address/{packAddress}", summary: "Get welcome pack by pack address" }).input(WelcomePackGetByAddressInputSchema).output(WelcomePackSchema).errors({
|
|
1491
|
-
NOT_FOUND
|
|
1492
|
-
}),
|
|
1493
|
-
/** Public: Claim a welcome pack (no auth needed, uses claim token) */
|
|
1494
|
-
claim: oc.route({ method: "POST", path: "/welcome-packs/claim", summary: "Claim a welcome pack" }).input(WelcomePackClaimInputSchema).output(WelcomePackClaimOutputSchema).errors({
|
|
1495
|
-
BAD_REQUEST,
|
|
1496
|
-
EXPIRED: { message: "Claim link has expired", status: 410 }
|
|
1497
|
-
}),
|
|
1498
|
-
/** Protected: Send an invite for a welcome pack */
|
|
1499
|
-
invite: oc.route({ method: "POST", path: "/welcome-packs/invite", summary: "Send an invite for a welcome pack" }).input(WelcomePackInviteInputSchema).output(WelcomePackInviteOutputSchema).errors({
|
|
1500
|
-
BAD_REQUEST,
|
|
1501
|
-
NOT_FOUND
|
|
1502
|
-
})
|
|
1503
|
-
});
|
|
1504
|
-
var fiatContract = oc.errors({
|
|
1505
|
-
UNAUTHENTICATED,
|
|
1506
|
-
UNAUTHORIZED
|
|
1507
|
-
}).tag("Fiat").router({
|
|
1508
|
-
getKycStatus: oc.route({ method: "GET", path: "/fiat/kyc/status" }).output(KycStatusOutputSchema).errors({
|
|
1509
|
-
EMAIL_NOT_LINKED: { status: 401, message: "Email not linked." }
|
|
1510
|
-
}),
|
|
1511
|
-
initKyc: oc.route({ method: "POST", path: "/fiat/kyc/init" }).input(InitKycInputSchema).output(KycStatusOutputSchema).errors({
|
|
1512
|
-
EMAIL_NOT_LINKED: { status: 401, message: "Email not linked." },
|
|
1513
|
-
BRIDGE_ERROR: { message: "Failed to create Bridge KYC link", status: 500 }
|
|
1514
|
-
}),
|
|
1515
|
-
getFees: oc.route({ method: "GET", path: "/fiat/fees" }).output(FeesOutputSchema).errors({}),
|
|
1516
|
-
listBankAccounts: oc.route({ method: "GET", path: "/fiat/bank-accounts" }).output(BankAccountListOutputSchema).errors({
|
|
1517
|
-
NOT_FOUND: { message: "Bridge customer ID not found", status: 404 }
|
|
1518
|
-
}),
|
|
1519
|
-
createBankAccount: oc.route({ method: "POST", path: "/fiat/bank-accounts" }).input(CreateBankAccountInputSchema).output(BankAccountSchema).errors({
|
|
1520
|
-
NO_CUSTOMER: { message: "Bridge customer ID not found", status: 404 },
|
|
1521
|
-
BRIDGE_ERROR: { message: "Failed to create Bridge KYC link", status: 500 }
|
|
1522
|
-
}),
|
|
1523
|
-
deleteBankAccount: oc.route({ method: "DELETE", path: "/fiat/bank-accounts/{id}" }).input(DeleteBankAccountInputSchema).output(DeleteBankAccountOutputSchema).errors({
|
|
1524
|
-
NO_CUSTOMER: { message: "Bridge customer ID not found", status: 404 },
|
|
1525
|
-
BRIDGE_ERROR: { message: "Failed to delete bank account", status: 500 }
|
|
1526
|
-
}),
|
|
1527
|
-
getSendQuote: oc.route({ method: "GET", path: "/fiat/quote/{id}" }).input(GetSendQuoteInputSchema).output(QuoteOutputSchema).errors({
|
|
1528
|
-
BAD_REQUEST,
|
|
1529
|
-
JUPITER_ERROR: { message: "Failed to get quote from Jupiter", status: 500 }
|
|
1530
|
-
}),
|
|
1531
|
-
sendFunds: oc.route({ method: "POST", path: "/fiat/send" }).input(SendFundsInputSchema).output(SendFundsOutputSchema).errors({
|
|
1532
|
-
NOT_FOUND,
|
|
1533
|
-
BRIDGE_ERROR: { message: "Failed to create Bridge transfer", status: 500 },
|
|
1534
|
-
JUPITER_ERROR: { message: "Failed to get quote from Jupiter", status: 500 },
|
|
1535
|
-
INSUFFICIENT_FUNDS
|
|
1536
|
-
}),
|
|
1537
|
-
updateTransfer: oc.route({ method: "PUT", path: "/fiat/transfer/{id}" }).input(UpdateTransferInputSchema).output(UpdateTransferOutputSchema).errors({
|
|
1538
|
-
NOT_FOUND: { message: "Transfer not found", status: 404 }
|
|
1539
|
-
})
|
|
1540
|
-
});
|
|
1541
|
-
var BridgeWebhookInputSchema = z.object({
|
|
1542
|
-
type: z.string(),
|
|
1543
|
-
kyc_link_id: z.string().optional(),
|
|
1544
|
-
kyc_status: z.string().optional(),
|
|
1545
|
-
tos_status: z.string().optional(),
|
|
1546
|
-
customer_id: z.string().optional()
|
|
1547
|
-
});
|
|
1548
|
-
var BridgeWebhookOutputSchema = z.object({
|
|
1549
|
-
success: z.boolean(),
|
|
1550
|
-
error: z.string().optional()
|
|
1551
|
-
});
|
|
1552
|
-
|
|
1553
|
-
// src/contracts/webhooks.ts
|
|
1554
|
-
var webhooksContract = oc.tag("Webhooks").router({
|
|
1555
|
-
bridge: oc.route({ method: "POST", path: "/webhooks/bridge" }).input(BridgeWebhookInputSchema).output(BridgeWebhookOutputSchema).errors({
|
|
1556
|
-
NOT_FOUND,
|
|
1557
|
-
INVALID_PAYLOAD: { message: "Invalid webhook payload", status: 400 }
|
|
1558
|
-
})
|
|
1559
|
-
});
|
|
1560
|
-
var migrationContract = oc.tag("Migration").router({
|
|
1561
|
-
getHotspots: oc.route({
|
|
1562
|
-
method: "GET",
|
|
1563
|
-
path: "/migration/hotspots",
|
|
1564
|
-
summary: "Get hotspots that can be migrated (owned directly or in welcome packs)"
|
|
1565
|
-
}).input(MigratableHotspotsInputSchema).output(MigratableHotspotsOutputSchema).errors({
|
|
1566
|
-
BAD_REQUEST
|
|
1567
|
-
}),
|
|
1568
|
-
migrate: oc.route({
|
|
1569
|
-
method: "POST",
|
|
1570
|
-
path: "/migration/migrate",
|
|
1571
|
-
summary: "Migrate assets to a new wallet",
|
|
1572
|
-
description: "Returns up to 5 transactions per call. If hasMore is true, submit the transactions then call again with nextParams."
|
|
1573
|
-
}).input(MigrateInputSchema).output(MigrateOutputSchema).errors({
|
|
1574
|
-
UNAUTHORIZED,
|
|
1575
|
-
BAD_REQUEST,
|
|
1576
|
-
NOT_FOUND,
|
|
1577
|
-
INSUFFICIENT_FUNDS
|
|
1578
|
-
})
|
|
1579
|
-
});
|
|
1580
|
-
var apiContract = oc.router({
|
|
1581
|
-
governance: governanceContract,
|
|
1582
|
-
health: healthContract,
|
|
1583
|
-
tokens: tokensContract,
|
|
1584
|
-
hotspots: hotspotsContract,
|
|
1585
|
-
rewardContract,
|
|
1586
|
-
swap: swapContract,
|
|
1587
|
-
transactions: transactionsContract,
|
|
1588
|
-
welcomePacks: welcomePacksContract
|
|
1589
|
-
});
|
|
1590
|
-
var fullApiContract = oc.router({
|
|
1591
|
-
...apiContract,
|
|
1592
|
-
fiat: fiatContract,
|
|
1593
|
-
webhooks: webhooksContract,
|
|
1594
|
-
migration: migrationContract
|
|
1595
|
-
});
|
|
1596
|
-
|
|
1597
|
-
export { AssignProxiesInputSchema, AssignProxiesResponseSchema, AutomationScheduleSchema, AutomationStatusOutputSchema, BAD_REQUEST, BankAccountListOutputSchema, BankAccountSchema, BatchStatusOutputSchema, BridgeTransferSchema, CONFLICT, ClaimDelegationRewardsInputSchema, ClaimDelegationRewardsResponseSchema, ClaimInviteRequestSchema, ClaimInviteResponseSchema, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CloseAutomationInputSchema, CloseAutomationOutputSchema, ClosePositionInputSchema, ClosePositionResponseSchema, CreateBankAccountInputSchema, CreateHntAccountInputSchema, CreateHntAccountOutputSchema, CreateInviteResponseSchema, CreatePositionInputSchema, CreatePositionResponseSchema, CreateRewardContractTransactionInputSchema, CreateRewardContractTransactionResponseSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DelegatePositionInputSchema, DelegatePositionsResponseSchema, DeleteBankAccountInputSchema, DeleteBankAccountOutputSchema, DeleteRewardContractTransactionResponseSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, ErrorResponseSchema, EstimateCostToCreateRewardContractResponseSchema, EstimateInputSchema, EstimateOutputSchema, ExtendDelegationInputSchema, ExtendDelegationResponseSchema, ExtendPositionInputSchema, ExtendPositionResponseSchema, FeesOutputSchema, FindRewardContractResponseSchema, FlipLockupKindInputSchema, FlipLockupKindResponseSchema, FundAutomationInputSchema, FundAutomationOutputSchema, FundingEstimateOutputSchema, GetAutomationStatusInputSchema, GetBalancesInputSchema, GetBankAccountInputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetFundingEstimateInputSchema, GetHotspotsInputSchema, GetInputSchema, GetInstructionsInputSchema, GetPendingRewardsInputSchema, GetPendingRewardsOutputSchema, GetQuoteInputSchema, GetSendQuoteInputSchema, GetSplitInputSchema, GetTokensInputSchema, GetTransferInputSchema, HealthResponseSchema, HeliumPublicKeySchema, HotspotSchema, HotspotSharesSchema, HotspotTypeSchema, HotspotsDataSchema, INSUFFICIENT_FUNDS, INVALID_WALLET_ADDRESS, InitKycInputSchema, KycStatusOutputSchema, LockupKindSchema, MigratableHotspotSchema, MigratableHotspotsInputSchema, MigratableHotspotsOutputSchema, MigrateInputSchema, MigrateOutputSchema, MigrateTransactionDataSchema, MigrateTransactionItemSchema, NOT_FOUND, OwnershipTypeSchema, PaginationInputSchema, PaginationOutputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema, PublicKeySchema, QuoteOutputSchema, QuoteResponseSchema, RATE_LIMITED, RelinquishPositionVotesInputSchema, RelinquishPositionVotesResponseSchema, RelinquishVoteInputSchema, RelinquishVoteResponseSchema, ResetLockupInputSchema, ResetLockupResponseSchema, ResubmitInputSchema, ResubmitOutputSchema, RewardSplitInputSchema, SIMULATION_FAILED, ScheduleInputSchema, SendFundsInputSchema, SendFundsOutputSchema, SetupAutomationInputSchema, SetupAutomationOutputSchema, SplitPositionInputSchema, SplitPositionResponseSchema, SplitResponseSchema, SplitShareSchema, SubmitInputSchema, SubmitOutputSchema, SwapTransactionDataSchema, TRANSACTION_FAILED, TokenAccountSchema, TokenAmountInputSchema, TokenAmountOutputSchema, TokenBalanceDataSchema, TokenListOutputSchema, TokenSchema, TransactionBatchRequestSchema, TransactionBatchResponseSchema, TransactionDataSchema, TransactionItemSchema, TransactionMetadataSchema, TransactionStatusSchema, TransferHotspotInputSchema, TransferHotspotOutputSchema, TransferInputSchema, TransferOutputSchema, TransferPositionInputSchema, TransferPositionResponseSchema, UNAUTHENTICATED, UNAUTHORIZED, UnassignProxiesInputSchema, UnassignProxiesResponseSchema, UndelegateInputSchema, UndelegatePositionResponseSchema, UpdateHotspotInfoInputSchema, UpdateHotspotInfoOutputSchema, UpdateRewardsDestinationInputSchema, UpdateRewardsDestinationOutputSchema, UpdateTransferInputSchema, UpdateTransferOutputSchema, VoteInputSchema, VoteResponseSchema, WalletAddressSchema, WelcomePackClaimInputSchema, WelcomePackClaimOutputSchema, WelcomePackCreateInputSchema, WelcomePackCreateOutputSchema, WelcomePackDeleteInputSchema, WelcomePackDeleteOutputSchema, WelcomePackGetByAddressInputSchema, WelcomePackGetInputSchema, WelcomePackInviteInputSchema, WelcomePackInviteOutputSchema, WelcomePackListInputSchema, WelcomePackListOutputSchema, WelcomePackSchema, apiContract, createPaginatedTransactionResponse, createTransactionResponse, createTypedPaginatedTransactionResponse, createTypedTransactionResponse, fullApiContract, typedTransactionData };
|
|
1
|
+
import './chunk-KTADG6LO.js';
|
|
2
|
+
export { apiContract, fullApiContract } from './chunk-2SBYC2AH.js';
|
|
3
|
+
import './chunk-7CTJX35S.js';
|
|
4
|
+
export { BAD_REQUEST, CONFLICT, INSUFFICIENT_FUNDS, INVALID_WALLET_ADDRESS, NOT_FOUND, RATE_LIMITED, SIMULATION_FAILED, TRANSACTION_FAILED, UNAUTHENTICATED, UNAUTHORIZED } from './chunk-6EPXJJY5.js';
|
|
5
|
+
import './chunk-TEWZC6CW.js';
|
|
6
|
+
export { MigratableHotspotSchema, MigratableHotspotsInputSchema, MigratableHotspotsOutputSchema, MigrateInputSchema, MigrateOutputSchema, MigrateTransactionDataSchema, MigrateTransactionItemSchema } from './chunk-NBOSJXWK.js';
|
|
7
|
+
export { ClaimInviteRequestSchema, ClaimInviteResponseSchema, CreateInviteResponseSchema, CreateRewardContractTransactionInputSchema, CreateRewardContractTransactionResponseSchema, DeleteRewardContractTransactionResponseSchema, EstimateCostToCreateRewardContractResponseSchema, FindRewardContractResponseSchema } from './chunk-4CY5D37F.js';
|
|
8
|
+
export { CreateHntAccountInputSchema, CreateHntAccountOutputSchema, GetBalancesInputSchema, TokenAccountSchema, TokenBalanceDataSchema, TransferInputSchema, TransferOutputSchema } from './chunk-MSIA3ZUI.js';
|
|
9
|
+
export { BatchStatusOutputSchema, EstimateInputSchema, EstimateOutputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetInputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema, ResubmitInputSchema, ResubmitOutputSchema, SubmitInputSchema, SubmitOutputSchema, TransactionStatusSchema } from './chunk-7R4XQ5SN.js';
|
|
10
|
+
export { WelcomePackClaimInputSchema, WelcomePackClaimOutputSchema, WelcomePackCreateInputSchema, WelcomePackCreateOutputSchema, WelcomePackDeleteInputSchema, WelcomePackDeleteOutputSchema, WelcomePackGetByAddressInputSchema, WelcomePackGetInputSchema, WelcomePackInviteInputSchema, WelcomePackInviteOutputSchema, WelcomePackListInputSchema, WelcomePackListOutputSchema, WelcomePackSchema } from './chunk-T7OKPHTD.js';
|
|
11
|
+
export { BankAccountListOutputSchema, BankAccountSchema, BridgeTransferSchema, CreateBankAccountInputSchema, DeleteBankAccountInputSchema, DeleteBankAccountOutputSchema, FeesOutputSchema, GetBankAccountInputSchema, GetSendQuoteInputSchema, GetTransferInputSchema, InitKycInputSchema, KycStatusOutputSchema, QuoteOutputSchema, SendFundsInputSchema, SendFundsOutputSchema, UpdateTransferInputSchema, UpdateTransferOutputSchema } from './chunk-RD5LUTM5.js';
|
|
12
|
+
export { GetInstructionsInputSchema, GetQuoteInputSchema, GetTokensInputSchema, QuoteResponseSchema, SwapTransactionDataSchema, TokenListOutputSchema, TokenSchema } from './chunk-5ZPW3MRC.js';
|
|
13
|
+
export { AssignProxiesInputSchema, AssignProxiesResponseSchema, ClaimDelegationRewardsInputSchema, ClaimDelegationRewardsResponseSchema, ClosePositionInputSchema, ClosePositionResponseSchema, CreatePositionInputSchema, CreatePositionResponseSchema, DelegatePositionInputSchema, DelegatePositionsResponseSchema, ExtendDelegationInputSchema, ExtendDelegationResponseSchema, ExtendPositionInputSchema, ExtendPositionResponseSchema, FlipLockupKindInputSchema, FlipLockupKindResponseSchema, LockupKindSchema, RelinquishPositionVotesInputSchema, RelinquishPositionVotesResponseSchema, RelinquishVoteInputSchema, RelinquishVoteResponseSchema, ResetLockupInputSchema, ResetLockupResponseSchema, SplitPositionInputSchema, SplitPositionResponseSchema, TransferPositionInputSchema, TransferPositionResponseSchema, UnassignProxiesInputSchema, UnassignProxiesResponseSchema, UndelegateInputSchema, UndelegatePositionResponseSchema, VoteInputSchema, VoteResponseSchema } from './chunk-LHKDTWB2.js';
|
|
14
|
+
export { HealthResponseSchema } from './chunk-4RVSLJOU.js';
|
|
15
|
+
export { AutomationScheduleSchema, AutomationStatusOutputSchema, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CloseAutomationInputSchema, CloseAutomationOutputSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, FundAutomationInputSchema, FundAutomationOutputSchema, FundingEstimateOutputSchema, GetAutomationStatusInputSchema, GetFundingEstimateInputSchema, GetHotspotsInputSchema, GetPendingRewardsInputSchema, GetPendingRewardsOutputSchema, GetSplitInputSchema, HotspotSchema, HotspotSharesSchema, HotspotTypeSchema, HotspotsDataSchema, OwnershipTypeSchema, SetupAutomationInputSchema, SetupAutomationOutputSchema, SplitResponseSchema, SplitShareSchema, TransferHotspotInputSchema, TransferHotspotOutputSchema, UpdateHotspotInfoInputSchema, UpdateHotspotInfoOutputSchema, UpdateRewardsDestinationInputSchema, UpdateRewardsDestinationOutputSchema } from './chunk-6LMSAIIW.js';
|
|
16
|
+
export { ErrorResponseSchema, HeliumPublicKeySchema, PaginationInputSchema, PaginationOutputSchema, PublicKeySchema, RewardSplitInputSchema, ScheduleInputSchema, TokenAmountInputSchema, TokenAmountOutputSchema, TransactionBatchRequestSchema, TransactionBatchResponseSchema, TransactionDataSchema, TransactionItemSchema, TransactionMetadataSchema, WalletAddressSchema, createPaginatedTransactionResponse, createTransactionResponse, createTypedPaginatedTransactionResponse, createTypedTransactionResponse, typedTransactionData } from './chunk-YVB4ENKX.js';
|