@helium/blockchain-api 0.3.13 → 0.11.12
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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TransactionDataSchema } from './chunk-YVB4ENKX.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var GetTokensInputSchema = z.object({
|
|
5
|
+
limit: z.coerce.number().int().min(1).max(100).default(50)
|
|
6
|
+
});
|
|
7
|
+
var GetQuoteInputSchema = z.object({
|
|
8
|
+
inputMint: z.string().min(1),
|
|
9
|
+
outputMint: z.string().min(1),
|
|
10
|
+
amount: z.string().min(1),
|
|
11
|
+
swapMode: z.enum(["ExactIn", "ExactOut"]).default("ExactIn"),
|
|
12
|
+
slippageBps: z.coerce.number().min(0).max(1e4).default(50)
|
|
13
|
+
});
|
|
14
|
+
var QuoteResponseSchema = z.object({
|
|
15
|
+
inputMint: z.string(),
|
|
16
|
+
inAmount: z.string(),
|
|
17
|
+
outputMint: z.string(),
|
|
18
|
+
outAmount: z.string(),
|
|
19
|
+
otherAmountThreshold: z.string(),
|
|
20
|
+
swapMode: z.string(),
|
|
21
|
+
slippageBps: z.number(),
|
|
22
|
+
platformFee: z.unknown().optional(),
|
|
23
|
+
priceImpactPct: z.string(),
|
|
24
|
+
routePlan: z.array(z.unknown()),
|
|
25
|
+
contextSlot: z.number().optional(),
|
|
26
|
+
timeTaken: z.number().optional()
|
|
27
|
+
}).passthrough();
|
|
28
|
+
var GetInstructionsInputSchema = z.object({
|
|
29
|
+
quoteResponse: QuoteResponseSchema,
|
|
30
|
+
userPublicKey: z.string().min(1),
|
|
31
|
+
destinationTokenAccount: z.string().optional(),
|
|
32
|
+
dynamicComputeUnitLimit: z.boolean().default(true),
|
|
33
|
+
prioritizationFeeLamports: z.object({
|
|
34
|
+
priorityLevelWithMaxLamports: z.object({
|
|
35
|
+
maxLamports: z.number().default(1e6),
|
|
36
|
+
priorityLevel: z.enum(["low", "medium", "high"]).default("medium")
|
|
37
|
+
})
|
|
38
|
+
}).optional()
|
|
39
|
+
});
|
|
40
|
+
var TokenSchema = z.object({
|
|
41
|
+
address: z.string(),
|
|
42
|
+
symbol: z.string(),
|
|
43
|
+
name: z.string(),
|
|
44
|
+
decimals: z.number(),
|
|
45
|
+
logoURI: z.string().optional(),
|
|
46
|
+
tags: z.array(z.string()).optional()
|
|
47
|
+
});
|
|
48
|
+
var TokenListOutputSchema = z.object({
|
|
49
|
+
tokens: z.array(TokenSchema)
|
|
50
|
+
});
|
|
51
|
+
var SwapTransactionDataSchema = TransactionDataSchema;
|
|
52
|
+
|
|
53
|
+
export { GetInstructionsInputSchema, GetQuoteInputSchema, GetTokensInputSchema, QuoteResponseSchema, SwapTransactionDataSchema, TokenListOutputSchema, TokenSchema };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/errors/common.ts
|
|
4
|
+
var UNAUTHENTICATED = {
|
|
5
|
+
status: 401,
|
|
6
|
+
message: "Authentication required. Please sign in to continue."
|
|
7
|
+
};
|
|
8
|
+
var UNAUTHORIZED = {
|
|
9
|
+
status: 403,
|
|
10
|
+
message: "You do not have permission to access this resource."
|
|
11
|
+
};
|
|
12
|
+
var NOT_FOUND = {
|
|
13
|
+
status: 404,
|
|
14
|
+
message: "The requested resource was not found."
|
|
15
|
+
};
|
|
16
|
+
var BAD_REQUEST = {
|
|
17
|
+
status: 400,
|
|
18
|
+
message: "Invalid input data provided.",
|
|
19
|
+
data: z.object({
|
|
20
|
+
fields: z.array(z.string()).optional()
|
|
21
|
+
}).optional()
|
|
22
|
+
};
|
|
23
|
+
var INVALID_WALLET_ADDRESS = {
|
|
24
|
+
status: 400,
|
|
25
|
+
message: "The provided wallet address is invalid."
|
|
26
|
+
};
|
|
27
|
+
var RATE_LIMITED = {
|
|
28
|
+
status: 429,
|
|
29
|
+
message: "Too many requests. Please try again later."
|
|
30
|
+
};
|
|
31
|
+
var CONFLICT = {
|
|
32
|
+
status: 409,
|
|
33
|
+
message: "A resource with this identifier already exists."
|
|
34
|
+
};
|
|
35
|
+
var INSUFFICIENT_FUNDS = {
|
|
36
|
+
status: 400,
|
|
37
|
+
message: "Insufficient SOL balance to complete this transaction.",
|
|
38
|
+
data: z.object({
|
|
39
|
+
required: z.number(),
|
|
40
|
+
available: z.number()
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
var TRANSACTION_FAILED = {
|
|
44
|
+
status: 500,
|
|
45
|
+
message: "Transaction failed to execute.",
|
|
46
|
+
data: z.object({
|
|
47
|
+
logs: z.array(z.string()).optional(),
|
|
48
|
+
signature: z.string().optional()
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
var SIMULATION_FAILED = {
|
|
52
|
+
status: 400,
|
|
53
|
+
message: "Transaction simulation failed.",
|
|
54
|
+
data: z.object({
|
|
55
|
+
logs: z.array(z.string()).optional(),
|
|
56
|
+
link: z.string().optional()
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { BAD_REQUEST, CONFLICT, INSUFFICIENT_FUNDS, INVALID_WALLET_ADDRESS, NOT_FOUND, RATE_LIMITED, SIMULATION_FAILED, TRANSACTION_FAILED, UNAUTHENTICATED, UNAUTHORIZED };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { WalletAddressSchema, TokenAmountOutputSchema, HeliumPublicKeySchema, ScheduleInputSchema, RewardSplitInputSchema, createTransactionResponse } from './chunk-YVB4ENKX.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var HotspotTypeSchema = z.enum(["iot", "mobile", "all"]);
|
|
5
|
+
var GetHotspotsInputSchema = z.object({
|
|
6
|
+
walletAddress: WalletAddressSchema,
|
|
7
|
+
type: HotspotTypeSchema.optional(),
|
|
8
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
9
|
+
limit: z.coerce.number().int().min(1).max(100).default(10)
|
|
10
|
+
});
|
|
11
|
+
var ClaimRewardsInputSchema = z.object({
|
|
12
|
+
walletAddress: WalletAddressSchema
|
|
13
|
+
});
|
|
14
|
+
var GetPendingRewardsInputSchema = z.object({
|
|
15
|
+
walletAddress: WalletAddressSchema
|
|
16
|
+
});
|
|
17
|
+
var PendingRewards = z.object({
|
|
18
|
+
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."),
|
|
19
|
+
claimable: TokenAmountOutputSchema.describe("Total rewards that can be manually claimed now. Should be a subset of total."),
|
|
20
|
+
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.")
|
|
21
|
+
});
|
|
22
|
+
var GetPendingRewardsOutputSchema = z.object({
|
|
23
|
+
pending: PendingRewards.describe("Total rewards pending for the requested wallet - across all relevant hotspots."),
|
|
24
|
+
byHotspot: z.array(z.object({
|
|
25
|
+
hotspotPubKey: HeliumPublicKeySchema,
|
|
26
|
+
pending: PendingRewards
|
|
27
|
+
}))
|
|
28
|
+
});
|
|
29
|
+
var TransferHotspotInputSchema = z.object({
|
|
30
|
+
walletAddress: WalletAddressSchema,
|
|
31
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
32
|
+
recipient: WalletAddressSchema
|
|
33
|
+
});
|
|
34
|
+
var UpdateRewardsDestinationInputSchema = z.object({
|
|
35
|
+
walletAddress: WalletAddressSchema,
|
|
36
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
37
|
+
destination: WalletAddressSchema,
|
|
38
|
+
lazyDistributors: z.array(z.string().min(32)).min(1)
|
|
39
|
+
});
|
|
40
|
+
var GetSplitInputSchema = z.object({
|
|
41
|
+
walletAddress: WalletAddressSchema,
|
|
42
|
+
hotspotPubkey: HeliumPublicKeySchema
|
|
43
|
+
});
|
|
44
|
+
var CreateSplitInputSchema = z.object({
|
|
45
|
+
walletAddress: WalletAddressSchema,
|
|
46
|
+
hotspotPubkey: HeliumPublicKeySchema,
|
|
47
|
+
rewardsSplit: z.array(RewardSplitInputSchema),
|
|
48
|
+
schedule: ScheduleInputSchema,
|
|
49
|
+
lazyDistributor: z.string().min(32)
|
|
50
|
+
});
|
|
51
|
+
var DeleteSplitInputSchema = z.object({
|
|
52
|
+
walletAddress: WalletAddressSchema,
|
|
53
|
+
hotspotPubkey: HeliumPublicKeySchema
|
|
54
|
+
});
|
|
55
|
+
var GetAutomationStatusInputSchema = z.object({
|
|
56
|
+
walletAddress: WalletAddressSchema
|
|
57
|
+
});
|
|
58
|
+
var AutomationScheduleSchema = z.enum(["daily", "weekly", "monthly"]);
|
|
59
|
+
var SetupAutomationInputSchema = z.object({
|
|
60
|
+
walletAddress: WalletAddressSchema,
|
|
61
|
+
schedule: AutomationScheduleSchema,
|
|
62
|
+
duration: z.number().int().min(1),
|
|
63
|
+
// Number of claims
|
|
64
|
+
totalHotspots: z.number().int().min(1)
|
|
65
|
+
});
|
|
66
|
+
var FundAutomationInputSchema = z.object({
|
|
67
|
+
walletAddress: WalletAddressSchema,
|
|
68
|
+
additionalDuration: z.number().int().min(1)
|
|
69
|
+
// Additional number of claims
|
|
70
|
+
});
|
|
71
|
+
var GetFundingEstimateInputSchema = z.object({
|
|
72
|
+
walletAddress: WalletAddressSchema,
|
|
73
|
+
duration: z.coerce.number().int().min(1)
|
|
74
|
+
// Number of claims to estimate funding for
|
|
75
|
+
});
|
|
76
|
+
var CloseAutomationInputSchema = z.object({
|
|
77
|
+
walletAddress: WalletAddressSchema
|
|
78
|
+
});
|
|
79
|
+
var DeviceTypeSchema = z.enum([
|
|
80
|
+
"iot-gateway",
|
|
81
|
+
"wifiIndoor",
|
|
82
|
+
"wifiOutdoor",
|
|
83
|
+
"wifiDataOnly",
|
|
84
|
+
"cbrs"
|
|
85
|
+
]);
|
|
86
|
+
var OwnershipTypeSchema = z.enum(["owner", "direct", "fanout", "all"]);
|
|
87
|
+
var HotspotSharesSchema = z.object({
|
|
88
|
+
fixed: z.string().optional(),
|
|
89
|
+
percentage: z.number().optional()
|
|
90
|
+
});
|
|
91
|
+
var HotspotSchema = z.object({
|
|
92
|
+
address: z.string(),
|
|
93
|
+
entityKey: z.string(),
|
|
94
|
+
name: z.string(),
|
|
95
|
+
type: HotspotTypeSchema,
|
|
96
|
+
deviceType: DeviceTypeSchema,
|
|
97
|
+
city: z.string().optional(),
|
|
98
|
+
state: z.string().optional(),
|
|
99
|
+
country: z.string().optional(),
|
|
100
|
+
asset: z.string(),
|
|
101
|
+
isOnline: z.boolean().optional(),
|
|
102
|
+
owner: z.string().optional(),
|
|
103
|
+
shares: HotspotSharesSchema.optional(),
|
|
104
|
+
ownershipType: z.string()
|
|
105
|
+
});
|
|
106
|
+
var HotspotsDataSchema = z.object({
|
|
107
|
+
hotspots: z.array(HotspotSchema),
|
|
108
|
+
total: z.number(),
|
|
109
|
+
page: z.number(),
|
|
110
|
+
totalPages: z.number()
|
|
111
|
+
});
|
|
112
|
+
var ClaimRewardsOutputSchema = createTransactionResponse();
|
|
113
|
+
var TransferHotspotOutputSchema = createTransactionResponse();
|
|
114
|
+
var UpdateRewardsDestinationOutputSchema = createTransactionResponse();
|
|
115
|
+
var CreateSplitOutputSchema = createTransactionResponse();
|
|
116
|
+
var DeleteSplitOutputSchema = createTransactionResponse();
|
|
117
|
+
var SetupAutomationOutputSchema = createTransactionResponse();
|
|
118
|
+
var FundAutomationOutputSchema = createTransactionResponse();
|
|
119
|
+
var CloseAutomationOutputSchema = createTransactionResponse();
|
|
120
|
+
var SplitShareSchema = z.object({
|
|
121
|
+
wallet: z.string(),
|
|
122
|
+
delegate: z.string(),
|
|
123
|
+
fixed: TokenAmountOutputSchema,
|
|
124
|
+
shares: z.number()
|
|
125
|
+
});
|
|
126
|
+
var SplitResponseSchema = z.object({
|
|
127
|
+
walletAddress: z.string(),
|
|
128
|
+
hotspotPubkey: z.string(),
|
|
129
|
+
splitAddress: z.string(),
|
|
130
|
+
shares: z.array(SplitShareSchema)
|
|
131
|
+
});
|
|
132
|
+
var AutomationStatusOutputSchema = z.object({
|
|
133
|
+
hasExistingAutomation: z.boolean(),
|
|
134
|
+
isOutOfSol: z.boolean(),
|
|
135
|
+
currentSchedule: z.object({
|
|
136
|
+
schedule: AutomationScheduleSchema,
|
|
137
|
+
time: z.string(),
|
|
138
|
+
nextRun: z.string()
|
|
139
|
+
// ISO date string
|
|
140
|
+
}).optional(),
|
|
141
|
+
rentFee: z.number(),
|
|
142
|
+
// Initial setup rent (BASE_AUTOMATION_RENT + TASK_RETURN_ACCOUNT_SIZE) if automation doesn't exist, 0 otherwise
|
|
143
|
+
recipientFee: z.number(),
|
|
144
|
+
// SOL needed for recipient accounts (if any)
|
|
145
|
+
operationalSol: z.number(),
|
|
146
|
+
// Total operational SOL needed for automation claims (cronJobFunding + pdaWalletFunding)
|
|
147
|
+
remainingClaims: z.number().optional(),
|
|
148
|
+
fundingPeriodInfo: z.object({
|
|
149
|
+
periodLength: AutomationScheduleSchema,
|
|
150
|
+
periodsRemaining: z.number(),
|
|
151
|
+
// Minimum of both pools
|
|
152
|
+
cronJobPeriodsRemaining: z.number(),
|
|
153
|
+
pdaWalletPeriodsRemaining: z.number()
|
|
154
|
+
}).optional(),
|
|
155
|
+
cronJobBalance: z.string(),
|
|
156
|
+
// lamports as string
|
|
157
|
+
pdaWalletBalance: z.string()
|
|
158
|
+
// lamports as string
|
|
159
|
+
});
|
|
160
|
+
var FundingEstimateOutputSchema = z.object({
|
|
161
|
+
rentFee: z.number(),
|
|
162
|
+
// Initial setup rent (BASE_AUTOMATION_RENT + TASK_RETURN_ACCOUNT_SIZE) if automation doesn't exist, 0 otherwise
|
|
163
|
+
cronJobFunding: z.number(),
|
|
164
|
+
// SOL needed for cron job account operations
|
|
165
|
+
pdaWalletFunding: z.number(),
|
|
166
|
+
// SOL needed for PDA wallet operations
|
|
167
|
+
recipientFee: z.number(),
|
|
168
|
+
// SOL needed for recipient accounts (if any)
|
|
169
|
+
operationalSol: z.number(),
|
|
170
|
+
// Total operational SOL needed for automation claims (cronJobFunding + pdaWalletFunding)
|
|
171
|
+
totalSolNeeded: z.number(),
|
|
172
|
+
// Total SOL needed including all fees (rentFee + operationalSol + recipientFee)
|
|
173
|
+
currentCronJobBalance: z.string(),
|
|
174
|
+
// Current balance in cronJob (lamports as string)
|
|
175
|
+
currentPdaWalletBalance: z.string()
|
|
176
|
+
// Current balance in pdaWallet (lamports as string)
|
|
177
|
+
});
|
|
178
|
+
var WifiDeploymentInfoSchema = z.object({
|
|
179
|
+
type: z.literal("WIFI"),
|
|
180
|
+
antenna: z.number().int().optional(),
|
|
181
|
+
elevation: z.number().optional(),
|
|
182
|
+
azimuth: z.number().min(0).max(360).optional(),
|
|
183
|
+
mechanicalDownTilt: z.number().optional(),
|
|
184
|
+
electricalDownTilt: z.number().optional(),
|
|
185
|
+
serial: z.string().optional().nullable()
|
|
186
|
+
});
|
|
187
|
+
var CbrsRadioInfoSchema = z.object({
|
|
188
|
+
radioId: z.string(),
|
|
189
|
+
elevation: z.number()
|
|
190
|
+
});
|
|
191
|
+
var CbrsDeploymentInfoSchema = z.object({
|
|
192
|
+
type: z.literal("CBRS"),
|
|
193
|
+
radioInfos: z.array(CbrsRadioInfoSchema).min(1)
|
|
194
|
+
});
|
|
195
|
+
var DeploymentInfoSchema = z.discriminatedUnion("type", [
|
|
196
|
+
WifiDeploymentInfoSchema,
|
|
197
|
+
CbrsDeploymentInfoSchema
|
|
198
|
+
]);
|
|
199
|
+
var LocationSchema = z.object({
|
|
200
|
+
lat: z.number().min(-90).max(90),
|
|
201
|
+
lng: z.number().min(-180).max(180)
|
|
202
|
+
});
|
|
203
|
+
var IotUpdateSchema = z.object({
|
|
204
|
+
deviceType: z.literal("iot"),
|
|
205
|
+
entityPubKey: HeliumPublicKeySchema,
|
|
206
|
+
walletAddress: WalletAddressSchema,
|
|
207
|
+
location: LocationSchema.optional(),
|
|
208
|
+
gain: z.number().optional(),
|
|
209
|
+
elevation: z.number().optional(),
|
|
210
|
+
azimuth: z.number().min(0).max(360).optional()
|
|
211
|
+
});
|
|
212
|
+
var MobileUpdateSchema = z.object({
|
|
213
|
+
deviceType: z.literal("mobile"),
|
|
214
|
+
entityPubKey: HeliumPublicKeySchema,
|
|
215
|
+
walletAddress: WalletAddressSchema,
|
|
216
|
+
location: LocationSchema.optional(),
|
|
217
|
+
deploymentInfo: DeploymentInfoSchema.optional()
|
|
218
|
+
});
|
|
219
|
+
var UpdateHotspotInfoInputSchema = z.discriminatedUnion("deviceType", [
|
|
220
|
+
IotUpdateSchema,
|
|
221
|
+
MobileUpdateSchema
|
|
222
|
+
]);
|
|
223
|
+
var UpdateHotspotInfoOutputSchema = createTransactionResponse().extend({
|
|
224
|
+
appliedTo: z.object({
|
|
225
|
+
iot: z.boolean(),
|
|
226
|
+
mobile: z.boolean()
|
|
227
|
+
})
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
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 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/schemas/webhooks.ts
|
|
4
|
+
var BridgeWebhookInputSchema = z.object({
|
|
5
|
+
type: z.string(),
|
|
6
|
+
kyc_link_id: z.string().optional(),
|
|
7
|
+
kyc_status: z.string().optional(),
|
|
8
|
+
tos_status: z.string().optional(),
|
|
9
|
+
customer_id: z.string().optional()
|
|
10
|
+
});
|
|
11
|
+
var BridgeWebhookOutputSchema = z.object({
|
|
12
|
+
success: z.boolean(),
|
|
13
|
+
error: z.string().optional()
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { BridgeWebhookInputSchema, BridgeWebhookOutputSchema };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { TransactionItemSchema, TransactionMetadataSchema, TokenAmountOutputSchema } from './chunk-YVB4ENKX.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var SubmitInputSchema = z.object({
|
|
5
|
+
transactions: z.array(TransactionItemSchema),
|
|
6
|
+
parallel: z.boolean(),
|
|
7
|
+
tag: z.string().optional(),
|
|
8
|
+
simulationCommitment: z.enum(["confirmed", "finalized"]).optional().default("confirmed"),
|
|
9
|
+
simulate: z.boolean().optional().default(true)
|
|
10
|
+
});
|
|
11
|
+
var GetInputSchema = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
commitment: z.enum(["confirmed", "finalized"])
|
|
14
|
+
});
|
|
15
|
+
var ResubmitInputSchema = z.object({
|
|
16
|
+
id: z.string()
|
|
17
|
+
});
|
|
18
|
+
var GetByPayerInputSchema = z.object({
|
|
19
|
+
payer: z.string().min(32),
|
|
20
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
21
|
+
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
22
|
+
status: z.string().optional().default("pending")
|
|
23
|
+
});
|
|
24
|
+
var GetByPayerAndTagInputSchema = z.object({
|
|
25
|
+
payer: z.string().min(32),
|
|
26
|
+
tag: z.string(),
|
|
27
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
28
|
+
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
29
|
+
status: z.string().optional().default("pending")
|
|
30
|
+
});
|
|
31
|
+
var SubmitOutputSchema = z.object({
|
|
32
|
+
batchId: z.string(),
|
|
33
|
+
message: z.string().optional()
|
|
34
|
+
});
|
|
35
|
+
var TransactionStateSchema = z.union([
|
|
36
|
+
z.literal("pending"),
|
|
37
|
+
z.literal("confirmed"),
|
|
38
|
+
z.literal("failed"),
|
|
39
|
+
z.literal("expired"),
|
|
40
|
+
z.literal("partial")
|
|
41
|
+
]);
|
|
42
|
+
var TransactionStatusSchema = z.object({
|
|
43
|
+
signature: z.string(),
|
|
44
|
+
status: TransactionStateSchema,
|
|
45
|
+
transaction: z.unknown().optional()
|
|
46
|
+
});
|
|
47
|
+
var BatchStatusOutputSchema = z.object({
|
|
48
|
+
batchId: z.string(),
|
|
49
|
+
status: TransactionStateSchema,
|
|
50
|
+
submissionType: z.union([
|
|
51
|
+
z.literal("single"),
|
|
52
|
+
z.literal("parallel"),
|
|
53
|
+
z.literal("sequential"),
|
|
54
|
+
z.literal("jito_bundle")
|
|
55
|
+
]),
|
|
56
|
+
parallel: z.boolean(),
|
|
57
|
+
transactions: z.array(TransactionStatusSchema),
|
|
58
|
+
jitoBundleId: z.string().optional().nullable(),
|
|
59
|
+
jitoBundleStatus: z.unknown().optional().nullable()
|
|
60
|
+
});
|
|
61
|
+
var ResubmitOutputSchema = z.object({
|
|
62
|
+
success: z.boolean(),
|
|
63
|
+
message: z.string(),
|
|
64
|
+
error: z.string().optional(),
|
|
65
|
+
newSignatures: z.array(z.string()).optional()
|
|
66
|
+
});
|
|
67
|
+
var PayerBatchSummarySchema = z.object({
|
|
68
|
+
batchId: z.string(),
|
|
69
|
+
tag: z.string().optional(),
|
|
70
|
+
status: z.string(),
|
|
71
|
+
submissionType: z.string(),
|
|
72
|
+
parallel: z.boolean(),
|
|
73
|
+
createdAt: z.string(),
|
|
74
|
+
updatedAt: z.string(),
|
|
75
|
+
transactions: z.array(
|
|
76
|
+
z.object({
|
|
77
|
+
metadata: TransactionMetadataSchema.optional()
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
});
|
|
81
|
+
var PayerBatchesOutputSchema = z.object({
|
|
82
|
+
payer: z.string(),
|
|
83
|
+
batches: z.array(PayerBatchSummarySchema),
|
|
84
|
+
pagination: z.object({
|
|
85
|
+
page: z.number(),
|
|
86
|
+
limit: z.number(),
|
|
87
|
+
total: z.number(),
|
|
88
|
+
totalPages: z.number()
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
var EstimateInputSchema = z.object({
|
|
92
|
+
transactions: z.array(TransactionItemSchema),
|
|
93
|
+
parallel: z.boolean(),
|
|
94
|
+
tag: z.string().optional(),
|
|
95
|
+
simulationCommitment: z.enum(["confirmed", "finalized"]).optional().default("confirmed")
|
|
96
|
+
});
|
|
97
|
+
var CostBreakdownSchema = z.object({
|
|
98
|
+
transactionFees: TokenAmountOutputSchema,
|
|
99
|
+
rent: TokenAmountOutputSchema,
|
|
100
|
+
tokenTransfers: z.array(TokenAmountOutputSchema)
|
|
101
|
+
});
|
|
102
|
+
var TransactionEstimateSchema = z.object({
|
|
103
|
+
index: z.number(),
|
|
104
|
+
computeUnits: z.number(),
|
|
105
|
+
success: z.boolean(),
|
|
106
|
+
error: z.string().optional(),
|
|
107
|
+
logs: z.array(z.string()).optional(),
|
|
108
|
+
costs: CostBreakdownSchema
|
|
109
|
+
});
|
|
110
|
+
var EstimateOutputSchema = z.object({
|
|
111
|
+
totalSol: TokenAmountOutputSchema,
|
|
112
|
+
breakdown: CostBreakdownSchema,
|
|
113
|
+
transactions: z.array(TransactionEstimateSchema)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export { BatchStatusOutputSchema, EstimateInputSchema, EstimateOutputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetInputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema, ResubmitInputSchema, ResubmitOutputSchema, SubmitInputSchema, SubmitOutputSchema, TransactionStatusSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { PublicKeySchema, TokenAmountInputSchema, WalletAddressSchema, createTypedTransactionResponse, createTransactionResponse, createPaginatedTransactionResponse, createTypedPaginatedTransactionResponse } from './chunk-YVB4ENKX.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var LockupKindSchema = z.enum(["cliff", "constant"]);
|
|
5
|
+
var CreatePositionInputSchema = z.object({
|
|
6
|
+
walletAddress: WalletAddressSchema.describe(
|
|
7
|
+
"Wallet address that will own the position"
|
|
8
|
+
),
|
|
9
|
+
tokenAmount: TokenAmountInputSchema.describe(
|
|
10
|
+
"Token amount and mint to deposit"
|
|
11
|
+
),
|
|
12
|
+
lockupKind: LockupKindSchema.describe("Type of lockup: cliff or constant"),
|
|
13
|
+
lockupPeriodsInDays: z.number().int().min(1).max(2920).describe("Number of days to lock the position (max ~8 years)"),
|
|
14
|
+
subDaoMint: PublicKeySchema.optional().describe(
|
|
15
|
+
"Sub-DAO mint to delegate to immediately after creation (optional)"
|
|
16
|
+
),
|
|
17
|
+
automationEnabled: z.boolean().optional().describe("Enable delegation claim bot automation (optional)")
|
|
18
|
+
});
|
|
19
|
+
var ClosePositionInputSchema = z.object({
|
|
20
|
+
walletAddress: WalletAddressSchema.describe(
|
|
21
|
+
"Wallet address that owns the position"
|
|
22
|
+
),
|
|
23
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
24
|
+
});
|
|
25
|
+
var ExtendPositionInputSchema = z.object({
|
|
26
|
+
walletAddress: WalletAddressSchema.describe(
|
|
27
|
+
"Wallet address that owns the position"
|
|
28
|
+
),
|
|
29
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
30
|
+
lockupPeriodsInDays: z.number().int().min(1).describe("New lockup period in days")
|
|
31
|
+
});
|
|
32
|
+
var FlipLockupKindInputSchema = z.object({
|
|
33
|
+
walletAddress: WalletAddressSchema.describe(
|
|
34
|
+
"Wallet address that owns the position"
|
|
35
|
+
),
|
|
36
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
37
|
+
});
|
|
38
|
+
var ResetLockupInputSchema = z.object({
|
|
39
|
+
walletAddress: WalletAddressSchema.describe(
|
|
40
|
+
"Wallet address that owns the position"
|
|
41
|
+
),
|
|
42
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
43
|
+
lockupKind: LockupKindSchema.describe("New lockup type: cliff or constant"),
|
|
44
|
+
lockupPeriodsInDays: z.number().int().min(1).max(1460).describe("New lockup period in days (max 4 years)")
|
|
45
|
+
});
|
|
46
|
+
var SplitPositionInputSchema = z.object({
|
|
47
|
+
walletAddress: WalletAddressSchema.describe(
|
|
48
|
+
"Wallet address that owns the position"
|
|
49
|
+
),
|
|
50
|
+
positionMint: PublicKeySchema.describe(
|
|
51
|
+
"Mint address of the source position NFT"
|
|
52
|
+
),
|
|
53
|
+
amount: z.string().regex(/^\d+$/, "Amount must be a whole number in smallest unit (bones)").describe(
|
|
54
|
+
"Raw token amount to transfer to new position (in smallest unit)"
|
|
55
|
+
),
|
|
56
|
+
lockupKind: LockupKindSchema.describe("Lockup type for new position"),
|
|
57
|
+
lockupPeriodsInDays: z.number().int().min(1).describe("Lockup period for new position in days")
|
|
58
|
+
});
|
|
59
|
+
var TransferPositionInputSchema = z.object({
|
|
60
|
+
walletAddress: WalletAddressSchema.describe(
|
|
61
|
+
"Wallet address that owns both positions"
|
|
62
|
+
),
|
|
63
|
+
positionMint: PublicKeySchema.describe(
|
|
64
|
+
"Mint address of the source position NFT"
|
|
65
|
+
),
|
|
66
|
+
targetPositionMint: PublicKeySchema.describe(
|
|
67
|
+
"Mint address of the target position NFT"
|
|
68
|
+
),
|
|
69
|
+
amount: z.string().regex(/^\d+$/, "Amount must be a whole number in smallest unit (bones)").describe("Raw token amount to transfer (in smallest unit)")
|
|
70
|
+
});
|
|
71
|
+
var DelegatePositionInputSchema = z.object({
|
|
72
|
+
walletAddress: WalletAddressSchema.describe(
|
|
73
|
+
"Wallet address that owns the positions"
|
|
74
|
+
),
|
|
75
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to delegate"),
|
|
76
|
+
subDaoMint: PublicKeySchema.describe("Sub-DAO mint address to delegate to"),
|
|
77
|
+
automationEnabled: z.boolean().optional().describe("Enable delegation claim bot automation")
|
|
78
|
+
});
|
|
79
|
+
var ExtendDelegationInputSchema = z.object({
|
|
80
|
+
walletAddress: WalletAddressSchema.describe(
|
|
81
|
+
"Wallet address that owns the position"
|
|
82
|
+
),
|
|
83
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
84
|
+
});
|
|
85
|
+
var UndelegateInputSchema = z.object({
|
|
86
|
+
walletAddress: WalletAddressSchema.describe(
|
|
87
|
+
"Wallet address that owns the position"
|
|
88
|
+
),
|
|
89
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT")
|
|
90
|
+
});
|
|
91
|
+
var ClaimDelegationRewardsInputSchema = z.object({
|
|
92
|
+
walletAddress: WalletAddressSchema.describe(
|
|
93
|
+
"Wallet address that owns the positions"
|
|
94
|
+
),
|
|
95
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to claim rewards for")
|
|
96
|
+
});
|
|
97
|
+
var VoteInputSchema = z.object({
|
|
98
|
+
walletAddress: WalletAddressSchema.describe(
|
|
99
|
+
"Wallet address that owns the positions"
|
|
100
|
+
),
|
|
101
|
+
proposalKey: PublicKeySchema.describe("Public key of the proposal to vote on"),
|
|
102
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to vote with"),
|
|
103
|
+
choice: z.number().int().min(0).describe("The choice index to vote for")
|
|
104
|
+
});
|
|
105
|
+
var RelinquishVoteInputSchema = z.object({
|
|
106
|
+
walletAddress: WalletAddressSchema.describe(
|
|
107
|
+
"Wallet address that owns the positions"
|
|
108
|
+
),
|
|
109
|
+
proposalKey: PublicKeySchema.describe(
|
|
110
|
+
"Public key of the proposal to relinquish vote from"
|
|
111
|
+
),
|
|
112
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to relinquish votes for"),
|
|
113
|
+
choice: z.number().int().min(0).describe("The choice index to relinquish")
|
|
114
|
+
});
|
|
115
|
+
var RelinquishPositionVotesInputSchema = z.object({
|
|
116
|
+
walletAddress: WalletAddressSchema.describe(
|
|
117
|
+
"Wallet address that owns the position"
|
|
118
|
+
),
|
|
119
|
+
positionMint: PublicKeySchema.describe("Mint address of the position NFT"),
|
|
120
|
+
organization: PublicKeySchema.describe(
|
|
121
|
+
"Public key of the DAO organization to relinquish votes from"
|
|
122
|
+
)
|
|
123
|
+
});
|
|
124
|
+
var AssignProxiesInputSchema = z.object({
|
|
125
|
+
walletAddress: WalletAddressSchema.describe(
|
|
126
|
+
"Wallet address that owns the positions"
|
|
127
|
+
),
|
|
128
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to assign proxy for"),
|
|
129
|
+
proxyKey: PublicKeySchema.describe(
|
|
130
|
+
"Public key of the proxy recipient who will vote on your behalf"
|
|
131
|
+
),
|
|
132
|
+
expirationTime: z.number().int().describe("Unix timestamp when the proxy assignment expires")
|
|
133
|
+
});
|
|
134
|
+
var UnassignProxiesInputSchema = z.object({
|
|
135
|
+
walletAddress: WalletAddressSchema.describe(
|
|
136
|
+
"Wallet address that owns the positions"
|
|
137
|
+
),
|
|
138
|
+
proxyKey: PublicKeySchema.describe("Public key of the proxy to unassign"),
|
|
139
|
+
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to unassign proxy for")
|
|
140
|
+
});
|
|
141
|
+
var CreatePositionMetadataSchema = z.object({
|
|
142
|
+
type: z.string(),
|
|
143
|
+
description: z.string(),
|
|
144
|
+
positionMint: z.string().optional()
|
|
145
|
+
});
|
|
146
|
+
var SplitPositionMetadataSchema = z.object({
|
|
147
|
+
type: z.string(),
|
|
148
|
+
description: z.string(),
|
|
149
|
+
newPositionMint: z.string().optional()
|
|
150
|
+
});
|
|
151
|
+
var RelinquishAllVotesMetadataSchema = z.object({
|
|
152
|
+
type: z.string(),
|
|
153
|
+
description: z.string(),
|
|
154
|
+
votesRelinquished: z.number().optional()
|
|
155
|
+
});
|
|
156
|
+
var CreatePositionResponseSchema = createTypedTransactionResponse(
|
|
157
|
+
CreatePositionMetadataSchema
|
|
158
|
+
);
|
|
159
|
+
var ClosePositionResponseSchema = createTransactionResponse();
|
|
160
|
+
var ExtendPositionResponseSchema = createTransactionResponse();
|
|
161
|
+
var FlipLockupKindResponseSchema = createTransactionResponse();
|
|
162
|
+
var ResetLockupResponseSchema = createTransactionResponse();
|
|
163
|
+
var SplitPositionResponseSchema = createTypedTransactionResponse(
|
|
164
|
+
SplitPositionMetadataSchema
|
|
165
|
+
);
|
|
166
|
+
var TransferPositionResponseSchema = createTransactionResponse();
|
|
167
|
+
var ExtendDelegationResponseSchema = createTransactionResponse();
|
|
168
|
+
var DelegatePositionsResponseSchema = createPaginatedTransactionResponse();
|
|
169
|
+
var ClaimDelegationRewardsResponseSchema = createPaginatedTransactionResponse();
|
|
170
|
+
var UndelegatePositionResponseSchema = createPaginatedTransactionResponse();
|
|
171
|
+
var VoteResponseSchema = createPaginatedTransactionResponse();
|
|
172
|
+
var RelinquishVoteResponseSchema = createPaginatedTransactionResponse();
|
|
173
|
+
var RelinquishPositionVotesResponseSchema = createTypedPaginatedTransactionResponse(RelinquishAllVotesMetadataSchema);
|
|
174
|
+
var AssignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
175
|
+
var UnassignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
176
|
+
|
|
177
|
+
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 };
|