@helium/blockchain-api 0.3.9 → 0.3.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/index.d.ts +879 -229
- package/dist/index.js +178 -86
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -74,6 +74,48 @@ var RewardSplitInputSchema = z.discriminatedUnion("type", [
|
|
|
74
74
|
tokenAmount: TokenAmountInputSchema
|
|
75
75
|
})
|
|
76
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.optional().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.optional().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
|
+
}
|
|
77
119
|
var GetTokensInputSchema = z.object({
|
|
78
120
|
limit: z.coerce.number().int().min(1).max(100).default(50)
|
|
79
121
|
});
|
|
@@ -353,15 +395,41 @@ var UnassignProxiesInputSchema = z.object({
|
|
|
353
395
|
proxyKey: PublicKeySchema.describe("Public key of the proxy to unassign"),
|
|
354
396
|
positionMints: z.array(PublicKeySchema).min(1).describe("Array of position NFT mint addresses to unassign proxy for")
|
|
355
397
|
});
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
)
|
|
398
|
+
var CreatePositionMetadataSchema = z.object({
|
|
399
|
+
type: z.string(),
|
|
400
|
+
description: z.string(),
|
|
401
|
+
positionMint: z.string().optional()
|
|
402
|
+
});
|
|
403
|
+
var SplitPositionMetadataSchema = z.object({
|
|
404
|
+
type: z.string(),
|
|
405
|
+
description: z.string(),
|
|
406
|
+
newPositionMint: z.string().optional()
|
|
407
|
+
});
|
|
408
|
+
var RelinquishAllVotesMetadataSchema = z.object({
|
|
409
|
+
type: z.string(),
|
|
410
|
+
description: z.string(),
|
|
411
|
+
votesRelinquished: z.number().optional()
|
|
364
412
|
});
|
|
413
|
+
var CreatePositionResponseSchema = createTypedTransactionResponse(
|
|
414
|
+
CreatePositionMetadataSchema
|
|
415
|
+
);
|
|
416
|
+
var ClosePositionResponseSchema = createTransactionResponse();
|
|
417
|
+
var ExtendPositionResponseSchema = createTransactionResponse();
|
|
418
|
+
var FlipLockupKindResponseSchema = createTransactionResponse();
|
|
419
|
+
var ResetLockupResponseSchema = createTransactionResponse();
|
|
420
|
+
var SplitPositionResponseSchema = createTypedTransactionResponse(
|
|
421
|
+
SplitPositionMetadataSchema
|
|
422
|
+
);
|
|
423
|
+
var TransferPositionResponseSchema = createTransactionResponse();
|
|
424
|
+
var ExtendDelegationResponseSchema = createTransactionResponse();
|
|
425
|
+
var DelegatePositionsResponseSchema = createPaginatedTransactionResponse();
|
|
426
|
+
var ClaimDelegationRewardsResponseSchema = createPaginatedTransactionResponse();
|
|
427
|
+
var UndelegatePositionResponseSchema = createPaginatedTransactionResponse();
|
|
428
|
+
var VoteResponseSchema = createPaginatedTransactionResponse();
|
|
429
|
+
var RelinquishVoteResponseSchema = createPaginatedTransactionResponse();
|
|
430
|
+
var RelinquishPositionVotesResponseSchema = createTypedPaginatedTransactionResponse(RelinquishAllVotesMetadataSchema);
|
|
431
|
+
var AssignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
432
|
+
var UnassignProxiesResponseSchema = createPaginatedTransactionResponse();
|
|
365
433
|
var HealthResponseSchema = z.object({
|
|
366
434
|
ok: z.boolean(),
|
|
367
435
|
error: z.string().optional()
|
|
@@ -395,14 +463,8 @@ var TokenBalanceDataSchema = z.object({
|
|
|
395
463
|
solBalanceUsd: z.number(),
|
|
396
464
|
tokens: z.array(TokenAccountSchema)
|
|
397
465
|
});
|
|
398
|
-
var TransferOutputSchema =
|
|
399
|
-
|
|
400
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
401
|
-
});
|
|
402
|
-
var CreateHntAccountOutputSchema = z.object({
|
|
403
|
-
transactionData: TransactionDataSchema,
|
|
404
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
405
|
-
});
|
|
466
|
+
var TransferOutputSchema = createTransactionResponse();
|
|
467
|
+
var CreateHntAccountOutputSchema = createTransactionResponse();
|
|
406
468
|
var HotspotTypeSchema = z.enum(["iot", "mobile", "all"]);
|
|
407
469
|
var GetHotspotsInputSchema = z.object({
|
|
408
470
|
walletAddress: WalletAddressSchema,
|
|
@@ -511,18 +573,14 @@ var HotspotsDataSchema = z.object({
|
|
|
511
573
|
page: z.number(),
|
|
512
574
|
totalPages: z.number()
|
|
513
575
|
});
|
|
514
|
-
var ClaimRewardsOutputSchema =
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
var UpdateRewardsDestinationOutputSchema = z.object({
|
|
523
|
-
transactionData: TransactionDataSchema,
|
|
524
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
525
|
-
});
|
|
576
|
+
var ClaimRewardsOutputSchema = createTransactionResponse();
|
|
577
|
+
var TransferHotspotOutputSchema = createTransactionResponse();
|
|
578
|
+
var UpdateRewardsDestinationOutputSchema = createTransactionResponse();
|
|
579
|
+
var CreateSplitOutputSchema = createTransactionResponse();
|
|
580
|
+
var DeleteSplitOutputSchema = createTransactionResponse();
|
|
581
|
+
var SetupAutomationOutputSchema = createTransactionResponse();
|
|
582
|
+
var FundAutomationOutputSchema = createTransactionResponse();
|
|
583
|
+
var CloseAutomationOutputSchema = createTransactionResponse();
|
|
526
584
|
var SplitShareSchema = z.object({
|
|
527
585
|
wallet: z.string(),
|
|
528
586
|
delegate: z.string(),
|
|
@@ -535,14 +593,6 @@ var SplitResponseSchema = z.object({
|
|
|
535
593
|
splitAddress: z.string(),
|
|
536
594
|
shares: z.array(SplitShareSchema)
|
|
537
595
|
});
|
|
538
|
-
var CreateSplitOutputSchema = z.object({
|
|
539
|
-
transactionData: TransactionDataSchema,
|
|
540
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
541
|
-
});
|
|
542
|
-
var DeleteSplitOutputSchema = z.object({
|
|
543
|
-
transactionData: TransactionDataSchema,
|
|
544
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
545
|
-
});
|
|
546
596
|
var AutomationStatusOutputSchema = z.object({
|
|
547
597
|
hasExistingAutomation: z.boolean(),
|
|
548
598
|
isOutOfSol: z.boolean(),
|
|
@@ -571,18 +621,6 @@ var AutomationStatusOutputSchema = z.object({
|
|
|
571
621
|
pdaWalletBalance: z.string()
|
|
572
622
|
// lamports as string
|
|
573
623
|
});
|
|
574
|
-
var SetupAutomationOutputSchema = z.object({
|
|
575
|
-
transactionData: TransactionDataSchema,
|
|
576
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
577
|
-
});
|
|
578
|
-
var FundAutomationOutputSchema = z.object({
|
|
579
|
-
transactionData: TransactionDataSchema,
|
|
580
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
581
|
-
});
|
|
582
|
-
var CloseAutomationOutputSchema = z.object({
|
|
583
|
-
transactionData: TransactionDataSchema,
|
|
584
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
585
|
-
});
|
|
586
624
|
var FundingEstimateOutputSchema = z.object({
|
|
587
625
|
rentFee: z.number(),
|
|
588
626
|
// Initial setup rent (BASE_AUTOMATION_RENT + TASK_RETURN_ACCOUNT_SIZE) if automation doesn't exist, 0 otherwise
|
|
@@ -646,9 +684,7 @@ var UpdateHotspotInfoInputSchema = z.discriminatedUnion("deviceType", [
|
|
|
646
684
|
IotUpdateSchema,
|
|
647
685
|
MobileUpdateSchema
|
|
648
686
|
]);
|
|
649
|
-
var UpdateHotspotInfoOutputSchema =
|
|
650
|
-
transactionData: TransactionDataSchema,
|
|
651
|
-
estimatedSolFee: TokenAmountOutputSchema,
|
|
687
|
+
var UpdateHotspotInfoOutputSchema = createTransactionResponse().extend({
|
|
652
688
|
appliedTo: z.object({
|
|
653
689
|
iot: z.boolean(),
|
|
654
690
|
mobile: z.boolean()
|
|
@@ -989,23 +1025,58 @@ var WelcomePackSchema = z.object({
|
|
|
989
1025
|
hotspot: HotspotSchema.nullable()
|
|
990
1026
|
});
|
|
991
1027
|
var WelcomePackListOutputSchema = z.array(WelcomePackSchema);
|
|
992
|
-
var WelcomePackCreateOutputSchema =
|
|
993
|
-
welcomePack: WelcomePackSchema
|
|
994
|
-
transactionData: TransactionDataSchema,
|
|
995
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
996
|
-
});
|
|
997
|
-
var WelcomePackDeleteOutputSchema = z.object({
|
|
998
|
-
transactionData: TransactionDataSchema,
|
|
999
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
1000
|
-
});
|
|
1001
|
-
var WelcomePackClaimOutputSchema = z.object({
|
|
1002
|
-
transactionData: TransactionDataSchema,
|
|
1003
|
-
estimatedSolFee: TokenAmountOutputSchema
|
|
1028
|
+
var WelcomePackCreateOutputSchema = createTransactionResponse().extend({
|
|
1029
|
+
welcomePack: WelcomePackSchema
|
|
1004
1030
|
});
|
|
1031
|
+
var WelcomePackDeleteOutputSchema = createTransactionResponse();
|
|
1032
|
+
var WelcomePackClaimOutputSchema = createTransactionResponse();
|
|
1005
1033
|
var WelcomePackInviteOutputSchema = z.object({
|
|
1006
1034
|
message: z.string(),
|
|
1007
1035
|
expirationTs: z.number()
|
|
1008
1036
|
});
|
|
1037
|
+
var MigrateInputSchema = z.object({
|
|
1038
|
+
sourceWallet: WalletAddressSchema,
|
|
1039
|
+
destinationWallet: WalletAddressSchema,
|
|
1040
|
+
hotspots: z.array(z.string()).default([]),
|
|
1041
|
+
tokens: z.array(
|
|
1042
|
+
z.object({
|
|
1043
|
+
mint: z.string(),
|
|
1044
|
+
amount: z.string()
|
|
1045
|
+
})
|
|
1046
|
+
).default([])
|
|
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
|
+
});
|
|
1009
1080
|
var UNAUTHENTICATED = {
|
|
1010
1081
|
status: 401,
|
|
1011
1082
|
message: "Authentication required. Please sign in to continue."
|
|
@@ -1167,97 +1238,97 @@ var governanceContract = oc.tag("Governance").prefix("/governance").router({
|
|
|
1167
1238
|
path: "/positions",
|
|
1168
1239
|
summary: "Create staking position",
|
|
1169
1240
|
description: "Create a new staking position with specified lockup parameters. Optionally delegate to a sub-DAO immediately."
|
|
1170
|
-
}).input(CreatePositionInputSchema).errors({ BAD_REQUEST, INSUFFICIENT_FUNDS }).output(
|
|
1241
|
+
}).input(CreatePositionInputSchema).errors({ BAD_REQUEST, INSUFFICIENT_FUNDS }).output(CreatePositionResponseSchema),
|
|
1171
1242
|
closePosition: oc.route({
|
|
1172
1243
|
method: "POST",
|
|
1173
1244
|
path: "/positions/{positionMint}/close",
|
|
1174
1245
|
summary: "Close staking position",
|
|
1175
1246
|
description: "Close an expired staking position and withdraw all deposited tokens. Position must have no active votes and lockup must be expired."
|
|
1176
|
-
}).input(ClosePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, INSUFFICIENT_FUNDS }).output(
|
|
1247
|
+
}).input(ClosePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, INSUFFICIENT_FUNDS }).output(ClosePositionResponseSchema),
|
|
1177
1248
|
extendPosition: oc.route({
|
|
1178
1249
|
method: "POST",
|
|
1179
1250
|
path: "/positions/{positionMint}/extend",
|
|
1180
1251
|
summary: "Extend position lockup",
|
|
1181
1252
|
description: "Extend the lockup period of an existing staking position."
|
|
1182
|
-
}).input(ExtendPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1253
|
+
}).input(ExtendPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ExtendPositionResponseSchema),
|
|
1183
1254
|
flipLockupKind: oc.route({
|
|
1184
1255
|
method: "POST",
|
|
1185
1256
|
path: "/positions/{positionMint}/flip-lockup",
|
|
1186
1257
|
summary: "Flip lockup kind",
|
|
1187
1258
|
description: "Switch position lockup between cliff and constant. Cliff unlocks at a specific time, constant never decays."
|
|
1188
|
-
}).input(FlipLockupKindInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1259
|
+
}).input(FlipLockupKindInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(FlipLockupKindResponseSchema),
|
|
1189
1260
|
resetLockup: oc.route({
|
|
1190
1261
|
method: "POST",
|
|
1191
1262
|
path: "/positions/{positionMint}/reset-lockup",
|
|
1192
1263
|
summary: "Reset position lockup",
|
|
1193
1264
|
description: "Reset both lockup kind and period for a position. Allows changing cliff/constant and duration in one transaction."
|
|
1194
|
-
}).input(ResetLockupInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1265
|
+
}).input(ResetLockupInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ResetLockupResponseSchema),
|
|
1195
1266
|
splitPosition: oc.route({
|
|
1196
1267
|
method: "POST",
|
|
1197
1268
|
path: "/positions/{positionMint}/split",
|
|
1198
1269
|
summary: "Split position",
|
|
1199
1270
|
description: "Split tokens from an existing position into a new position with its own lockup parameters."
|
|
1200
|
-
}).input(SplitPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1271
|
+
}).input(SplitPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(SplitPositionResponseSchema),
|
|
1201
1272
|
transferPosition: oc.route({
|
|
1202
1273
|
method: "POST",
|
|
1203
1274
|
path: "/positions/{positionMint}/transfer",
|
|
1204
1275
|
summary: "Transfer between positions",
|
|
1205
1276
|
description: "Transfer tokens from one position to another. Both positions must have no active votes."
|
|
1206
|
-
}).input(TransferPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1277
|
+
}).input(TransferPositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(TransferPositionResponseSchema),
|
|
1207
1278
|
delegatePositions: oc.route({
|
|
1208
1279
|
method: "POST",
|
|
1209
1280
|
path: "/positions/delegate/{subDaoMint}",
|
|
1210
1281
|
summary: "Delegate positions",
|
|
1211
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."
|
|
1212
|
-
}).input(DelegatePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1283
|
+
}).input(DelegatePositionInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(DelegatePositionsResponseSchema),
|
|
1213
1284
|
claimDelegationRewards: oc.route({
|
|
1214
1285
|
method: "POST",
|
|
1215
1286
|
path: "/positions/claim-rewards",
|
|
1216
1287
|
summary: "Claim delegation rewards",
|
|
1217
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."
|
|
1218
|
-
}).input(ClaimDelegationRewardsInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1289
|
+
}).input(ClaimDelegationRewardsInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ClaimDelegationRewardsResponseSchema),
|
|
1219
1290
|
undelegatePosition: oc.route({
|
|
1220
1291
|
method: "POST",
|
|
1221
1292
|
path: "/positions/{positionMint}/undelegate",
|
|
1222
1293
|
summary: "Undelegate position",
|
|
1223
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."
|
|
1224
|
-
}).input(UndelegateInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1295
|
+
}).input(UndelegateInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(UndelegatePositionResponseSchema),
|
|
1225
1296
|
extendDelegation: oc.route({
|
|
1226
1297
|
method: "POST",
|
|
1227
1298
|
path: "/positions/{positionMint}/delegation/extend",
|
|
1228
1299
|
summary: "Extend delegation",
|
|
1229
1300
|
description: "Extend the expiration of a delegated position to the current season end."
|
|
1230
|
-
}).input(ExtendDelegationInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
1301
|
+
}).input(ExtendDelegationInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(ExtendDelegationResponseSchema),
|
|
1231
1302
|
vote: oc.route({
|
|
1232
1303
|
method: "POST",
|
|
1233
1304
|
path: "/proposals/{proposalKey}/vote",
|
|
1234
1305
|
summary: "Vote on proposal",
|
|
1235
|
-
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."
|
|
1236
|
-
}).input(VoteInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
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),
|
|
1237
1308
|
relinquishVote: oc.route({
|
|
1238
1309
|
method: "POST",
|
|
1239
1310
|
path: "/proposals/{proposalKey}/relinquish-votes",
|
|
1240
1311
|
summary: "Relinquish vote",
|
|
1241
|
-
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."
|
|
1242
|
-
}).input(RelinquishVoteInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
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),
|
|
1243
1314
|
relinquishPositionVotes: oc.route({
|
|
1244
1315
|
method: "POST",
|
|
1245
1316
|
path: "/positions/{positionMint}/relinquish-vote",
|
|
1246
1317
|
summary: "Relinquish all position votes",
|
|
1247
|
-
description: "Remove ALL active votes from a single position across all proposals in an organization."
|
|
1248
|
-
}).input(RelinquishPositionVotesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
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),
|
|
1249
1320
|
assignProxies: oc.route({
|
|
1250
1321
|
method: "POST",
|
|
1251
1322
|
path: "/proxy/{proxyKey}/assign",
|
|
1252
1323
|
summary: "Assign voting proxy",
|
|
1253
|
-
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."
|
|
1254
|
-
}).input(AssignProxiesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
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),
|
|
1255
1326
|
unassignProxies: oc.route({
|
|
1256
1327
|
method: "POST",
|
|
1257
1328
|
path: "/proxy/{proxyKey}/unassign",
|
|
1258
1329
|
summary: "Unassign voting proxy",
|
|
1259
|
-
description: "Remove voting proxy delegation from one or more positions, returning voting power to the owner."
|
|
1260
|
-
}).input(UnassignProxiesInputSchema).errors({ BAD_REQUEST, NOT_FOUND, INSUFFICIENT_FUNDS }).output(
|
|
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)
|
|
1261
1332
|
});
|
|
1262
1333
|
var rewardContract = oc.tag("Reward Contract").prefix("/hotspots").router({
|
|
1263
1334
|
find: oc.route({
|
|
@@ -1486,6 +1557,26 @@ var webhooksContract = oc.tag("Webhooks").router({
|
|
|
1486
1557
|
INVALID_PAYLOAD: { message: "Invalid webhook payload", status: 400 }
|
|
1487
1558
|
})
|
|
1488
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
|
+
});
|
|
1489
1580
|
var apiContract = oc.router({
|
|
1490
1581
|
governance: governanceContract,
|
|
1491
1582
|
health: healthContract,
|
|
@@ -1499,7 +1590,8 @@ var apiContract = oc.router({
|
|
|
1499
1590
|
var fullApiContract = oc.router({
|
|
1500
1591
|
...apiContract,
|
|
1501
1592
|
fiat: fiatContract,
|
|
1502
|
-
webhooks: webhooksContract
|
|
1593
|
+
webhooks: webhooksContract,
|
|
1594
|
+
migration: migrationContract
|
|
1503
1595
|
});
|
|
1504
1596
|
|
|
1505
|
-
export { AssignProxiesInputSchema, AutomationScheduleSchema, AutomationStatusOutputSchema, BAD_REQUEST, BankAccountListOutputSchema, BankAccountSchema, BatchStatusOutputSchema, BridgeTransferSchema, CONFLICT, ClaimDelegationRewardsInputSchema, ClaimInviteRequestSchema, ClaimInviteResponseSchema, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CloseAutomationInputSchema, CloseAutomationOutputSchema, ClosePositionInputSchema, CreateBankAccountInputSchema, CreateHntAccountInputSchema, CreateHntAccountOutputSchema, CreateInviteResponseSchema, CreatePositionInputSchema, CreateRewardContractTransactionInputSchema, CreateRewardContractTransactionResponseSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DelegatePositionInputSchema, DeleteBankAccountInputSchema, DeleteBankAccountOutputSchema, DeleteRewardContractTransactionResponseSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, ErrorResponseSchema, EstimateCostToCreateRewardContractResponseSchema, EstimateInputSchema, EstimateOutputSchema, ExtendDelegationInputSchema, ExtendPositionInputSchema, FeesOutputSchema, FindRewardContractResponseSchema, FlipLockupKindInputSchema, FundAutomationInputSchema, FundAutomationOutputSchema, FundingEstimateOutputSchema, GetAutomationStatusInputSchema, GetBalancesInputSchema, GetBankAccountInputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetFundingEstimateInputSchema, GetHotspotsInputSchema, GetInputSchema, GetInstructionsInputSchema, GetPendingRewardsInputSchema, GetPendingRewardsOutputSchema, GetQuoteInputSchema, GetSendQuoteInputSchema, GetSplitInputSchema, GetTokensInputSchema, GetTransferInputSchema,
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helium/blockchain-api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "TypeScript client and schemas for the Helium Blockchain API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
"tsup": "^8.0.0",
|
|
35
35
|
"typescript": "^5.0.0"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|