@helium/blockchain-api 0.2.4 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -74
- package/dist/index.d.ts +3937 -2753
- package/dist/index.js +511 -255
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,69 +1,7 @@
|
|
|
1
|
-
import { createORPCClient } from '@orpc/client';
|
|
2
|
-
import { RPCLink } from '@orpc/client/fetch';
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { oc } from '@orpc/contract';
|
|
5
3
|
|
|
6
|
-
// src/
|
|
7
|
-
function createClient(options) {
|
|
8
|
-
const { url, transport = "rpc" } = options;
|
|
9
|
-
const endpoint = transport === "rpc" ? `${url}/rpc` : `${url}/api/v1`;
|
|
10
|
-
const link = new RPCLink({
|
|
11
|
-
url: endpoint,
|
|
12
|
-
fetch: (input, init) => {
|
|
13
|
-
return fetch(input, {
|
|
14
|
-
...init,
|
|
15
|
-
credentials: "include"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return createORPCClient(link);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// src/mock-client.ts
|
|
23
|
-
function createMockClient(mocks = {}) {
|
|
24
|
-
const createProxy = (path = []) => {
|
|
25
|
-
return new Proxy(() => {
|
|
26
|
-
}, {
|
|
27
|
-
get(_, prop) {
|
|
28
|
-
const newPath = [...path, prop];
|
|
29
|
-
let mockValue = mocks;
|
|
30
|
-
for (const key of newPath) {
|
|
31
|
-
if (mockValue && typeof mockValue === "object" && key in mockValue) {
|
|
32
|
-
mockValue = mockValue[key];
|
|
33
|
-
} else {
|
|
34
|
-
mockValue = void 0;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (typeof mockValue === "function") {
|
|
39
|
-
return mockValue;
|
|
40
|
-
}
|
|
41
|
-
if (mockValue && typeof mockValue === "object") {
|
|
42
|
-
return createProxy(newPath);
|
|
43
|
-
}
|
|
44
|
-
return createProxy(newPath);
|
|
45
|
-
},
|
|
46
|
-
apply(_, __, args) {
|
|
47
|
-
let mockValue = mocks;
|
|
48
|
-
for (const key of path) {
|
|
49
|
-
if (mockValue && typeof mockValue === "object" && key in mockValue) {
|
|
50
|
-
mockValue = mockValue[key];
|
|
51
|
-
} else {
|
|
52
|
-
mockValue = void 0;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (typeof mockValue === "function") {
|
|
57
|
-
return mockValue(...args);
|
|
58
|
-
}
|
|
59
|
-
throw new Error(
|
|
60
|
-
`Mock not implemented for: ${path.join(".")}. Provide a mock implementation in createMockClient().`
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
return createProxy();
|
|
66
|
-
}
|
|
4
|
+
// src/schemas/common.ts
|
|
67
5
|
var TransactionMetadataSchema = z.object({
|
|
68
6
|
type: z.string(),
|
|
69
7
|
description: z.string()
|
|
@@ -90,8 +28,8 @@ var ErrorResponseSchema = z.object({
|
|
|
90
28
|
error: z.string(),
|
|
91
29
|
details: z.array(z.string()).optional()
|
|
92
30
|
});
|
|
93
|
-
var WalletAddressSchema = z.string().
|
|
94
|
-
var PublicKeySchema = z.string().
|
|
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");
|
|
95
33
|
var HeliumPublicKeySchema = z.string().min(32).max(400);
|
|
96
34
|
var PaginationInputSchema = z.object({
|
|
97
35
|
page: z.coerce.number().int().min(1).default(1),
|
|
@@ -102,6 +40,182 @@ var PaginationOutputSchema = z.object({
|
|
|
102
40
|
page: z.number(),
|
|
103
41
|
totalPages: z.number()
|
|
104
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().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
|
+
var GetTokensInputSchema = z.object({
|
|
78
|
+
limit: z.coerce.number().int().min(1).max(100).default(50)
|
|
79
|
+
});
|
|
80
|
+
var GetQuoteInputSchema = z.object({
|
|
81
|
+
inputMint: z.string().min(1),
|
|
82
|
+
outputMint: z.string().min(1),
|
|
83
|
+
amount: z.string().min(1),
|
|
84
|
+
swapMode: z.enum(["ExactIn", "ExactOut"]).default("ExactIn"),
|
|
85
|
+
slippageBps: z.coerce.number().min(0).max(1e4).default(50)
|
|
86
|
+
});
|
|
87
|
+
var QuoteResponseSchema = z.object({
|
|
88
|
+
inputMint: z.string(),
|
|
89
|
+
inAmount: z.string(),
|
|
90
|
+
outputMint: z.string(),
|
|
91
|
+
outAmount: z.string(),
|
|
92
|
+
otherAmountThreshold: z.string(),
|
|
93
|
+
swapMode: z.string(),
|
|
94
|
+
slippageBps: z.number(),
|
|
95
|
+
platformFee: z.unknown().optional(),
|
|
96
|
+
priceImpactPct: z.string(),
|
|
97
|
+
routePlan: z.array(z.unknown()),
|
|
98
|
+
contextSlot: z.number().optional(),
|
|
99
|
+
timeTaken: z.number().optional()
|
|
100
|
+
}).passthrough();
|
|
101
|
+
var GetInstructionsInputSchema = z.object({
|
|
102
|
+
quoteResponse: QuoteResponseSchema,
|
|
103
|
+
userPublicKey: z.string().min(1),
|
|
104
|
+
destinationTokenAccount: z.string().optional(),
|
|
105
|
+
dynamicComputeUnitLimit: z.boolean().default(true),
|
|
106
|
+
prioritizationFeeLamports: z.object({
|
|
107
|
+
priorityLevelWithMaxLamports: z.object({
|
|
108
|
+
maxLamports: z.number().default(1e6),
|
|
109
|
+
priorityLevel: z.enum(["low", "medium", "high"]).default("medium")
|
|
110
|
+
})
|
|
111
|
+
}).optional()
|
|
112
|
+
});
|
|
113
|
+
var TokenSchema = z.object({
|
|
114
|
+
address: z.string(),
|
|
115
|
+
symbol: z.string(),
|
|
116
|
+
name: z.string(),
|
|
117
|
+
decimals: z.number(),
|
|
118
|
+
logoURI: z.string().optional(),
|
|
119
|
+
tags: z.array(z.string()).optional()
|
|
120
|
+
});
|
|
121
|
+
var TokenListOutputSchema = z.object({
|
|
122
|
+
tokens: z.array(TokenSchema)
|
|
123
|
+
});
|
|
124
|
+
var SwapTransactionDataSchema = TransactionDataSchema;
|
|
125
|
+
|
|
126
|
+
// src/schemas/fiat.ts
|
|
127
|
+
var InitKycInputSchema = z.object({
|
|
128
|
+
type: z.enum(["individual", "business"]).optional()
|
|
129
|
+
});
|
|
130
|
+
var CreateBankAccountInputSchema = z.object({
|
|
131
|
+
currency: z.string(),
|
|
132
|
+
account_type: z.string(),
|
|
133
|
+
bank_name: z.string(),
|
|
134
|
+
account_name: z.string(),
|
|
135
|
+
first_name: z.string().optional(),
|
|
136
|
+
last_name: z.string().optional(),
|
|
137
|
+
account_owner_name: z.string().optional(),
|
|
138
|
+
business_name: z.string().optional(),
|
|
139
|
+
account: z.object({
|
|
140
|
+
account_number: z.string(),
|
|
141
|
+
routing_number: z.string(),
|
|
142
|
+
checking_or_savings: z.string()
|
|
143
|
+
}),
|
|
144
|
+
address: z.object({
|
|
145
|
+
street_line_1: z.string(),
|
|
146
|
+
line2: z.string().optional(),
|
|
147
|
+
city: z.string(),
|
|
148
|
+
state: z.string(),
|
|
149
|
+
postal_code: z.string(),
|
|
150
|
+
country: z.string()
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
var GetBankAccountInputSchema = z.object({
|
|
154
|
+
id: z.string()
|
|
155
|
+
});
|
|
156
|
+
var DeleteBankAccountInputSchema = z.object({
|
|
157
|
+
id: z.number()
|
|
158
|
+
});
|
|
159
|
+
var GetSendQuoteInputSchema = z.object({
|
|
160
|
+
id: z.string(),
|
|
161
|
+
usdAmount: z.string()
|
|
162
|
+
});
|
|
163
|
+
var SendFundsInputSchema = z.object({
|
|
164
|
+
id: z.string(),
|
|
165
|
+
userAddress: z.string(),
|
|
166
|
+
quoteResponse: QuoteResponseSchema
|
|
167
|
+
});
|
|
168
|
+
var GetTransferInputSchema = z.object({
|
|
169
|
+
id: z.string()
|
|
170
|
+
});
|
|
171
|
+
var UpdateTransferInputSchema = z.object({
|
|
172
|
+
id: z.string(),
|
|
173
|
+
solanaSignature: z.string()
|
|
174
|
+
});
|
|
175
|
+
var KycStatusOutputSchema = z.object({
|
|
176
|
+
kycStatus: z.string(),
|
|
177
|
+
tosStatus: z.string(),
|
|
178
|
+
tosLink: z.string().nullable(),
|
|
179
|
+
kycLink: z.string().nullable(),
|
|
180
|
+
kycLinkId: z.string().nullable(),
|
|
181
|
+
accountType: z.string().optional(),
|
|
182
|
+
rejectionReasons: z.array(z.string()).optional()
|
|
183
|
+
});
|
|
184
|
+
var FeesOutputSchema = z.object({
|
|
185
|
+
developer_fee: z.string(),
|
|
186
|
+
developer_fee_percent: z.number()
|
|
187
|
+
});
|
|
188
|
+
var BankAccountSchema = z.object({
|
|
189
|
+
id: z.number().optional(),
|
|
190
|
+
bridgeUserId: z.number().optional(),
|
|
191
|
+
bridgeExternalAccountId: z.string().optional(),
|
|
192
|
+
accountName: z.string().optional(),
|
|
193
|
+
bankName: z.string().optional(),
|
|
194
|
+
lastFourDigits: z.string().optional(),
|
|
195
|
+
routingNumber: z.string().optional(),
|
|
196
|
+
accountType: z.string().optional(),
|
|
197
|
+
createdAt: z.union([z.string(), z.date()]).optional(),
|
|
198
|
+
updatedAt: z.union([z.string(), z.date()]).optional()
|
|
199
|
+
}).passthrough();
|
|
200
|
+
var BankAccountListOutputSchema = z.array(BankAccountSchema);
|
|
201
|
+
var DeleteBankAccountOutputSchema = z.object({
|
|
202
|
+
success: z.boolean()
|
|
203
|
+
});
|
|
204
|
+
var BridgeTransferSchema = z.object({
|
|
205
|
+
id: z.string(),
|
|
206
|
+
state: z.string(),
|
|
207
|
+
source_deposit_instructions: z.object({
|
|
208
|
+
to_address: z.string()
|
|
209
|
+
})
|
|
210
|
+
}).passthrough();
|
|
211
|
+
var SendFundsOutputSchema = z.object({
|
|
212
|
+
bridgeTransfer: BridgeTransferSchema,
|
|
213
|
+
transactionData: TransactionDataSchema
|
|
214
|
+
});
|
|
215
|
+
var UpdateTransferOutputSchema = z.object({
|
|
216
|
+
success: z.boolean()
|
|
217
|
+
});
|
|
218
|
+
var QuoteOutputSchema = QuoteResponseSchema;
|
|
105
219
|
var HealthResponseSchema = z.object({
|
|
106
220
|
ok: z.boolean(),
|
|
107
221
|
error: z.string().optional()
|
|
@@ -111,10 +225,8 @@ var GetBalancesInputSchema = z.object({
|
|
|
111
225
|
});
|
|
112
226
|
var TransferInputSchema = z.object({
|
|
113
227
|
walletAddress: WalletAddressSchema,
|
|
114
|
-
mint: z.string().nullable().optional(),
|
|
115
228
|
destination: z.string().min(32),
|
|
116
|
-
|
|
117
|
-
decimals: z.number().optional()
|
|
229
|
+
tokenAmount: TokenAmountInputSchema
|
|
118
230
|
});
|
|
119
231
|
var CreateHntAccountInputSchema = z.object({
|
|
120
232
|
walletAddress: WalletAddressSchema
|
|
@@ -145,78 +257,78 @@ var CreateHntAccountOutputSchema = z.object({
|
|
|
145
257
|
});
|
|
146
258
|
var HotspotTypeSchema = z.enum(["iot", "mobile", "all"]);
|
|
147
259
|
var GetHotspotsInputSchema = z.object({
|
|
148
|
-
walletAddress:
|
|
260
|
+
walletAddress: WalletAddressSchema,
|
|
149
261
|
type: HotspotTypeSchema.optional(),
|
|
150
262
|
page: z.coerce.number().int().min(1).default(1),
|
|
151
263
|
limit: z.coerce.number().int().min(1).max(100).default(10)
|
|
152
264
|
});
|
|
153
265
|
var ClaimRewardsInputSchema = z.object({
|
|
154
|
-
walletAddress:
|
|
266
|
+
walletAddress: WalletAddressSchema
|
|
155
267
|
});
|
|
156
268
|
var GetPendingRewardsInputSchema = z.object({
|
|
157
|
-
walletAddress:
|
|
269
|
+
walletAddress: WalletAddressSchema
|
|
270
|
+
});
|
|
271
|
+
var PendingRewards = z.object({
|
|
272
|
+
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."),
|
|
273
|
+
claimable: TokenAmountOutputSchema.describe("Total rewards that can be manually claimed now. Should be a subset of total."),
|
|
274
|
+
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.")
|
|
275
|
+
});
|
|
276
|
+
var GetPendingRewardsOutputSchema = z.object({
|
|
277
|
+
pending: PendingRewards.describe("Total rewards pending for the requested wallet - across all relevant hotspots."),
|
|
278
|
+
byHotspot: z.array(z.object({
|
|
279
|
+
hotspotPubKey: HeliumPublicKeySchema,
|
|
280
|
+
pending: PendingRewards
|
|
281
|
+
}))
|
|
158
282
|
});
|
|
159
283
|
var TransferHotspotInputSchema = z.object({
|
|
160
|
-
walletAddress:
|
|
161
|
-
hotspotPubkey:
|
|
162
|
-
recipient:
|
|
284
|
+
walletAddress: WalletAddressSchema,
|
|
285
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
286
|
+
recipient: WalletAddressSchema
|
|
163
287
|
});
|
|
164
288
|
var UpdateRewardsDestinationInputSchema = z.object({
|
|
165
|
-
walletAddress:
|
|
166
|
-
hotspotPubkey:
|
|
167
|
-
destination:
|
|
289
|
+
walletAddress: WalletAddressSchema,
|
|
290
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
291
|
+
destination: WalletAddressSchema,
|
|
168
292
|
lazyDistributors: z.array(z.string().min(32)).min(1)
|
|
169
293
|
});
|
|
170
294
|
var GetSplitInputSchema = z.object({
|
|
171
|
-
walletAddress:
|
|
172
|
-
hotspotPubkey:
|
|
173
|
-
});
|
|
174
|
-
var RewardSplitInputSchema = z.object({
|
|
175
|
-
address: z.string().min(32),
|
|
176
|
-
type: z.enum(["percentage", "fixed"]),
|
|
177
|
-
amount: z.number()
|
|
178
|
-
});
|
|
179
|
-
var ScheduleInputSchema = z.object({
|
|
180
|
-
frequency: z.enum(["daily", "weekly", "monthly"]),
|
|
181
|
-
time: z.string(),
|
|
182
|
-
timezone: z.string(),
|
|
183
|
-
dayOfWeek: z.string().optional(),
|
|
184
|
-
dayOfMonth: z.string().optional()
|
|
295
|
+
walletAddress: WalletAddressSchema,
|
|
296
|
+
hotspotPubkey: HeliumPublicKeySchema
|
|
185
297
|
});
|
|
186
298
|
var CreateSplitInputSchema = z.object({
|
|
187
|
-
walletAddress:
|
|
188
|
-
hotspotPubkey:
|
|
299
|
+
walletAddress: WalletAddressSchema,
|
|
300
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
189
301
|
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
190
302
|
schedule: ScheduleInputSchema,
|
|
191
303
|
lazyDistributor: z.string().min(32)
|
|
192
304
|
});
|
|
193
305
|
var DeleteSplitInputSchema = z.object({
|
|
194
|
-
walletAddress:
|
|
195
|
-
hotspotPubkey:
|
|
306
|
+
walletAddress: WalletAddressSchema,
|
|
307
|
+
hotspotPubkey: HeliumPublicKeySchema
|
|
196
308
|
});
|
|
197
309
|
var GetAutomationStatusInputSchema = z.object({
|
|
198
|
-
walletAddress:
|
|
310
|
+
walletAddress: WalletAddressSchema
|
|
199
311
|
});
|
|
200
312
|
var AutomationScheduleSchema = z.enum(["daily", "weekly", "monthly"]);
|
|
201
313
|
var SetupAutomationInputSchema = z.object({
|
|
202
|
-
walletAddress:
|
|
314
|
+
walletAddress: WalletAddressSchema,
|
|
203
315
|
schedule: AutomationScheduleSchema,
|
|
204
316
|
duration: z.number().int().min(1),
|
|
205
317
|
// Number of claims
|
|
206
318
|
totalHotspots: z.number().int().min(1)
|
|
207
319
|
});
|
|
208
320
|
var FundAutomationInputSchema = z.object({
|
|
209
|
-
walletAddress:
|
|
321
|
+
walletAddress: WalletAddressSchema,
|
|
210
322
|
additionalDuration: z.number().int().min(1)
|
|
211
323
|
// Additional number of claims
|
|
212
324
|
});
|
|
213
325
|
var GetFundingEstimateInputSchema = z.object({
|
|
214
|
-
walletAddress:
|
|
326
|
+
walletAddress: WalletAddressSchema,
|
|
215
327
|
duration: z.coerce.number().int().min(1)
|
|
216
328
|
// Number of claims to estimate funding for
|
|
217
329
|
});
|
|
218
330
|
var CloseAutomationInputSchema = z.object({
|
|
219
|
-
walletAddress:
|
|
331
|
+
walletAddress: WalletAddressSchema
|
|
220
332
|
});
|
|
221
333
|
var DeviceTypeSchema = z.enum([
|
|
222
334
|
"iot-gateway",
|
|
@@ -263,7 +375,7 @@ var UpdateRewardsDestinationOutputSchema = z.object({
|
|
|
263
375
|
var SplitShareSchema = z.object({
|
|
264
376
|
wallet: z.string(),
|
|
265
377
|
delegate: z.string(),
|
|
266
|
-
fixed:
|
|
378
|
+
fixed: TokenAmountOutputSchema,
|
|
267
379
|
shares: z.number()
|
|
268
380
|
});
|
|
269
381
|
var SplitResponseSchema = z.object({
|
|
@@ -278,9 +390,6 @@ var CreateSplitOutputSchema = z.object({
|
|
|
278
390
|
var DeleteSplitOutputSchema = z.object({
|
|
279
391
|
transactionData: TransactionDataSchema
|
|
280
392
|
});
|
|
281
|
-
var PendingRewardsOutputSchema = z.object({
|
|
282
|
-
pending: z.string()
|
|
283
|
-
});
|
|
284
393
|
var AutomationStatusOutputSchema = z.object({
|
|
285
394
|
hasExistingAutomation: z.boolean(),
|
|
286
395
|
isOutOfSol: z.boolean(),
|
|
@@ -336,70 +445,218 @@ var FundingEstimateOutputSchema = z.object({
|
|
|
336
445
|
currentPdaWalletBalance: z.string()
|
|
337
446
|
// Current balance in pdaWallet (lamports as string)
|
|
338
447
|
});
|
|
339
|
-
var
|
|
448
|
+
var WifiDeploymentInfoSchema = z.object({
|
|
449
|
+
type: z.literal("WIFI"),
|
|
450
|
+
antenna: z.number().int(),
|
|
451
|
+
elevation: z.number(),
|
|
452
|
+
azimuth: z.number().min(0).max(360),
|
|
453
|
+
mechanicalDownTilt: z.number(),
|
|
454
|
+
electricalDownTilt: z.number(),
|
|
455
|
+
serial: z.string().optional()
|
|
456
|
+
});
|
|
457
|
+
var CbrsRadioInfoSchema = z.object({
|
|
458
|
+
radioId: z.string(),
|
|
459
|
+
elevation: z.number()
|
|
460
|
+
});
|
|
461
|
+
var CbrsDeploymentInfoSchema = z.object({
|
|
462
|
+
type: z.literal("CBRS"),
|
|
463
|
+
radioInfos: z.array(CbrsRadioInfoSchema).min(1)
|
|
464
|
+
});
|
|
465
|
+
var DeploymentInfoSchema = z.discriminatedUnion("type", [
|
|
466
|
+
WifiDeploymentInfoSchema,
|
|
467
|
+
CbrsDeploymentInfoSchema
|
|
468
|
+
]);
|
|
469
|
+
var LocationSchema = z.object({
|
|
470
|
+
lat: z.number().min(-90).max(90),
|
|
471
|
+
lng: z.number().min(-180).max(180)
|
|
472
|
+
});
|
|
473
|
+
var IotUpdateSchema = z.object({
|
|
474
|
+
deviceType: z.literal("iot"),
|
|
340
475
|
entityPubKey: HeliumPublicKeySchema,
|
|
341
476
|
walletAddress: WalletAddressSchema,
|
|
342
|
-
location:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}),
|
|
477
|
+
location: LocationSchema.optional(),
|
|
478
|
+
gain: z.number().optional(),
|
|
479
|
+
elevation: z.number().optional(),
|
|
346
480
|
azimuth: z.number().min(0).max(360).optional()
|
|
347
481
|
});
|
|
348
|
-
var
|
|
349
|
-
|
|
482
|
+
var MobileUpdateSchema = z.object({
|
|
483
|
+
deviceType: z.literal("mobile"),
|
|
484
|
+
entityPubKey: HeliumPublicKeySchema,
|
|
485
|
+
walletAddress: WalletAddressSchema,
|
|
486
|
+
location: LocationSchema.optional(),
|
|
487
|
+
deploymentInfo: DeploymentInfoSchema.optional()
|
|
350
488
|
});
|
|
351
|
-
var
|
|
352
|
-
|
|
489
|
+
var UpdateHotspotInfoInputSchema = z.discriminatedUnion("deviceType", [
|
|
490
|
+
IotUpdateSchema,
|
|
491
|
+
MobileUpdateSchema
|
|
492
|
+
]);
|
|
493
|
+
var UpdateHotspotInfoOutputSchema = z.object({
|
|
494
|
+
transactionData: TransactionDataSchema,
|
|
495
|
+
appliedTo: z.object({
|
|
496
|
+
iot: z.boolean(),
|
|
497
|
+
mobile: z.boolean()
|
|
498
|
+
})
|
|
353
499
|
});
|
|
354
|
-
var
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
500
|
+
var RewardSchedule = z.string().describe("UTC cron expression (e.g. '0 30 9 * * *')");
|
|
501
|
+
var RecipientShareInput = z.discriminatedUnion("type", [
|
|
502
|
+
z.object({
|
|
503
|
+
type: z.literal("FIXED"),
|
|
504
|
+
tokenAmount: TokenAmountInputSchema
|
|
505
|
+
}),
|
|
506
|
+
z.object({
|
|
507
|
+
type: z.literal("SHARES"),
|
|
508
|
+
shares: z.number().int().min(1).max(100).describe("Percentage share of rewards")
|
|
509
|
+
})
|
|
510
|
+
]);
|
|
511
|
+
var RecipientShareOutput = z.discriminatedUnion("type", [
|
|
512
|
+
z.object({
|
|
513
|
+
type: z.literal("FIXED"),
|
|
514
|
+
tokenAmount: TokenAmountOutputSchema
|
|
515
|
+
}),
|
|
516
|
+
z.object({
|
|
517
|
+
type: z.literal("SHARES"),
|
|
518
|
+
shares: z.number().int().min(1).max(100).describe("Percentage share of rewards")
|
|
519
|
+
})
|
|
520
|
+
]);
|
|
521
|
+
var RecipientConfigInput = z.discriminatedUnion("type", [
|
|
522
|
+
z.object({
|
|
523
|
+
type: z.literal("PRESET"),
|
|
524
|
+
walletAddress: WalletAddressSchema.describe(
|
|
525
|
+
"The wallet address of a preconfigured recipient"
|
|
526
|
+
),
|
|
527
|
+
receives: RecipientShareInput
|
|
528
|
+
}).describe("A recipient that uses a preset configuration"),
|
|
529
|
+
z.object({
|
|
530
|
+
type: z.literal("CLAIMABLE"),
|
|
531
|
+
giftedCurrency: TokenAmountInputSchema.describe(
|
|
532
|
+
"The amount of currency bundled in the contract, and gifted to the claimer upon creation"
|
|
533
|
+
),
|
|
534
|
+
receives: RecipientShareInput
|
|
535
|
+
}).describe(
|
|
536
|
+
"A recipient that in yet unknown, but will claim the pending contract"
|
|
537
|
+
)
|
|
538
|
+
]);
|
|
539
|
+
var RecipientConfigOutput = z.discriminatedUnion("type", [
|
|
540
|
+
z.object({
|
|
541
|
+
type: z.literal("PRESET"),
|
|
542
|
+
walletAddress: WalletAddressSchema.describe(
|
|
543
|
+
"The wallet address of a preconfigured recipient"
|
|
544
|
+
),
|
|
545
|
+
receives: RecipientShareOutput
|
|
546
|
+
}).describe("A recipient that uses a preset configuration"),
|
|
547
|
+
z.object({
|
|
548
|
+
type: z.literal("CLAIMABLE"),
|
|
549
|
+
giftedCurrency: TokenAmountOutputSchema.describe(
|
|
550
|
+
"The amount of currency bundled in the contract, and gifted to the claimer upon creation"
|
|
551
|
+
),
|
|
552
|
+
receives: RecipientShareOutput
|
|
553
|
+
}).describe(
|
|
554
|
+
"A recipient that in yet unknown, but will claim the pending contract"
|
|
555
|
+
)
|
|
556
|
+
]);
|
|
557
|
+
var PendingRewardContract = z.object({
|
|
558
|
+
delegateWalletAddress: WalletAddressSchema.describe(
|
|
559
|
+
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the pending contract."
|
|
560
|
+
),
|
|
561
|
+
recipients: z.array(RecipientConfigOutput).min(1).max(6).describe(
|
|
562
|
+
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
563
|
+
),
|
|
564
|
+
rewardSchedule: RewardSchedule.describe(
|
|
565
|
+
"The schedule on which rewards would be distributed to recipients"
|
|
566
|
+
)
|
|
360
567
|
});
|
|
361
|
-
var
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}).passthrough();
|
|
375
|
-
var GetInstructionsInputSchema = z.object({
|
|
376
|
-
quoteResponse: QuoteResponseSchema,
|
|
377
|
-
userPublicKey: z.string().min(1),
|
|
378
|
-
destinationTokenAccount: z.string().optional(),
|
|
379
|
-
dynamicComputeUnitLimit: z.boolean().default(true),
|
|
380
|
-
prioritizationFeeLamports: z.object({
|
|
381
|
-
priorityLevelWithMaxLamports: z.object({
|
|
382
|
-
maxLamports: z.number().default(1e6),
|
|
383
|
-
priorityLevel: z.enum(["low", "medium", "high"]).default("medium")
|
|
568
|
+
var ActiveRewardContract = z.object({
|
|
569
|
+
delegateWalletAddress: WalletAddressSchema.describe(
|
|
570
|
+
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the active contract."
|
|
571
|
+
),
|
|
572
|
+
entityOwnerAddress: WalletAddressSchema.describe(
|
|
573
|
+
"The wallet address that owns the entity (hotspot)"
|
|
574
|
+
),
|
|
575
|
+
recipients: z.array(
|
|
576
|
+
z.object({
|
|
577
|
+
walletAddress: WalletAddressSchema.describe(
|
|
578
|
+
"The wallet address of the reward recipient"
|
|
579
|
+
),
|
|
580
|
+
receives: RecipientShareOutput
|
|
384
581
|
})
|
|
385
|
-
|
|
582
|
+
).min(1).max(6).describe(
|
|
583
|
+
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
584
|
+
),
|
|
585
|
+
rewardSchedule: RewardSchedule.describe(
|
|
586
|
+
"The schedule on which rewards are distributed to recipients"
|
|
587
|
+
)
|
|
386
588
|
});
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
589
|
+
var FindRewardContractResponseSchema = z.discriminatedUnion("status", [
|
|
590
|
+
z.object({
|
|
591
|
+
status: z.literal("PENDING"),
|
|
592
|
+
contract: PendingRewardContract
|
|
593
|
+
}),
|
|
594
|
+
z.object({
|
|
595
|
+
status: z.literal("ACTIVE"),
|
|
596
|
+
contract: ActiveRewardContract
|
|
597
|
+
}),
|
|
598
|
+
z.object({
|
|
599
|
+
status: z.literal("NONE")
|
|
600
|
+
})
|
|
601
|
+
]);
|
|
602
|
+
var CreateRewardContractTransactionInputSchema = z.object({
|
|
603
|
+
delegateWalletAddress: WalletAddressSchema.describe(
|
|
604
|
+
"The wallet address of the contract delegate. This wallet is capable of taking admin actions (delete) on the contract."
|
|
605
|
+
),
|
|
606
|
+
recipients: z.array(RecipientConfigInput).min(1).max(6).refine((arr) => arr.filter((s) => s.type === "CLAIMABLE").length <= 1, {
|
|
607
|
+
message: "At most one recipient can be of type CLAIMABLE."
|
|
608
|
+
}).refine(
|
|
609
|
+
(arr) => {
|
|
610
|
+
const shareEntries = arr.filter((s) => s.receives.type === "SHARES");
|
|
611
|
+
if (shareEntries.length === 0) {
|
|
612
|
+
return true;
|
|
613
|
+
}
|
|
614
|
+
return shareEntries.reduce(
|
|
615
|
+
(acc, curr) => acc + (curr.receives.type === "SHARES" ? curr.receives.shares : 0),
|
|
616
|
+
0
|
|
617
|
+
) === 100;
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
message: "Total shares must equal 100."
|
|
621
|
+
}
|
|
622
|
+
).describe(
|
|
623
|
+
"An exhaustive list of recipients and their respective shares in the reward contract"
|
|
624
|
+
),
|
|
625
|
+
rewardSchedule: RewardSchedule.describe(
|
|
626
|
+
"The schedule on which rewards would be distributed to recipients"
|
|
627
|
+
)
|
|
394
628
|
});
|
|
395
|
-
var
|
|
396
|
-
|
|
629
|
+
var CreateRewardContractTransactionResponseSchema = z.object({
|
|
630
|
+
unsignedTransactionData: TransactionDataSchema.describe(
|
|
631
|
+
"The unsigned transaction data which, when signed and submitted will create the pending or finalized reward contract"
|
|
632
|
+
)
|
|
633
|
+
});
|
|
634
|
+
var DeleteRewardContractTransactionResponseSchema = z.object({
|
|
635
|
+
unsignedTransactionData: TransactionDataSchema.describe(
|
|
636
|
+
"The unsigned transaction data which, when signed and submitted will delete the contract"
|
|
637
|
+
)
|
|
638
|
+
});
|
|
639
|
+
var CreateInviteResponseSchema = z.object({
|
|
640
|
+
unsignedMessage: z.string().min(1).describe(
|
|
641
|
+
"The unsigned invite message which, when signed by the delegate's wallet, can be used by a recipient to claim the pending contract."
|
|
642
|
+
),
|
|
643
|
+
expiration: z.iso.datetime()
|
|
644
|
+
});
|
|
645
|
+
var ClaimInviteRequestSchema = z.object({
|
|
646
|
+
delegateSignature: z.string().min(1).describe("The signed invite message provided by the contract delegate."),
|
|
647
|
+
expiration: z.iso.datetime()
|
|
648
|
+
});
|
|
649
|
+
var ClaimInviteResponseSchema = z.object({
|
|
650
|
+
unsignedTransactionData: TransactionDataSchema.describe(
|
|
651
|
+
"The unsigned transaction data which, when signed and submitted will claim the pending reward contract"
|
|
652
|
+
)
|
|
397
653
|
});
|
|
398
|
-
var SwapTransactionDataSchema = TransactionDataSchema;
|
|
399
654
|
var SubmitInputSchema = z.object({
|
|
400
655
|
transactions: z.array(TransactionItemSchema),
|
|
401
656
|
parallel: z.boolean(),
|
|
402
|
-
tag: z.string().optional()
|
|
657
|
+
tag: z.string().optional(),
|
|
658
|
+
simulationCommitment: z.enum(["confirmed", "finalized"]).optional().default("confirmed"),
|
|
659
|
+
simulate: z.boolean().optional().default(true)
|
|
403
660
|
});
|
|
404
661
|
var GetInputSchema = z.object({
|
|
405
662
|
id: z.string(),
|
|
@@ -487,7 +744,7 @@ var WelcomePackListInputSchema = z.object({
|
|
|
487
744
|
var WelcomePackCreateInputSchema = z.object({
|
|
488
745
|
walletAddress: WalletAddressSchema,
|
|
489
746
|
assetId: z.string(),
|
|
490
|
-
solAmount:
|
|
747
|
+
solAmount: TokenAmountInputSchema,
|
|
491
748
|
rentRefund: z.string(),
|
|
492
749
|
assetReturnAddress: z.string(),
|
|
493
750
|
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
@@ -631,7 +888,7 @@ var hotspotsContract = oc.tag("Hotspot").prefix("/hotspots").router({
|
|
|
631
888
|
INSUFFICIENT_FUNDS
|
|
632
889
|
}),
|
|
633
890
|
/** Public: Get pending rewards for a wallet */
|
|
634
|
-
getPendingRewards: oc.route({ method: "GET", path: "/pending-rewards/{walletAddress}", summary: "Get pending rewards" }).input(GetPendingRewardsInputSchema).output(
|
|
891
|
+
getPendingRewards: oc.route({ method: "GET", path: "/pending-rewards/{walletAddress}", summary: "Get pending rewards" }).input(GetPendingRewardsInputSchema).output(GetPendingRewardsOutputSchema).errors({
|
|
635
892
|
BAD_REQUEST: { message: "Invalid wallet address", status: 400 },
|
|
636
893
|
INVALID_WALLET_ADDRESS
|
|
637
894
|
}),
|
|
@@ -662,28 +919,117 @@ var hotspotsContract = oc.tag("Hotspot").prefix("/hotspots").router({
|
|
|
662
919
|
NOT_FOUND
|
|
663
920
|
}),
|
|
664
921
|
/** Protected: Close automation */
|
|
665
|
-
closeAutomation: oc.route({ method: "POST", path: "/
|
|
922
|
+
closeAutomation: oc.route({ method: "POST", path: "/wallet/{walletAddress}/automation/close", summary: "Close automation" }).input(CloseAutomationInputSchema).output(CloseAutomationOutputSchema).errors({
|
|
666
923
|
NOT_FOUND
|
|
667
924
|
}),
|
|
668
925
|
/** Protected: Get automation status */
|
|
669
|
-
getAutomationStatus: oc.route({ method: "GET", path: "/
|
|
926
|
+
getAutomationStatus: oc.route({ method: "GET", path: "/wallet/{walletAddress}/automation/status", summary: "Get automation status" }).input(GetAutomationStatusInputSchema).output(AutomationStatusOutputSchema).errors({
|
|
670
927
|
NOT_FOUND
|
|
671
928
|
}),
|
|
672
929
|
/** Protected: Create automation */
|
|
673
930
|
createAutomation: oc.route({
|
|
674
931
|
method: "POST",
|
|
675
|
-
path: "/
|
|
932
|
+
path: "/wallet/{walletAddress}/automation",
|
|
676
933
|
summary: "Setup automation"
|
|
677
934
|
}).input(SetupAutomationInputSchema).output(SetupAutomationOutputSchema).errors({
|
|
678
935
|
NOT_FOUND
|
|
679
936
|
}),
|
|
680
937
|
/** Protected: Fund automation */
|
|
681
|
-
fundAutomation: oc.route({ method: "POST", path: "/
|
|
938
|
+
fundAutomation: oc.route({ method: "POST", path: "/wallet/{walletAddress}/automation/fund", summary: "Fund automation" }).input(FundAutomationInputSchema).output(FundAutomationOutputSchema).errors({
|
|
682
939
|
NOT_FOUND,
|
|
683
940
|
INSUFFICIENT_FUNDS
|
|
684
941
|
}),
|
|
685
942
|
/** Protected: Get funding estimate */
|
|
686
|
-
getFundingEstimate: oc.route({ method: "GET", path: "/
|
|
943
|
+
getFundingEstimate: oc.route({ method: "GET", path: "/wallet/{walletAddress}/automation/funding-estimate", summary: "Get funding estimate" }).input(GetFundingEstimateInputSchema).output(FundingEstimateOutputSchema).errors({}),
|
|
944
|
+
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({
|
|
945
|
+
NOT_FOUND,
|
|
946
|
+
UNAUTHORIZED,
|
|
947
|
+
BAD_REQUEST: { message: "Device type mismatch", status: 400 }
|
|
948
|
+
})
|
|
949
|
+
});
|
|
950
|
+
var rewardContract = oc.tag("Reward Contract").prefix("/hotspots").router({
|
|
951
|
+
find: oc.route({
|
|
952
|
+
method: "GET",
|
|
953
|
+
path: "/{entityPubKey}/reward-contract",
|
|
954
|
+
summary: "Get Contract",
|
|
955
|
+
description: "Retrieves the reward contract (pending or active) associated with a specific hotspot entity."
|
|
956
|
+
}).input(z.object({
|
|
957
|
+
entityPubKey: HeliumPublicKeySchema
|
|
958
|
+
})).errors({
|
|
959
|
+
NOT_FOUND,
|
|
960
|
+
BAD_REQUEST
|
|
961
|
+
}).output(FindRewardContractResponseSchema),
|
|
962
|
+
create: oc.route({
|
|
963
|
+
method: "POST",
|
|
964
|
+
path: "/{entityPubKey}/reward-contract",
|
|
965
|
+
summary: "Create Reward Contract",
|
|
966
|
+
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."
|
|
967
|
+
}).input(
|
|
968
|
+
CreateRewardContractTransactionInputSchema.extend({
|
|
969
|
+
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
970
|
+
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
971
|
+
})
|
|
972
|
+
).errors({
|
|
973
|
+
BAD_REQUEST,
|
|
974
|
+
CONFLICT,
|
|
975
|
+
NOT_FOUND,
|
|
976
|
+
UNAUTHORIZED,
|
|
977
|
+
// Does this belong here to guard gifted currency check?
|
|
978
|
+
INSUFFICIENT_FUNDS
|
|
979
|
+
}).output(CreateRewardContractTransactionResponseSchema),
|
|
980
|
+
delete: oc.route({
|
|
981
|
+
method: "DELETE",
|
|
982
|
+
path: "/{entityPubKey}/reward-contract",
|
|
983
|
+
summary: "Delete Pending Contract",
|
|
984
|
+
description: "Assembles an unsigned transaction to delete a reward contract (pending or active) for a specific hotspot entity."
|
|
985
|
+
}).input(
|
|
986
|
+
z.object({
|
|
987
|
+
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
988
|
+
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
989
|
+
})
|
|
990
|
+
).errors({
|
|
991
|
+
BAD_REQUEST,
|
|
992
|
+
NOT_FOUND,
|
|
993
|
+
// if wallet is not the delegate
|
|
994
|
+
UNAUTHORIZED
|
|
995
|
+
}).output(DeleteRewardContractTransactionResponseSchema),
|
|
996
|
+
invite: oc.route({
|
|
997
|
+
method: "POST",
|
|
998
|
+
path: "/{entityPubKey}/reward-contract/invite",
|
|
999
|
+
summary: "Create Invite",
|
|
1000
|
+
description: "Assembles details required to create a shareable invite to claim a pending reward contract."
|
|
1001
|
+
}).input(
|
|
1002
|
+
z.object({
|
|
1003
|
+
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1004
|
+
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller"),
|
|
1005
|
+
expirationDays: z.number().int().positive().max(365).default(7).describe("Number of days until the invite expires")
|
|
1006
|
+
})
|
|
1007
|
+
).errors({
|
|
1008
|
+
// if no hotspot or contract found
|
|
1009
|
+
NOT_FOUND,
|
|
1010
|
+
// if the contract is not pending
|
|
1011
|
+
BAD_REQUEST,
|
|
1012
|
+
// if wallet is not the delegate
|
|
1013
|
+
UNAUTHORIZED
|
|
1014
|
+
}).output(CreateInviteResponseSchema),
|
|
1015
|
+
claim: oc.route({
|
|
1016
|
+
method: "POST",
|
|
1017
|
+
path: "/{entityPubKey}/reward-contract/claim",
|
|
1018
|
+
summary: "Claim Invite",
|
|
1019
|
+
description: "Assembles an unsigned transaction which can be used to claim an invite."
|
|
1020
|
+
}).input(
|
|
1021
|
+
ClaimInviteRequestSchema.extend({
|
|
1022
|
+
entityPubKey: HeliumPublicKeySchema.describe("The public key of the hotspot entity"),
|
|
1023
|
+
signerWalletAddress: WalletAddressSchema.describe("The wallet address of the caller")
|
|
1024
|
+
})
|
|
1025
|
+
).errors({
|
|
1026
|
+
// if no hotspot or contract found
|
|
1027
|
+
NOT_FOUND,
|
|
1028
|
+
// if the contract is not pending
|
|
1029
|
+
BAD_REQUEST,
|
|
1030
|
+
// if wallet is not the delegate
|
|
1031
|
+
UNAUTHORIZED
|
|
1032
|
+
}).output(ClaimInviteResponseSchema)
|
|
687
1033
|
});
|
|
688
1034
|
var swapContract = oc.tag("Swap").router({
|
|
689
1035
|
getTokens: oc.route({ method: "GET", path: "/swap/tokens" }).input(GetTokensInputSchema).output(TokenListOutputSchema).errors({
|
|
@@ -725,7 +1071,8 @@ var welcomePacksContract = oc.tag("Welcome Packs").router({
|
|
|
725
1071
|
}),
|
|
726
1072
|
/** Protected: Create a new welcome pack */
|
|
727
1073
|
create: oc.route({ method: "POST", path: "/welcome-packs", summary: "Create a new welcome pack" }).input(WelcomePackCreateInputSchema).output(WelcomePackCreateOutputSchema).errors({
|
|
728
|
-
BAD_REQUEST
|
|
1074
|
+
BAD_REQUEST,
|
|
1075
|
+
CONFLICT
|
|
729
1076
|
}),
|
|
730
1077
|
/** Public: Get a specific welcome pack */
|
|
731
1078
|
get: oc.route({ method: "GET", path: "/welcome-packs/{walletAddress}/{packId}", summary: "Get a specific welcome pack" }).input(WelcomePackGetInputSchema).output(WelcomePackSchema).errors({
|
|
@@ -752,98 +1099,6 @@ var welcomePacksContract = oc.tag("Welcome Packs").router({
|
|
|
752
1099
|
NOT_FOUND
|
|
753
1100
|
})
|
|
754
1101
|
});
|
|
755
|
-
var InitKycInputSchema = z.object({
|
|
756
|
-
type: z.enum(["individual", "business"]).optional()
|
|
757
|
-
});
|
|
758
|
-
var CreateBankAccountInputSchema = z.object({
|
|
759
|
-
currency: z.string(),
|
|
760
|
-
account_type: z.string(),
|
|
761
|
-
bank_name: z.string(),
|
|
762
|
-
account_name: z.string(),
|
|
763
|
-
first_name: z.string().optional(),
|
|
764
|
-
last_name: z.string().optional(),
|
|
765
|
-
account_owner_name: z.string().optional(),
|
|
766
|
-
business_name: z.string().optional(),
|
|
767
|
-
account: z.object({
|
|
768
|
-
account_number: z.string(),
|
|
769
|
-
routing_number: z.string(),
|
|
770
|
-
checking_or_savings: z.string()
|
|
771
|
-
}),
|
|
772
|
-
address: z.object({
|
|
773
|
-
street_line_1: z.string(),
|
|
774
|
-
line2: z.string().optional(),
|
|
775
|
-
city: z.string(),
|
|
776
|
-
state: z.string(),
|
|
777
|
-
postal_code: z.string(),
|
|
778
|
-
country: z.string()
|
|
779
|
-
})
|
|
780
|
-
});
|
|
781
|
-
z.object({
|
|
782
|
-
id: z.string()
|
|
783
|
-
});
|
|
784
|
-
var DeleteBankAccountInputSchema = z.object({
|
|
785
|
-
id: z.number()
|
|
786
|
-
});
|
|
787
|
-
var GetSendQuoteInputSchema = z.object({
|
|
788
|
-
id: z.string(),
|
|
789
|
-
usdAmount: z.string()
|
|
790
|
-
});
|
|
791
|
-
var SendFundsInputSchema = z.object({
|
|
792
|
-
id: z.string(),
|
|
793
|
-
userAddress: z.string(),
|
|
794
|
-
quoteResponse: QuoteResponseSchema
|
|
795
|
-
});
|
|
796
|
-
z.object({
|
|
797
|
-
id: z.string()
|
|
798
|
-
});
|
|
799
|
-
var UpdateTransferInputSchema = z.object({
|
|
800
|
-
id: z.string(),
|
|
801
|
-
solanaSignature: z.string()
|
|
802
|
-
});
|
|
803
|
-
var KycStatusOutputSchema = z.object({
|
|
804
|
-
kycStatus: z.string(),
|
|
805
|
-
tosStatus: z.string(),
|
|
806
|
-
tosLink: z.string().nullable(),
|
|
807
|
-
kycLink: z.string().nullable(),
|
|
808
|
-
kycLinkId: z.string().nullable(),
|
|
809
|
-
accountType: z.string().optional(),
|
|
810
|
-
rejectionReasons: z.array(z.string()).optional()
|
|
811
|
-
});
|
|
812
|
-
var FeesOutputSchema = z.object({
|
|
813
|
-
developer_fee: z.string(),
|
|
814
|
-
developer_fee_percent: z.number()
|
|
815
|
-
});
|
|
816
|
-
var BankAccountSchema = z.object({
|
|
817
|
-
id: z.number().optional(),
|
|
818
|
-
bridgeUserId: z.number().optional(),
|
|
819
|
-
bridgeExternalAccountId: z.string().optional(),
|
|
820
|
-
accountName: z.string().optional(),
|
|
821
|
-
bankName: z.string().optional(),
|
|
822
|
-
lastFourDigits: z.string().optional(),
|
|
823
|
-
routingNumber: z.string().optional(),
|
|
824
|
-
accountType: z.string().optional(),
|
|
825
|
-
createdAt: z.union([z.string(), z.date()]).optional(),
|
|
826
|
-
updatedAt: z.union([z.string(), z.date()]).optional()
|
|
827
|
-
}).passthrough();
|
|
828
|
-
var BankAccountListOutputSchema = z.array(BankAccountSchema);
|
|
829
|
-
var DeleteBankAccountOutputSchema = z.object({
|
|
830
|
-
success: z.boolean()
|
|
831
|
-
});
|
|
832
|
-
var BridgeTransferSchema = z.object({
|
|
833
|
-
id: z.string(),
|
|
834
|
-
state: z.string(),
|
|
835
|
-
source_deposit_instructions: z.object({
|
|
836
|
-
to_address: z.string()
|
|
837
|
-
})
|
|
838
|
-
}).passthrough();
|
|
839
|
-
var SendFundsOutputSchema = z.object({
|
|
840
|
-
bridgeTransfer: BridgeTransferSchema,
|
|
841
|
-
transactionData: TransactionDataSchema
|
|
842
|
-
});
|
|
843
|
-
var UpdateTransferOutputSchema = z.object({
|
|
844
|
-
success: z.boolean()
|
|
845
|
-
});
|
|
846
|
-
var QuoteOutputSchema = QuoteResponseSchema;
|
|
847
1102
|
var fiatContract = oc.errors({
|
|
848
1103
|
UNAUTHENTICATED,
|
|
849
1104
|
UNAUTHORIZED
|
|
@@ -903,6 +1158,7 @@ var apiContract = oc.router({
|
|
|
903
1158
|
health: healthContract,
|
|
904
1159
|
tokens: tokensContract,
|
|
905
1160
|
hotspots: hotspotsContract,
|
|
1161
|
+
rewardContract,
|
|
906
1162
|
swap: swapContract,
|
|
907
1163
|
transactions: transactionsContract,
|
|
908
1164
|
welcomePacks: welcomePacksContract
|
|
@@ -913,4 +1169,4 @@ var fullApiContract = oc.router({
|
|
|
913
1169
|
webhooks: webhooksContract
|
|
914
1170
|
});
|
|
915
1171
|
|
|
916
|
-
export { AutomationScheduleSchema, AutomationStatusOutputSchema, BAD_REQUEST, BatchStatusOutputSchema, CONFLICT, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CloseAutomationInputSchema, CloseAutomationOutputSchema, CreateHntAccountInputSchema, CreateHntAccountOutputSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, ErrorResponseSchema, FundAutomationInputSchema, FundAutomationOutputSchema, FundingEstimateOutputSchema, GetAutomationStatusInputSchema, GetBalancesInputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetFundingEstimateInputSchema, GetHotspotsInputSchema, GetInputSchema, GetInstructionsInputSchema, GetPendingRewardsInputSchema, GetQuoteInputSchema, GetSplitInputSchema, GetTokensInputSchema, HealthResponseSchema, HeliumPublicKeySchema, HotspotSchema, HotspotSharesSchema, HotspotTypeSchema, HotspotsDataSchema, INSUFFICIENT_FUNDS, INVALID_WALLET_ADDRESS, NOT_FOUND, OwnershipTypeSchema, PaginationInputSchema, PaginationOutputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema,
|
|
1172
|
+
export { AutomationScheduleSchema, AutomationStatusOutputSchema, BAD_REQUEST, BankAccountListOutputSchema, BankAccountSchema, BatchStatusOutputSchema, BridgeTransferSchema, CONFLICT, ClaimInviteRequestSchema, ClaimInviteResponseSchema, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CloseAutomationInputSchema, CloseAutomationOutputSchema, CreateBankAccountInputSchema, CreateHntAccountInputSchema, CreateHntAccountOutputSchema, CreateInviteResponseSchema, CreateRewardContractTransactionInputSchema, CreateRewardContractTransactionResponseSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DeleteBankAccountInputSchema, DeleteBankAccountOutputSchema, DeleteRewardContractTransactionResponseSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, ErrorResponseSchema, FeesOutputSchema, FindRewardContractResponseSchema, 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, NOT_FOUND, OwnershipTypeSchema, PaginationInputSchema, PaginationOutputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema, PublicKeySchema, QuoteOutputSchema, QuoteResponseSchema, RATE_LIMITED, ResubmitInputSchema, ResubmitOutputSchema, RewardSplitInputSchema, SIMULATION_FAILED, ScheduleInputSchema, SendFundsInputSchema, SendFundsOutputSchema, SetupAutomationInputSchema, SetupAutomationOutputSchema, SplitResponseSchema, SplitShareSchema, SubmitInputSchema, SubmitOutputSchema, SwapTransactionDataSchema, TRANSACTION_FAILED, TokenAccountSchema, TokenAmountInputSchema, TokenAmountOutputSchema, TokenBalanceDataSchema, TokenListOutputSchema, TokenSchema, TransactionBatchRequestSchema, TransactionBatchResponseSchema, TransactionDataSchema, TransactionItemSchema, TransactionMetadataSchema, TransactionStatusSchema, TransferHotspotInputSchema, TransferHotspotOutputSchema, TransferInputSchema, TransferOutputSchema, UNAUTHENTICATED, UNAUTHORIZED, UpdateHotspotInfoInputSchema, UpdateHotspotInfoOutputSchema, UpdateRewardsDestinationInputSchema, UpdateRewardsDestinationOutputSchema, UpdateTransferInputSchema, UpdateTransferOutputSchema, WalletAddressSchema, WelcomePackClaimInputSchema, WelcomePackClaimOutputSchema, WelcomePackCreateInputSchema, WelcomePackCreateOutputSchema, WelcomePackDeleteInputSchema, WelcomePackDeleteOutputSchema, WelcomePackGetByAddressInputSchema, WelcomePackGetInputSchema, WelcomePackInviteInputSchema, WelcomePackInviteOutputSchema, WelcomePackListInputSchema, WelcomePackListOutputSchema, WelcomePackSchema, apiContract, fullApiContract };
|