@orbitflare/sdk 0.2.0 → 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 +120 -0
- package/dist/config.d.ts +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -9
- package/dist/config.js.map +1 -1
- package/dist/filters.d.ts +38 -0
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +42 -0
- package/dist/filters.js.map +1 -0
- package/dist/grpc.d.ts +91 -2
- package/dist/grpc.d.ts.map +1 -1
- package/dist/grpc.js +302 -4
- package/dist/grpc.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jetstream/filters.d.ts +16 -0
- package/dist/jetstream/filters.d.ts.map +1 -0
- package/dist/jetstream/filters.js +42 -0
- package/dist/jetstream/filters.js.map +1 -0
- package/dist/{jetstream.d.ts → jetstream/index.d.ts} +12 -6
- package/dist/jetstream/index.d.ts.map +1 -0
- package/dist/{jetstream.js → jetstream/index.js} +40 -10
- package/dist/jetstream/index.js.map +1 -0
- package/dist/jetstream/v2.d.ts +108 -0
- package/dist/jetstream/v2.d.ts.map +1 -0
- package/dist/jetstream/v2.js +575 -0
- package/dist/jetstream/v2.js.map +1 -0
- package/dist/logger.d.ts +23 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +88 -0
- package/dist/logger.js.map +1 -0
- package/dist/proto/geyser.d.ts +41 -41
- package/dist/proto/geyser.d.ts.map +1 -1
- package/dist/proto/geyser.js +397 -287
- package/dist/proto/geyser.js.map +1 -1
- package/dist/proto/google/protobuf/timestamp.d.ts +2 -2
- package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
- package/dist/proto/google/protobuf/timestamp.js +10 -17
- package/dist/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/proto/jetstream.d.ts +33 -30
- package/dist/proto/jetstream.d.ts.map +1 -1
- package/dist/proto/jetstream.js +234 -175
- package/dist/proto/jetstream.js.map +1 -1
- package/dist/proto/jetstream_v2.d.ts +309 -0
- package/dist/proto/jetstream_v2.d.ts.map +1 -0
- package/dist/proto/jetstream_v2.js +2203 -0
- package/dist/proto/jetstream_v2.js.map +1 -0
- package/dist/proto/solana-storage.d.ts +22 -12
- package/dist/proto/solana-storage.d.ts.map +1 -1
- package/dist/proto/solana-storage.js +273 -87
- package/dist/proto/solana-storage.js.map +1 -1
- package/dist/proto.d.ts +1 -0
- package/dist/proto.d.ts.map +1 -1
- package/dist/proto.js +1 -0
- package/dist/proto.js.map +1 -1
- package/dist/rpc.d.ts +7 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +20 -4
- package/dist/rpc.js.map +1 -1
- package/dist/ws.d.ts +7 -0
- package/dist/ws.d.ts.map +1 -1
- package/dist/ws.js +29 -4
- package/dist/ws.js.map +1 -1
- package/package.json +18 -6
- package/dist/jetstream.d.ts.map +0 -1
- package/dist/jetstream.js.map +0 -1
|
@@ -13,6 +13,7 @@ export var RewardType;
|
|
|
13
13
|
RewardType[RewardType["Rent"] = 2] = "Rent";
|
|
14
14
|
RewardType[RewardType["Staking"] = 3] = "Staking";
|
|
15
15
|
RewardType[RewardType["Voting"] = 4] = "Voting";
|
|
16
|
+
RewardType[RewardType["DeactivatedStake"] = 5] = "DeactivatedStake";
|
|
16
17
|
RewardType[RewardType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
17
18
|
})(RewardType || (RewardType = {}));
|
|
18
19
|
export function rewardTypeFromJSON(object) {
|
|
@@ -32,6 +33,9 @@ export function rewardTypeFromJSON(object) {
|
|
|
32
33
|
case 4:
|
|
33
34
|
case "Voting":
|
|
34
35
|
return RewardType.Voting;
|
|
36
|
+
case 5:
|
|
37
|
+
case "DeactivatedStake":
|
|
38
|
+
return RewardType.DeactivatedStake;
|
|
35
39
|
case -1:
|
|
36
40
|
case "UNRECOGNIZED":
|
|
37
41
|
default:
|
|
@@ -50,6 +54,8 @@ export function rewardTypeToJSON(object) {
|
|
|
50
54
|
return "Staking";
|
|
51
55
|
case RewardType.Voting:
|
|
52
56
|
return "Voting";
|
|
57
|
+
case RewardType.DeactivatedStake:
|
|
58
|
+
return "DeactivatedStake";
|
|
53
59
|
case RewardType.UNRECOGNIZED:
|
|
54
60
|
default:
|
|
55
61
|
return "UNRECOGNIZED";
|
|
@@ -59,7 +65,7 @@ function createBaseConfirmedBlock() {
|
|
|
59
65
|
return {
|
|
60
66
|
previousBlockhash: "",
|
|
61
67
|
blockhash: "",
|
|
62
|
-
parentSlot:
|
|
68
|
+
parentSlot: 0n,
|
|
63
69
|
transactions: [],
|
|
64
70
|
rewards: [],
|
|
65
71
|
blockTime: undefined,
|
|
@@ -75,7 +81,10 @@ export const ConfirmedBlock = {
|
|
|
75
81
|
if (message.blockhash !== "") {
|
|
76
82
|
writer.uint32(18).string(message.blockhash);
|
|
77
83
|
}
|
|
78
|
-
if (message.parentSlot !==
|
|
84
|
+
if (message.parentSlot !== 0n) {
|
|
85
|
+
if (BigInt.asUintN(64, message.parentSlot) !== message.parentSlot) {
|
|
86
|
+
throw new globalThis.Error("value provided for field message.parentSlot of type uint64 too large");
|
|
87
|
+
}
|
|
79
88
|
writer.uint32(24).uint64(message.parentSlot);
|
|
80
89
|
}
|
|
81
90
|
for (const v of message.transactions) {
|
|
@@ -120,7 +129,7 @@ export const ConfirmedBlock = {
|
|
|
120
129
|
if (tag !== 24) {
|
|
121
130
|
break;
|
|
122
131
|
}
|
|
123
|
-
message.parentSlot =
|
|
132
|
+
message.parentSlot = reader.uint64();
|
|
124
133
|
continue;
|
|
125
134
|
}
|
|
126
135
|
case 4: {
|
|
@@ -175,10 +184,10 @@ export const ConfirmedBlock = {
|
|
|
175
184
|
: "",
|
|
176
185
|
blockhash: isSet(object.blockhash) ? globalThis.String(object.blockhash) : "",
|
|
177
186
|
parentSlot: isSet(object.parentSlot)
|
|
178
|
-
?
|
|
187
|
+
? BigInt(object.parentSlot)
|
|
179
188
|
: isSet(object.parent_slot)
|
|
180
|
-
?
|
|
181
|
-
:
|
|
189
|
+
? BigInt(object.parent_slot)
|
|
190
|
+
: 0n,
|
|
182
191
|
transactions: globalThis.Array.isArray(object?.transactions)
|
|
183
192
|
? object.transactions.map((e) => ConfirmedTransaction.fromJSON(e))
|
|
184
193
|
: [],
|
|
@@ -208,8 +217,8 @@ export const ConfirmedBlock = {
|
|
|
208
217
|
if (message.blockhash !== "") {
|
|
209
218
|
obj.blockhash = message.blockhash;
|
|
210
219
|
}
|
|
211
|
-
if (message.parentSlot !==
|
|
212
|
-
obj.parentSlot =
|
|
220
|
+
if (message.parentSlot !== 0n) {
|
|
221
|
+
obj.parentSlot = message.parentSlot.toString();
|
|
213
222
|
}
|
|
214
223
|
if (message.transactions?.length) {
|
|
215
224
|
obj.transactions = message.transactions.map((e) => ConfirmedTransaction.toJSON(e));
|
|
@@ -235,7 +244,7 @@ export const ConfirmedBlock = {
|
|
|
235
244
|
const message = createBaseConfirmedBlock();
|
|
236
245
|
message.previousBlockhash = object.previousBlockhash ?? "";
|
|
237
246
|
message.blockhash = object.blockhash ?? "";
|
|
238
|
-
message.parentSlot = object.parentSlot ??
|
|
247
|
+
message.parentSlot = object.parentSlot ?? 0n;
|
|
239
248
|
message.transactions = object.transactions?.map((e) => ConfirmedTransaction.fromPartial(e)) || [];
|
|
240
249
|
message.rewards = object.rewards?.map((e) => Reward.fromPartial(e)) || [];
|
|
241
250
|
message.blockTime = (object.blockTime !== undefined && object.blockTime !== null)
|
|
@@ -402,6 +411,7 @@ function createBaseMessage() {
|
|
|
402
411
|
instructions: [],
|
|
403
412
|
versioned: false,
|
|
404
413
|
addressTableLookups: [],
|
|
414
|
+
config: undefined,
|
|
405
415
|
};
|
|
406
416
|
}
|
|
407
417
|
export const Message = {
|
|
@@ -424,6 +434,9 @@ export const Message = {
|
|
|
424
434
|
for (const v of message.addressTableLookups) {
|
|
425
435
|
MessageAddressTableLookup.encode(v, writer.uint32(50).fork()).join();
|
|
426
436
|
}
|
|
437
|
+
if (message.config !== undefined) {
|
|
438
|
+
TransactionConfig.encode(message.config, writer.uint32(58).fork()).join();
|
|
439
|
+
}
|
|
427
440
|
return writer;
|
|
428
441
|
},
|
|
429
442
|
decode(input, length) {
|
|
@@ -475,6 +488,13 @@ export const Message = {
|
|
|
475
488
|
message.addressTableLookups.push(MessageAddressTableLookup.decode(reader, reader.uint32()));
|
|
476
489
|
continue;
|
|
477
490
|
}
|
|
491
|
+
case 7: {
|
|
492
|
+
if (tag !== 58) {
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
message.config = TransactionConfig.decode(reader, reader.uint32());
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
478
498
|
}
|
|
479
499
|
if ((tag & 7) === 4 || tag === 0) {
|
|
480
500
|
break;
|
|
@@ -505,6 +525,7 @@ export const Message = {
|
|
|
505
525
|
: globalThis.Array.isArray(object?.address_table_lookups)
|
|
506
526
|
? object.address_table_lookups.map((e) => MessageAddressTableLookup.fromJSON(e))
|
|
507
527
|
: [],
|
|
528
|
+
config: isSet(object.config) ? TransactionConfig.fromJSON(object.config) : undefined,
|
|
508
529
|
};
|
|
509
530
|
},
|
|
510
531
|
toJSON(message) {
|
|
@@ -527,6 +548,9 @@ export const Message = {
|
|
|
527
548
|
if (message.addressTableLookups?.length) {
|
|
528
549
|
obj.addressTableLookups = message.addressTableLookups.map((e) => MessageAddressTableLookup.toJSON(e));
|
|
529
550
|
}
|
|
551
|
+
if (message.config !== undefined) {
|
|
552
|
+
obj.config = TransactionConfig.toJSON(message.config);
|
|
553
|
+
}
|
|
530
554
|
return obj;
|
|
531
555
|
},
|
|
532
556
|
create(base) {
|
|
@@ -543,6 +567,131 @@ export const Message = {
|
|
|
543
567
|
message.versioned = object.versioned ?? false;
|
|
544
568
|
message.addressTableLookups = object.addressTableLookups?.map((e) => MessageAddressTableLookup.fromPartial(e)) ||
|
|
545
569
|
[];
|
|
570
|
+
message.config = (object.config !== undefined && object.config !== null)
|
|
571
|
+
? TransactionConfig.fromPartial(object.config)
|
|
572
|
+
: undefined;
|
|
573
|
+
return message;
|
|
574
|
+
},
|
|
575
|
+
};
|
|
576
|
+
function createBaseTransactionConfig() {
|
|
577
|
+
return {
|
|
578
|
+
priorityFee: undefined,
|
|
579
|
+
computeUnitLimit: undefined,
|
|
580
|
+
loadedAccountsDataSizeLimit: undefined,
|
|
581
|
+
heapSize: undefined,
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
export const TransactionConfig = {
|
|
585
|
+
encode(message, writer = new BinaryWriter()) {
|
|
586
|
+
if (message.priorityFee !== undefined) {
|
|
587
|
+
if (BigInt.asUintN(64, message.priorityFee) !== message.priorityFee) {
|
|
588
|
+
throw new globalThis.Error("value provided for field message.priorityFee of type uint64 too large");
|
|
589
|
+
}
|
|
590
|
+
writer.uint32(8).uint64(message.priorityFee);
|
|
591
|
+
}
|
|
592
|
+
if (message.computeUnitLimit !== undefined) {
|
|
593
|
+
writer.uint32(16).uint32(message.computeUnitLimit);
|
|
594
|
+
}
|
|
595
|
+
if (message.loadedAccountsDataSizeLimit !== undefined) {
|
|
596
|
+
writer.uint32(24).uint32(message.loadedAccountsDataSizeLimit);
|
|
597
|
+
}
|
|
598
|
+
if (message.heapSize !== undefined) {
|
|
599
|
+
writer.uint32(32).uint32(message.heapSize);
|
|
600
|
+
}
|
|
601
|
+
return writer;
|
|
602
|
+
},
|
|
603
|
+
decode(input, length) {
|
|
604
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
605
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
606
|
+
const message = createBaseTransactionConfig();
|
|
607
|
+
while (reader.pos < end) {
|
|
608
|
+
const tag = reader.uint32();
|
|
609
|
+
switch (tag >>> 3) {
|
|
610
|
+
case 1: {
|
|
611
|
+
if (tag !== 8) {
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
message.priorityFee = reader.uint64();
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
case 2: {
|
|
618
|
+
if (tag !== 16) {
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
message.computeUnitLimit = reader.uint32();
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
case 3: {
|
|
625
|
+
if (tag !== 24) {
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
message.loadedAccountsDataSizeLimit = reader.uint32();
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
case 4: {
|
|
632
|
+
if (tag !== 32) {
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
message.heapSize = reader.uint32();
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
reader.skip(tag & 7);
|
|
643
|
+
}
|
|
644
|
+
return message;
|
|
645
|
+
},
|
|
646
|
+
fromJSON(object) {
|
|
647
|
+
return {
|
|
648
|
+
priorityFee: isSet(object.priorityFee)
|
|
649
|
+
? BigInt(object.priorityFee)
|
|
650
|
+
: isSet(object.priority_fee)
|
|
651
|
+
? BigInt(object.priority_fee)
|
|
652
|
+
: undefined,
|
|
653
|
+
computeUnitLimit: isSet(object.computeUnitLimit)
|
|
654
|
+
? globalThis.Number(object.computeUnitLimit)
|
|
655
|
+
: isSet(object.compute_unit_limit)
|
|
656
|
+
? globalThis.Number(object.compute_unit_limit)
|
|
657
|
+
: undefined,
|
|
658
|
+
loadedAccountsDataSizeLimit: isSet(object.loadedAccountsDataSizeLimit)
|
|
659
|
+
? globalThis.Number(object.loadedAccountsDataSizeLimit)
|
|
660
|
+
: isSet(object.loaded_accounts_data_size_limit)
|
|
661
|
+
? globalThis.Number(object.loaded_accounts_data_size_limit)
|
|
662
|
+
: undefined,
|
|
663
|
+
heapSize: isSet(object.heapSize)
|
|
664
|
+
? globalThis.Number(object.heapSize)
|
|
665
|
+
: isSet(object.heap_size)
|
|
666
|
+
? globalThis.Number(object.heap_size)
|
|
667
|
+
: undefined,
|
|
668
|
+
};
|
|
669
|
+
},
|
|
670
|
+
toJSON(message) {
|
|
671
|
+
const obj = {};
|
|
672
|
+
if (message.priorityFee !== undefined) {
|
|
673
|
+
obj.priorityFee = message.priorityFee.toString();
|
|
674
|
+
}
|
|
675
|
+
if (message.computeUnitLimit !== undefined) {
|
|
676
|
+
obj.computeUnitLimit = Math.round(message.computeUnitLimit);
|
|
677
|
+
}
|
|
678
|
+
if (message.loadedAccountsDataSizeLimit !== undefined) {
|
|
679
|
+
obj.loadedAccountsDataSizeLimit = Math.round(message.loadedAccountsDataSizeLimit);
|
|
680
|
+
}
|
|
681
|
+
if (message.heapSize !== undefined) {
|
|
682
|
+
obj.heapSize = Math.round(message.heapSize);
|
|
683
|
+
}
|
|
684
|
+
return obj;
|
|
685
|
+
},
|
|
686
|
+
create(base) {
|
|
687
|
+
return TransactionConfig.fromPartial(base ?? {});
|
|
688
|
+
},
|
|
689
|
+
fromPartial(object) {
|
|
690
|
+
const message = createBaseTransactionConfig();
|
|
691
|
+
message.priorityFee = object.priorityFee ?? undefined;
|
|
692
|
+
message.computeUnitLimit = object.computeUnitLimit ?? undefined;
|
|
693
|
+
message.loadedAccountsDataSizeLimit = object.loadedAccountsDataSizeLimit ?? undefined;
|
|
694
|
+
message.heapSize = object.heapSize ?? undefined;
|
|
546
695
|
return message;
|
|
547
696
|
},
|
|
548
697
|
};
|
|
@@ -739,7 +888,7 @@ export const MessageAddressTableLookup = {
|
|
|
739
888
|
function createBaseTransactionStatusMeta() {
|
|
740
889
|
return {
|
|
741
890
|
err: undefined,
|
|
742
|
-
fee:
|
|
891
|
+
fee: 0n,
|
|
743
892
|
preBalances: [],
|
|
744
893
|
postBalances: [],
|
|
745
894
|
innerInstructions: [],
|
|
@@ -762,16 +911,25 @@ export const TransactionStatusMeta = {
|
|
|
762
911
|
if (message.err !== undefined) {
|
|
763
912
|
TransactionError.encode(message.err, writer.uint32(10).fork()).join();
|
|
764
913
|
}
|
|
765
|
-
if (message.fee !==
|
|
914
|
+
if (message.fee !== 0n) {
|
|
915
|
+
if (BigInt.asUintN(64, message.fee) !== message.fee) {
|
|
916
|
+
throw new globalThis.Error("value provided for field message.fee of type uint64 too large");
|
|
917
|
+
}
|
|
766
918
|
writer.uint32(16).uint64(message.fee);
|
|
767
919
|
}
|
|
768
920
|
writer.uint32(26).fork();
|
|
769
921
|
for (const v of message.preBalances) {
|
|
922
|
+
if (BigInt.asUintN(64, v) !== v) {
|
|
923
|
+
throw new globalThis.Error("a value provided in array field preBalances of type uint64 is too large");
|
|
924
|
+
}
|
|
770
925
|
writer.uint64(v);
|
|
771
926
|
}
|
|
772
927
|
writer.join();
|
|
773
928
|
writer.uint32(34).fork();
|
|
774
929
|
for (const v of message.postBalances) {
|
|
930
|
+
if (BigInt.asUintN(64, v) !== v) {
|
|
931
|
+
throw new globalThis.Error("a value provided in array field postBalances of type uint64 is too large");
|
|
932
|
+
}
|
|
775
933
|
writer.uint64(v);
|
|
776
934
|
}
|
|
777
935
|
writer.join();
|
|
@@ -809,9 +967,15 @@ export const TransactionStatusMeta = {
|
|
|
809
967
|
writer.uint32(120).bool(message.returnDataNone);
|
|
810
968
|
}
|
|
811
969
|
if (message.computeUnitsConsumed !== undefined) {
|
|
970
|
+
if (BigInt.asUintN(64, message.computeUnitsConsumed) !== message.computeUnitsConsumed) {
|
|
971
|
+
throw new globalThis.Error("value provided for field message.computeUnitsConsumed of type uint64 too large");
|
|
972
|
+
}
|
|
812
973
|
writer.uint32(128).uint64(message.computeUnitsConsumed);
|
|
813
974
|
}
|
|
814
975
|
if (message.costUnits !== undefined) {
|
|
976
|
+
if (BigInt.asUintN(64, message.costUnits) !== message.costUnits) {
|
|
977
|
+
throw new globalThis.Error("value provided for field message.costUnits of type uint64 too large");
|
|
978
|
+
}
|
|
815
979
|
writer.uint32(136).uint64(message.costUnits);
|
|
816
980
|
}
|
|
817
981
|
return writer;
|
|
@@ -834,18 +998,18 @@ export const TransactionStatusMeta = {
|
|
|
834
998
|
if (tag !== 16) {
|
|
835
999
|
break;
|
|
836
1000
|
}
|
|
837
|
-
message.fee =
|
|
1001
|
+
message.fee = reader.uint64();
|
|
838
1002
|
continue;
|
|
839
1003
|
}
|
|
840
1004
|
case 3: {
|
|
841
1005
|
if (tag === 24) {
|
|
842
|
-
message.preBalances.push(
|
|
1006
|
+
message.preBalances.push(reader.uint64());
|
|
843
1007
|
continue;
|
|
844
1008
|
}
|
|
845
1009
|
if (tag === 26) {
|
|
846
1010
|
const end2 = reader.uint32() + reader.pos;
|
|
847
1011
|
while (reader.pos < end2) {
|
|
848
|
-
message.preBalances.push(
|
|
1012
|
+
message.preBalances.push(reader.uint64());
|
|
849
1013
|
}
|
|
850
1014
|
continue;
|
|
851
1015
|
}
|
|
@@ -853,13 +1017,13 @@ export const TransactionStatusMeta = {
|
|
|
853
1017
|
}
|
|
854
1018
|
case 4: {
|
|
855
1019
|
if (tag === 32) {
|
|
856
|
-
message.postBalances.push(
|
|
1020
|
+
message.postBalances.push(reader.uint64());
|
|
857
1021
|
continue;
|
|
858
1022
|
}
|
|
859
1023
|
if (tag === 34) {
|
|
860
1024
|
const end2 = reader.uint32() + reader.pos;
|
|
861
1025
|
while (reader.pos < end2) {
|
|
862
|
-
message.postBalances.push(
|
|
1026
|
+
message.postBalances.push(reader.uint64());
|
|
863
1027
|
}
|
|
864
1028
|
continue;
|
|
865
1029
|
}
|
|
@@ -946,14 +1110,14 @@ export const TransactionStatusMeta = {
|
|
|
946
1110
|
if (tag !== 128) {
|
|
947
1111
|
break;
|
|
948
1112
|
}
|
|
949
|
-
message.computeUnitsConsumed =
|
|
1113
|
+
message.computeUnitsConsumed = reader.uint64();
|
|
950
1114
|
continue;
|
|
951
1115
|
}
|
|
952
1116
|
case 17: {
|
|
953
1117
|
if (tag !== 136) {
|
|
954
1118
|
break;
|
|
955
1119
|
}
|
|
956
|
-
message.costUnits =
|
|
1120
|
+
message.costUnits = reader.uint64();
|
|
957
1121
|
continue;
|
|
958
1122
|
}
|
|
959
1123
|
}
|
|
@@ -967,16 +1131,16 @@ export const TransactionStatusMeta = {
|
|
|
967
1131
|
fromJSON(object) {
|
|
968
1132
|
return {
|
|
969
1133
|
err: isSet(object.err) ? TransactionError.fromJSON(object.err) : undefined,
|
|
970
|
-
fee: isSet(object.fee) ?
|
|
1134
|
+
fee: isSet(object.fee) ? BigInt(object.fee) : 0n,
|
|
971
1135
|
preBalances: globalThis.Array.isArray(object?.preBalances)
|
|
972
|
-
? object.preBalances.map((e) =>
|
|
1136
|
+
? object.preBalances.map((e) => BigInt(e))
|
|
973
1137
|
: globalThis.Array.isArray(object?.pre_balances)
|
|
974
|
-
? object.pre_balances.map((e) =>
|
|
1138
|
+
? object.pre_balances.map((e) => BigInt(e))
|
|
975
1139
|
: [],
|
|
976
1140
|
postBalances: globalThis.Array.isArray(object?.postBalances)
|
|
977
|
-
? object.postBalances.map((e) =>
|
|
1141
|
+
? object.postBalances.map((e) => BigInt(e))
|
|
978
1142
|
: globalThis.Array.isArray(object?.post_balances)
|
|
979
|
-
? object.post_balances.map((e) =>
|
|
1143
|
+
? object.post_balances.map((e) => BigInt(e))
|
|
980
1144
|
: [],
|
|
981
1145
|
innerInstructions: globalThis.Array.isArray(object?.innerInstructions)
|
|
982
1146
|
? object.innerInstructions.map((e) => InnerInstructions.fromJSON(e))
|
|
@@ -1008,9 +1172,7 @@ export const TransactionStatusMeta = {
|
|
|
1008
1172
|
: globalThis.Array.isArray(object?.post_token_balances)
|
|
1009
1173
|
? object.post_token_balances.map((e) => TokenBalance.fromJSON(e))
|
|
1010
1174
|
: [],
|
|
1011
|
-
rewards: globalThis.Array.isArray(object?.rewards)
|
|
1012
|
-
? object.rewards.map((e) => Reward.fromJSON(e))
|
|
1013
|
-
: [],
|
|
1175
|
+
rewards: globalThis.Array.isArray(object?.rewards) ? object.rewards.map((e) => Reward.fromJSON(e)) : [],
|
|
1014
1176
|
loadedWritableAddresses: globalThis.Array.isArray(object?.loadedWritableAddresses)
|
|
1015
1177
|
? object.loadedWritableAddresses.map((e) => bytesFromBase64(e))
|
|
1016
1178
|
: globalThis.Array.isArray(object?.loaded_writable_addresses)
|
|
@@ -1032,14 +1194,14 @@ export const TransactionStatusMeta = {
|
|
|
1032
1194
|
? globalThis.Boolean(object.return_data_none)
|
|
1033
1195
|
: false,
|
|
1034
1196
|
computeUnitsConsumed: isSet(object.computeUnitsConsumed)
|
|
1035
|
-
?
|
|
1197
|
+
? BigInt(object.computeUnitsConsumed)
|
|
1036
1198
|
: isSet(object.compute_units_consumed)
|
|
1037
|
-
?
|
|
1199
|
+
? BigInt(object.compute_units_consumed)
|
|
1038
1200
|
: undefined,
|
|
1039
1201
|
costUnits: isSet(object.costUnits)
|
|
1040
|
-
?
|
|
1202
|
+
? BigInt(object.costUnits)
|
|
1041
1203
|
: isSet(object.cost_units)
|
|
1042
|
-
?
|
|
1204
|
+
? BigInt(object.cost_units)
|
|
1043
1205
|
: undefined,
|
|
1044
1206
|
};
|
|
1045
1207
|
},
|
|
@@ -1048,14 +1210,14 @@ export const TransactionStatusMeta = {
|
|
|
1048
1210
|
if (message.err !== undefined) {
|
|
1049
1211
|
obj.err = TransactionError.toJSON(message.err);
|
|
1050
1212
|
}
|
|
1051
|
-
if (message.fee !==
|
|
1052
|
-
obj.fee =
|
|
1213
|
+
if (message.fee !== 0n) {
|
|
1214
|
+
obj.fee = message.fee.toString();
|
|
1053
1215
|
}
|
|
1054
1216
|
if (message.preBalances?.length) {
|
|
1055
|
-
obj.preBalances = message.preBalances.map((e) =>
|
|
1217
|
+
obj.preBalances = message.preBalances.map((e) => e.toString());
|
|
1056
1218
|
}
|
|
1057
1219
|
if (message.postBalances?.length) {
|
|
1058
|
-
obj.postBalances = message.postBalances.map((e) =>
|
|
1220
|
+
obj.postBalances = message.postBalances.map((e) => e.toString());
|
|
1059
1221
|
}
|
|
1060
1222
|
if (message.innerInstructions?.length) {
|
|
1061
1223
|
obj.innerInstructions = message.innerInstructions.map((e) => InnerInstructions.toJSON(e));
|
|
@@ -1091,10 +1253,10 @@ export const TransactionStatusMeta = {
|
|
|
1091
1253
|
obj.returnDataNone = message.returnDataNone;
|
|
1092
1254
|
}
|
|
1093
1255
|
if (message.computeUnitsConsumed !== undefined) {
|
|
1094
|
-
obj.computeUnitsConsumed =
|
|
1256
|
+
obj.computeUnitsConsumed = message.computeUnitsConsumed.toString();
|
|
1095
1257
|
}
|
|
1096
1258
|
if (message.costUnits !== undefined) {
|
|
1097
|
-
obj.costUnits =
|
|
1259
|
+
obj.costUnits = message.costUnits.toString();
|
|
1098
1260
|
}
|
|
1099
1261
|
return obj;
|
|
1100
1262
|
},
|
|
@@ -1106,7 +1268,7 @@ export const TransactionStatusMeta = {
|
|
|
1106
1268
|
message.err = (object.err !== undefined && object.err !== null)
|
|
1107
1269
|
? TransactionError.fromPartial(object.err)
|
|
1108
1270
|
: undefined;
|
|
1109
|
-
message.fee = object.fee ??
|
|
1271
|
+
message.fee = object.fee ?? 0n;
|
|
1110
1272
|
message.preBalances = object.preBalances?.map((e) => e) || [];
|
|
1111
1273
|
message.postBalances = object.postBalances?.map((e) => e) || [];
|
|
1112
1274
|
message.innerInstructions = object.innerInstructions?.map((e) => InnerInstructions.fromPartial(e)) || [];
|
|
@@ -1747,17 +1909,23 @@ export const ReturnData = {
|
|
|
1747
1909
|
},
|
|
1748
1910
|
};
|
|
1749
1911
|
function createBaseReward() {
|
|
1750
|
-
return { pubkey: "", lamports:
|
|
1912
|
+
return { pubkey: "", lamports: 0n, postBalance: 0n, rewardType: 0, commission: "", commissionBps: "" };
|
|
1751
1913
|
}
|
|
1752
1914
|
export const Reward = {
|
|
1753
1915
|
encode(message, writer = new BinaryWriter()) {
|
|
1754
1916
|
if (message.pubkey !== "") {
|
|
1755
1917
|
writer.uint32(10).string(message.pubkey);
|
|
1756
1918
|
}
|
|
1757
|
-
if (message.lamports !==
|
|
1919
|
+
if (message.lamports !== 0n) {
|
|
1920
|
+
if (BigInt.asIntN(64, message.lamports) !== message.lamports) {
|
|
1921
|
+
throw new globalThis.Error("value provided for field message.lamports of type int64 too large");
|
|
1922
|
+
}
|
|
1758
1923
|
writer.uint32(16).int64(message.lamports);
|
|
1759
1924
|
}
|
|
1760
|
-
if (message.postBalance !==
|
|
1925
|
+
if (message.postBalance !== 0n) {
|
|
1926
|
+
if (BigInt.asUintN(64, message.postBalance) !== message.postBalance) {
|
|
1927
|
+
throw new globalThis.Error("value provided for field message.postBalance of type uint64 too large");
|
|
1928
|
+
}
|
|
1761
1929
|
writer.uint32(24).uint64(message.postBalance);
|
|
1762
1930
|
}
|
|
1763
1931
|
if (message.rewardType !== 0) {
|
|
@@ -1766,6 +1934,9 @@ export const Reward = {
|
|
|
1766
1934
|
if (message.commission !== "") {
|
|
1767
1935
|
writer.uint32(42).string(message.commission);
|
|
1768
1936
|
}
|
|
1937
|
+
if (message.commissionBps !== "") {
|
|
1938
|
+
writer.uint32(50).string(message.commissionBps);
|
|
1939
|
+
}
|
|
1769
1940
|
return writer;
|
|
1770
1941
|
},
|
|
1771
1942
|
decode(input, length) {
|
|
@@ -1786,14 +1957,14 @@ export const Reward = {
|
|
|
1786
1957
|
if (tag !== 16) {
|
|
1787
1958
|
break;
|
|
1788
1959
|
}
|
|
1789
|
-
message.lamports =
|
|
1960
|
+
message.lamports = reader.int64();
|
|
1790
1961
|
continue;
|
|
1791
1962
|
}
|
|
1792
1963
|
case 3: {
|
|
1793
1964
|
if (tag !== 24) {
|
|
1794
1965
|
break;
|
|
1795
1966
|
}
|
|
1796
|
-
message.postBalance =
|
|
1967
|
+
message.postBalance = reader.uint64();
|
|
1797
1968
|
continue;
|
|
1798
1969
|
}
|
|
1799
1970
|
case 4: {
|
|
@@ -1810,6 +1981,13 @@ export const Reward = {
|
|
|
1810
1981
|
message.commission = reader.string();
|
|
1811
1982
|
continue;
|
|
1812
1983
|
}
|
|
1984
|
+
case 6: {
|
|
1985
|
+
if (tag !== 50) {
|
|
1986
|
+
break;
|
|
1987
|
+
}
|
|
1988
|
+
message.commissionBps = reader.string();
|
|
1989
|
+
continue;
|
|
1990
|
+
}
|
|
1813
1991
|
}
|
|
1814
1992
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1815
1993
|
break;
|
|
@@ -1821,18 +1999,23 @@ export const Reward = {
|
|
|
1821
1999
|
fromJSON(object) {
|
|
1822
2000
|
return {
|
|
1823
2001
|
pubkey: isSet(object.pubkey) ? globalThis.String(object.pubkey) : "",
|
|
1824
|
-
lamports: isSet(object.lamports) ?
|
|
2002
|
+
lamports: isSet(object.lamports) ? BigInt(object.lamports) : 0n,
|
|
1825
2003
|
postBalance: isSet(object.postBalance)
|
|
1826
|
-
?
|
|
2004
|
+
? BigInt(object.postBalance)
|
|
1827
2005
|
: isSet(object.post_balance)
|
|
1828
|
-
?
|
|
1829
|
-
:
|
|
2006
|
+
? BigInt(object.post_balance)
|
|
2007
|
+
: 0n,
|
|
1830
2008
|
rewardType: isSet(object.rewardType)
|
|
1831
2009
|
? rewardTypeFromJSON(object.rewardType)
|
|
1832
2010
|
: isSet(object.reward_type)
|
|
1833
2011
|
? rewardTypeFromJSON(object.reward_type)
|
|
1834
2012
|
: 0,
|
|
1835
2013
|
commission: isSet(object.commission) ? globalThis.String(object.commission) : "",
|
|
2014
|
+
commissionBps: isSet(object.commissionBps)
|
|
2015
|
+
? globalThis.String(object.commissionBps)
|
|
2016
|
+
: isSet(object.commission_bps)
|
|
2017
|
+
? globalThis.String(object.commission_bps)
|
|
2018
|
+
: "",
|
|
1836
2019
|
};
|
|
1837
2020
|
},
|
|
1838
2021
|
toJSON(message) {
|
|
@@ -1840,11 +2023,11 @@ export const Reward = {
|
|
|
1840
2023
|
if (message.pubkey !== "") {
|
|
1841
2024
|
obj.pubkey = message.pubkey;
|
|
1842
2025
|
}
|
|
1843
|
-
if (message.lamports !==
|
|
1844
|
-
obj.lamports =
|
|
2026
|
+
if (message.lamports !== 0n) {
|
|
2027
|
+
obj.lamports = message.lamports.toString();
|
|
1845
2028
|
}
|
|
1846
|
-
if (message.postBalance !==
|
|
1847
|
-
obj.postBalance =
|
|
2029
|
+
if (message.postBalance !== 0n) {
|
|
2030
|
+
obj.postBalance = message.postBalance.toString();
|
|
1848
2031
|
}
|
|
1849
2032
|
if (message.rewardType !== 0) {
|
|
1850
2033
|
obj.rewardType = rewardTypeToJSON(message.rewardType);
|
|
@@ -1852,6 +2035,9 @@ export const Reward = {
|
|
|
1852
2035
|
if (message.commission !== "") {
|
|
1853
2036
|
obj.commission = message.commission;
|
|
1854
2037
|
}
|
|
2038
|
+
if (message.commissionBps !== "") {
|
|
2039
|
+
obj.commissionBps = message.commissionBps;
|
|
2040
|
+
}
|
|
1855
2041
|
return obj;
|
|
1856
2042
|
},
|
|
1857
2043
|
create(base) {
|
|
@@ -1860,10 +2046,11 @@ export const Reward = {
|
|
|
1860
2046
|
fromPartial(object) {
|
|
1861
2047
|
const message = createBaseReward();
|
|
1862
2048
|
message.pubkey = object.pubkey ?? "";
|
|
1863
|
-
message.lamports = object.lamports ??
|
|
1864
|
-
message.postBalance = object.postBalance ??
|
|
2049
|
+
message.lamports = object.lamports ?? 0n;
|
|
2050
|
+
message.postBalance = object.postBalance ?? 0n;
|
|
1865
2051
|
message.rewardType = object.rewardType ?? 0;
|
|
1866
2052
|
message.commission = object.commission ?? "";
|
|
2053
|
+
message.commissionBps = object.commissionBps ?? "";
|
|
1867
2054
|
return message;
|
|
1868
2055
|
},
|
|
1869
2056
|
};
|
|
@@ -1942,11 +2129,14 @@ export const Rewards = {
|
|
|
1942
2129
|
},
|
|
1943
2130
|
};
|
|
1944
2131
|
function createBaseUnixTimestamp() {
|
|
1945
|
-
return { timestamp:
|
|
2132
|
+
return { timestamp: 0n };
|
|
1946
2133
|
}
|
|
1947
2134
|
export const UnixTimestamp = {
|
|
1948
2135
|
encode(message, writer = new BinaryWriter()) {
|
|
1949
|
-
if (message.timestamp !==
|
|
2136
|
+
if (message.timestamp !== 0n) {
|
|
2137
|
+
if (BigInt.asIntN(64, message.timestamp) !== message.timestamp) {
|
|
2138
|
+
throw new globalThis.Error("value provided for field message.timestamp of type int64 too large");
|
|
2139
|
+
}
|
|
1950
2140
|
writer.uint32(8).int64(message.timestamp);
|
|
1951
2141
|
}
|
|
1952
2142
|
return writer;
|
|
@@ -1962,7 +2152,7 @@ export const UnixTimestamp = {
|
|
|
1962
2152
|
if (tag !== 8) {
|
|
1963
2153
|
break;
|
|
1964
2154
|
}
|
|
1965
|
-
message.timestamp =
|
|
2155
|
+
message.timestamp = reader.int64();
|
|
1966
2156
|
continue;
|
|
1967
2157
|
}
|
|
1968
2158
|
}
|
|
@@ -1974,12 +2164,12 @@ export const UnixTimestamp = {
|
|
|
1974
2164
|
return message;
|
|
1975
2165
|
},
|
|
1976
2166
|
fromJSON(object) {
|
|
1977
|
-
return { timestamp: isSet(object.timestamp) ?
|
|
2167
|
+
return { timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n };
|
|
1978
2168
|
},
|
|
1979
2169
|
toJSON(message) {
|
|
1980
2170
|
const obj = {};
|
|
1981
|
-
if (message.timestamp !==
|
|
1982
|
-
obj.timestamp =
|
|
2171
|
+
if (message.timestamp !== 0n) {
|
|
2172
|
+
obj.timestamp = message.timestamp.toString();
|
|
1983
2173
|
}
|
|
1984
2174
|
return obj;
|
|
1985
2175
|
},
|
|
@@ -1988,16 +2178,19 @@ export const UnixTimestamp = {
|
|
|
1988
2178
|
},
|
|
1989
2179
|
fromPartial(object) {
|
|
1990
2180
|
const message = createBaseUnixTimestamp();
|
|
1991
|
-
message.timestamp = object.timestamp ??
|
|
2181
|
+
message.timestamp = object.timestamp ?? 0n;
|
|
1992
2182
|
return message;
|
|
1993
2183
|
},
|
|
1994
2184
|
};
|
|
1995
2185
|
function createBaseBlockHeight() {
|
|
1996
|
-
return { blockHeight:
|
|
2186
|
+
return { blockHeight: 0n };
|
|
1997
2187
|
}
|
|
1998
2188
|
export const BlockHeight = {
|
|
1999
2189
|
encode(message, writer = new BinaryWriter()) {
|
|
2000
|
-
if (message.blockHeight !==
|
|
2190
|
+
if (message.blockHeight !== 0n) {
|
|
2191
|
+
if (BigInt.asUintN(64, message.blockHeight) !== message.blockHeight) {
|
|
2192
|
+
throw new globalThis.Error("value provided for field message.blockHeight of type uint64 too large");
|
|
2193
|
+
}
|
|
2001
2194
|
writer.uint32(8).uint64(message.blockHeight);
|
|
2002
2195
|
}
|
|
2003
2196
|
return writer;
|
|
@@ -2013,7 +2206,7 @@ export const BlockHeight = {
|
|
|
2013
2206
|
if (tag !== 8) {
|
|
2014
2207
|
break;
|
|
2015
2208
|
}
|
|
2016
|
-
message.blockHeight =
|
|
2209
|
+
message.blockHeight = reader.uint64();
|
|
2017
2210
|
continue;
|
|
2018
2211
|
}
|
|
2019
2212
|
}
|
|
@@ -2027,16 +2220,16 @@ export const BlockHeight = {
|
|
|
2027
2220
|
fromJSON(object) {
|
|
2028
2221
|
return {
|
|
2029
2222
|
blockHeight: isSet(object.blockHeight)
|
|
2030
|
-
?
|
|
2223
|
+
? BigInt(object.blockHeight)
|
|
2031
2224
|
: isSet(object.block_height)
|
|
2032
|
-
?
|
|
2033
|
-
:
|
|
2225
|
+
? BigInt(object.block_height)
|
|
2226
|
+
: 0n,
|
|
2034
2227
|
};
|
|
2035
2228
|
},
|
|
2036
2229
|
toJSON(message) {
|
|
2037
2230
|
const obj = {};
|
|
2038
|
-
if (message.blockHeight !==
|
|
2039
|
-
obj.blockHeight =
|
|
2231
|
+
if (message.blockHeight !== 0n) {
|
|
2232
|
+
obj.blockHeight = message.blockHeight.toString();
|
|
2040
2233
|
}
|
|
2041
2234
|
return obj;
|
|
2042
2235
|
},
|
|
@@ -2045,16 +2238,19 @@ export const BlockHeight = {
|
|
|
2045
2238
|
},
|
|
2046
2239
|
fromPartial(object) {
|
|
2047
2240
|
const message = createBaseBlockHeight();
|
|
2048
|
-
message.blockHeight = object.blockHeight ??
|
|
2241
|
+
message.blockHeight = object.blockHeight ?? 0n;
|
|
2049
2242
|
return message;
|
|
2050
2243
|
},
|
|
2051
2244
|
};
|
|
2052
2245
|
function createBaseNumPartitions() {
|
|
2053
|
-
return { numPartitions:
|
|
2246
|
+
return { numPartitions: 0n };
|
|
2054
2247
|
}
|
|
2055
2248
|
export const NumPartitions = {
|
|
2056
2249
|
encode(message, writer = new BinaryWriter()) {
|
|
2057
|
-
if (message.numPartitions !==
|
|
2250
|
+
if (message.numPartitions !== 0n) {
|
|
2251
|
+
if (BigInt.asUintN(64, message.numPartitions) !== message.numPartitions) {
|
|
2252
|
+
throw new globalThis.Error("value provided for field message.numPartitions of type uint64 too large");
|
|
2253
|
+
}
|
|
2058
2254
|
writer.uint32(8).uint64(message.numPartitions);
|
|
2059
2255
|
}
|
|
2060
2256
|
return writer;
|
|
@@ -2070,7 +2266,7 @@ export const NumPartitions = {
|
|
|
2070
2266
|
if (tag !== 8) {
|
|
2071
2267
|
break;
|
|
2072
2268
|
}
|
|
2073
|
-
message.numPartitions =
|
|
2269
|
+
message.numPartitions = reader.uint64();
|
|
2074
2270
|
continue;
|
|
2075
2271
|
}
|
|
2076
2272
|
}
|
|
@@ -2084,16 +2280,16 @@ export const NumPartitions = {
|
|
|
2084
2280
|
fromJSON(object) {
|
|
2085
2281
|
return {
|
|
2086
2282
|
numPartitions: isSet(object.numPartitions)
|
|
2087
|
-
?
|
|
2283
|
+
? BigInt(object.numPartitions)
|
|
2088
2284
|
: isSet(object.num_partitions)
|
|
2089
|
-
?
|
|
2090
|
-
:
|
|
2285
|
+
? BigInt(object.num_partitions)
|
|
2286
|
+
: 0n,
|
|
2091
2287
|
};
|
|
2092
2288
|
},
|
|
2093
2289
|
toJSON(message) {
|
|
2094
2290
|
const obj = {};
|
|
2095
|
-
if (message.numPartitions !==
|
|
2096
|
-
obj.numPartitions =
|
|
2291
|
+
if (message.numPartitions !== 0n) {
|
|
2292
|
+
obj.numPartitions = message.numPartitions.toString();
|
|
2097
2293
|
}
|
|
2098
2294
|
return obj;
|
|
2099
2295
|
},
|
|
@@ -2102,7 +2298,7 @@ export const NumPartitions = {
|
|
|
2102
2298
|
},
|
|
2103
2299
|
fromPartial(object) {
|
|
2104
2300
|
const message = createBaseNumPartitions();
|
|
2105
|
-
message.numPartitions = object.numPartitions ??
|
|
2301
|
+
message.numPartitions = object.numPartitions ?? 0n;
|
|
2106
2302
|
return message;
|
|
2107
2303
|
},
|
|
2108
2304
|
};
|
|
@@ -2131,16 +2327,6 @@ function base64FromBytes(arr) {
|
|
|
2131
2327
|
return globalThis.btoa(bin.join(""));
|
|
2132
2328
|
}
|
|
2133
2329
|
}
|
|
2134
|
-
function longToNumber(int64) {
|
|
2135
|
-
const num = globalThis.Number(int64.toString());
|
|
2136
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
2137
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
2138
|
-
}
|
|
2139
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
2140
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
2141
|
-
}
|
|
2142
|
-
return num;
|
|
2143
|
-
}
|
|
2144
2330
|
function isSet(value) {
|
|
2145
2331
|
return value !== null && value !== undefined;
|
|
2146
2332
|
}
|