@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.
Files changed (68) hide show
  1. package/README.md +120 -0
  2. package/dist/config.d.ts +0 -1
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +1 -9
  5. package/dist/config.js.map +1 -1
  6. package/dist/filters.d.ts +38 -0
  7. package/dist/filters.d.ts.map +1 -0
  8. package/dist/filters.js +42 -0
  9. package/dist/filters.js.map +1 -0
  10. package/dist/grpc.d.ts +91 -2
  11. package/dist/grpc.d.ts.map +1 -1
  12. package/dist/grpc.js +302 -4
  13. package/dist/grpc.js.map +1 -1
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/jetstream/filters.d.ts +16 -0
  19. package/dist/jetstream/filters.d.ts.map +1 -0
  20. package/dist/jetstream/filters.js +42 -0
  21. package/dist/jetstream/filters.js.map +1 -0
  22. package/dist/{jetstream.d.ts → jetstream/index.d.ts} +12 -6
  23. package/dist/jetstream/index.d.ts.map +1 -0
  24. package/dist/{jetstream.js → jetstream/index.js} +40 -10
  25. package/dist/jetstream/index.js.map +1 -0
  26. package/dist/jetstream/v2.d.ts +108 -0
  27. package/dist/jetstream/v2.d.ts.map +1 -0
  28. package/dist/jetstream/v2.js +575 -0
  29. package/dist/jetstream/v2.js.map +1 -0
  30. package/dist/logger.d.ts +23 -0
  31. package/dist/logger.d.ts.map +1 -0
  32. package/dist/logger.js +88 -0
  33. package/dist/logger.js.map +1 -0
  34. package/dist/proto/geyser.d.ts +41 -41
  35. package/dist/proto/geyser.d.ts.map +1 -1
  36. package/dist/proto/geyser.js +397 -287
  37. package/dist/proto/geyser.js.map +1 -1
  38. package/dist/proto/google/protobuf/timestamp.d.ts +2 -2
  39. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
  40. package/dist/proto/google/protobuf/timestamp.js +10 -17
  41. package/dist/proto/google/protobuf/timestamp.js.map +1 -1
  42. package/dist/proto/jetstream.d.ts +33 -30
  43. package/dist/proto/jetstream.d.ts.map +1 -1
  44. package/dist/proto/jetstream.js +234 -175
  45. package/dist/proto/jetstream.js.map +1 -1
  46. package/dist/proto/jetstream_v2.d.ts +309 -0
  47. package/dist/proto/jetstream_v2.d.ts.map +1 -0
  48. package/dist/proto/jetstream_v2.js +2203 -0
  49. package/dist/proto/jetstream_v2.js.map +1 -0
  50. package/dist/proto/solana-storage.d.ts +22 -12
  51. package/dist/proto/solana-storage.d.ts.map +1 -1
  52. package/dist/proto/solana-storage.js +273 -87
  53. package/dist/proto/solana-storage.js.map +1 -1
  54. package/dist/proto.d.ts +1 -0
  55. package/dist/proto.d.ts.map +1 -1
  56. package/dist/proto.js +1 -0
  57. package/dist/proto.js.map +1 -1
  58. package/dist/rpc.d.ts +7 -0
  59. package/dist/rpc.d.ts.map +1 -1
  60. package/dist/rpc.js +20 -4
  61. package/dist/rpc.js.map +1 -1
  62. package/dist/ws.d.ts +7 -0
  63. package/dist/ws.d.ts.map +1 -1
  64. package/dist/ws.js +29 -4
  65. package/dist/ws.js.map +1 -1
  66. package/package.json +18 -6
  67. package/dist/jetstream.d.ts.map +0 -1
  68. package/dist/jetstream.js.map +0 -1
@@ -462,6 +462,9 @@ export const SubscribeRequestFilterAccountsFilter = {
462
462
  SubscribeRequestFilterAccountsFilterMemcmp.encode(message.memcmp, writer.uint32(10).fork()).join();
463
463
  }
464
464
  if (message.datasize !== undefined) {
465
+ if (BigInt.asUintN(64, message.datasize) !== message.datasize) {
466
+ throw new globalThis.Error("value provided for field message.datasize of type uint64 too large");
467
+ }
465
468
  writer.uint32(16).uint64(message.datasize);
466
469
  }
467
470
  if (message.lamports !== undefined) {
@@ -487,7 +490,7 @@ export const SubscribeRequestFilterAccountsFilter = {
487
490
  if (tag !== 16) {
488
491
  break;
489
492
  }
490
- message.datasize = longToNumber(reader.uint64());
493
+ message.datasize = reader.uint64();
491
494
  continue;
492
495
  }
493
496
  case 3: {
@@ -508,7 +511,7 @@ export const SubscribeRequestFilterAccountsFilter = {
508
511
  fromJSON(object) {
509
512
  return {
510
513
  memcmp: isSet(object.memcmp) ? SubscribeRequestFilterAccountsFilterMemcmp.fromJSON(object.memcmp) : undefined,
511
- datasize: isSet(object.datasize) ? globalThis.Number(object.datasize) : undefined,
514
+ datasize: isSet(object.datasize) ? BigInt(object.datasize) : undefined,
512
515
  lamports: isSet(object.lamports)
513
516
  ? SubscribeRequestFilterAccountsFilterLamports.fromJSON(object.lamports)
514
517
  : undefined,
@@ -520,7 +523,7 @@ export const SubscribeRequestFilterAccountsFilter = {
520
523
  obj.memcmp = SubscribeRequestFilterAccountsFilterMemcmp.toJSON(message.memcmp);
521
524
  }
522
525
  if (message.datasize !== undefined) {
523
- obj.datasize = Math.round(message.datasize);
526
+ obj.datasize = message.datasize.toString();
524
527
  }
525
528
  if (message.lamports !== undefined) {
526
529
  obj.lamports = SubscribeRequestFilterAccountsFilterLamports.toJSON(message.lamports);
@@ -543,11 +546,14 @@ export const SubscribeRequestFilterAccountsFilter = {
543
546
  },
544
547
  };
545
548
  function createBaseSubscribeRequestFilterAccountsFilterMemcmp() {
546
- return { offset: 0, bytes: undefined, base58: undefined, base64: undefined };
549
+ return { offset: 0n, bytes: undefined, base58: undefined, base64: undefined };
547
550
  }
548
551
  export const SubscribeRequestFilterAccountsFilterMemcmp = {
549
552
  encode(message, writer = new BinaryWriter()) {
550
- if (message.offset !== 0) {
553
+ if (message.offset !== 0n) {
554
+ if (BigInt.asUintN(64, message.offset) !== message.offset) {
555
+ throw new globalThis.Error("value provided for field message.offset of type uint64 too large");
556
+ }
551
557
  writer.uint32(8).uint64(message.offset);
552
558
  }
553
559
  if (message.bytes !== undefined) {
@@ -572,7 +578,7 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = {
572
578
  if (tag !== 8) {
573
579
  break;
574
580
  }
575
- message.offset = longToNumber(reader.uint64());
581
+ message.offset = reader.uint64();
576
582
  continue;
577
583
  }
578
584
  case 2: {
@@ -606,7 +612,7 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = {
606
612
  },
607
613
  fromJSON(object) {
608
614
  return {
609
- offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
615
+ offset: isSet(object.offset) ? BigInt(object.offset) : 0n,
610
616
  bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : undefined,
611
617
  base58: isSet(object.base58) ? globalThis.String(object.base58) : undefined,
612
618
  base64: isSet(object.base64) ? globalThis.String(object.base64) : undefined,
@@ -614,8 +620,8 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = {
614
620
  },
615
621
  toJSON(message) {
616
622
  const obj = {};
617
- if (message.offset !== 0) {
618
- obj.offset = Math.round(message.offset);
623
+ if (message.offset !== 0n) {
624
+ obj.offset = message.offset.toString();
619
625
  }
620
626
  if (message.bytes !== undefined) {
621
627
  obj.bytes = base64FromBytes(message.bytes);
@@ -633,7 +639,7 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = {
633
639
  },
634
640
  fromPartial(object) {
635
641
  const message = createBaseSubscribeRequestFilterAccountsFilterMemcmp();
636
- message.offset = object.offset ?? 0;
642
+ message.offset = object.offset ?? 0n;
637
643
  message.bytes = object.bytes ?? undefined;
638
644
  message.base58 = object.base58 ?? undefined;
639
645
  message.base64 = object.base64 ?? undefined;
@@ -646,15 +652,27 @@ function createBaseSubscribeRequestFilterAccountsFilterLamports() {
646
652
  export const SubscribeRequestFilterAccountsFilterLamports = {
647
653
  encode(message, writer = new BinaryWriter()) {
648
654
  if (message.eq !== undefined) {
655
+ if (BigInt.asUintN(64, message.eq) !== message.eq) {
656
+ throw new globalThis.Error("value provided for field message.eq of type uint64 too large");
657
+ }
649
658
  writer.uint32(8).uint64(message.eq);
650
659
  }
651
660
  if (message.ne !== undefined) {
661
+ if (BigInt.asUintN(64, message.ne) !== message.ne) {
662
+ throw new globalThis.Error("value provided for field message.ne of type uint64 too large");
663
+ }
652
664
  writer.uint32(16).uint64(message.ne);
653
665
  }
654
666
  if (message.lt !== undefined) {
667
+ if (BigInt.asUintN(64, message.lt) !== message.lt) {
668
+ throw new globalThis.Error("value provided for field message.lt of type uint64 too large");
669
+ }
655
670
  writer.uint32(24).uint64(message.lt);
656
671
  }
657
672
  if (message.gt !== undefined) {
673
+ if (BigInt.asUintN(64, message.gt) !== message.gt) {
674
+ throw new globalThis.Error("value provided for field message.gt of type uint64 too large");
675
+ }
658
676
  writer.uint32(32).uint64(message.gt);
659
677
  }
660
678
  return writer;
@@ -670,28 +688,28 @@ export const SubscribeRequestFilterAccountsFilterLamports = {
670
688
  if (tag !== 8) {
671
689
  break;
672
690
  }
673
- message.eq = longToNumber(reader.uint64());
691
+ message.eq = reader.uint64();
674
692
  continue;
675
693
  }
676
694
  case 2: {
677
695
  if (tag !== 16) {
678
696
  break;
679
697
  }
680
- message.ne = longToNumber(reader.uint64());
698
+ message.ne = reader.uint64();
681
699
  continue;
682
700
  }
683
701
  case 3: {
684
702
  if (tag !== 24) {
685
703
  break;
686
704
  }
687
- message.lt = longToNumber(reader.uint64());
705
+ message.lt = reader.uint64();
688
706
  continue;
689
707
  }
690
708
  case 4: {
691
709
  if (tag !== 32) {
692
710
  break;
693
711
  }
694
- message.gt = longToNumber(reader.uint64());
712
+ message.gt = reader.uint64();
695
713
  continue;
696
714
  }
697
715
  }
@@ -704,25 +722,25 @@ export const SubscribeRequestFilterAccountsFilterLamports = {
704
722
  },
705
723
  fromJSON(object) {
706
724
  return {
707
- eq: isSet(object.eq) ? globalThis.Number(object.eq) : undefined,
708
- ne: isSet(object.ne) ? globalThis.Number(object.ne) : undefined,
709
- lt: isSet(object.lt) ? globalThis.Number(object.lt) : undefined,
710
- gt: isSet(object.gt) ? globalThis.Number(object.gt) : undefined,
725
+ eq: isSet(object.eq) ? BigInt(object.eq) : undefined,
726
+ ne: isSet(object.ne) ? BigInt(object.ne) : undefined,
727
+ lt: isSet(object.lt) ? BigInt(object.lt) : undefined,
728
+ gt: isSet(object.gt) ? BigInt(object.gt) : undefined,
711
729
  };
712
730
  },
713
731
  toJSON(message) {
714
732
  const obj = {};
715
733
  if (message.eq !== undefined) {
716
- obj.eq = Math.round(message.eq);
734
+ obj.eq = message.eq.toString();
717
735
  }
718
736
  if (message.ne !== undefined) {
719
- obj.ne = Math.round(message.ne);
737
+ obj.ne = message.ne.toString();
720
738
  }
721
739
  if (message.lt !== undefined) {
722
- obj.lt = Math.round(message.lt);
740
+ obj.lt = message.lt.toString();
723
741
  }
724
742
  if (message.gt !== undefined) {
725
- obj.gt = Math.round(message.gt);
743
+ obj.gt = message.gt.toString();
726
744
  }
727
745
  return obj;
728
746
  },
@@ -937,14 +955,17 @@ export const SubscribeUpdate = {
937
955
  },
938
956
  };
939
957
  function createBaseSubscribeUpdateTransaction() {
940
- return { transaction: undefined, slot: 0 };
958
+ return { transaction: undefined, slot: 0n };
941
959
  }
942
960
  export const SubscribeUpdateTransaction = {
943
961
  encode(message, writer = new BinaryWriter()) {
944
962
  if (message.transaction !== undefined) {
945
963
  SubscribeUpdateTransactionInfo.encode(message.transaction, writer.uint32(10).fork()).join();
946
964
  }
947
- if (message.slot !== 0) {
965
+ if (message.slot !== 0n) {
966
+ if (BigInt.asUintN(64, message.slot) !== message.slot) {
967
+ throw new globalThis.Error("value provided for field message.slot of type uint64 too large");
968
+ }
948
969
  writer.uint32(16).uint64(message.slot);
949
970
  }
950
971
  return writer;
@@ -967,7 +988,7 @@ export const SubscribeUpdateTransaction = {
967
988
  if (tag !== 16) {
968
989
  break;
969
990
  }
970
- message.slot = longToNumber(reader.uint64());
991
+ message.slot = reader.uint64();
971
992
  continue;
972
993
  }
973
994
  }
@@ -981,7 +1002,7 @@ export const SubscribeUpdateTransaction = {
981
1002
  fromJSON(object) {
982
1003
  return {
983
1004
  transaction: isSet(object.transaction) ? SubscribeUpdateTransactionInfo.fromJSON(object.transaction) : undefined,
984
- slot: isSet(object.slot) ? globalThis.Number(object.slot) : 0,
1005
+ slot: isSet(object.slot) ? BigInt(object.slot) : 0n,
985
1006
  };
986
1007
  },
987
1008
  toJSON(message) {
@@ -989,8 +1010,8 @@ export const SubscribeUpdateTransaction = {
989
1010
  if (message.transaction !== undefined) {
990
1011
  obj.transaction = SubscribeUpdateTransactionInfo.toJSON(message.transaction);
991
1012
  }
992
- if (message.slot !== 0) {
993
- obj.slot = Math.round(message.slot);
1013
+ if (message.slot !== 0n) {
1014
+ obj.slot = message.slot.toString();
994
1015
  }
995
1016
  return obj;
996
1017
  },
@@ -1002,14 +1023,14 @@ export const SubscribeUpdateTransaction = {
1002
1023
  message.transaction = (object.transaction !== undefined && object.transaction !== null)
1003
1024
  ? SubscribeUpdateTransactionInfo.fromPartial(object.transaction)
1004
1025
  : undefined;
1005
- message.slot = object.slot ?? 0;
1026
+ message.slot = object.slot ?? 0n;
1006
1027
  return message;
1007
1028
  },
1008
1029
  };
1009
1030
  function createBaseSubscribeUpdateTransactionInfo() {
1010
1031
  return {
1011
1032
  signature: new Uint8Array(0),
1012
- slot: 0,
1033
+ slot: 0n,
1013
1034
  numRequiredSignatures: 0,
1014
1035
  numReadonlySignedAccounts: 0,
1015
1036
  numReadonlyUnsignedAccounts: 0,
@@ -1025,7 +1046,10 @@ export const SubscribeUpdateTransactionInfo = {
1025
1046
  if (message.signature.length !== 0) {
1026
1047
  writer.uint32(10).bytes(message.signature);
1027
1048
  }
1028
- if (message.slot !== 0) {
1049
+ if (message.slot !== 0n) {
1050
+ if (BigInt.asUintN(64, message.slot) !== message.slot) {
1051
+ throw new globalThis.Error("value provided for field message.slot of type uint64 too large");
1052
+ }
1029
1053
  writer.uint32(16).uint64(message.slot);
1030
1054
  }
1031
1055
  if (message.numRequiredSignatures !== 0) {
@@ -1072,7 +1096,7 @@ export const SubscribeUpdateTransactionInfo = {
1072
1096
  if (tag !== 16) {
1073
1097
  break;
1074
1098
  }
1075
- message.slot = longToNumber(reader.uint64());
1099
+ message.slot = reader.uint64();
1076
1100
  continue;
1077
1101
  }
1078
1102
  case 3: {
@@ -1142,7 +1166,7 @@ export const SubscribeUpdateTransactionInfo = {
1142
1166
  fromJSON(object) {
1143
1167
  return {
1144
1168
  signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0),
1145
- slot: isSet(object.slot) ? globalThis.Number(object.slot) : 0,
1169
+ slot: isSet(object.slot) ? BigInt(object.slot) : 0n,
1146
1170
  numRequiredSignatures: isSet(object.numRequiredSignatures)
1147
1171
  ? globalThis.Number(object.numRequiredSignatures)
1148
1172
  : isSet(object.num_required_signatures)
@@ -1186,8 +1210,8 @@ export const SubscribeUpdateTransactionInfo = {
1186
1210
  if (message.signature.length !== 0) {
1187
1211
  obj.signature = base64FromBytes(message.signature);
1188
1212
  }
1189
- if (message.slot !== 0) {
1190
- obj.slot = Math.round(message.slot);
1213
+ if (message.slot !== 0n) {
1214
+ obj.slot = message.slot.toString();
1191
1215
  }
1192
1216
  if (message.numRequiredSignatures !== 0) {
1193
1217
  obj.numRequiredSignatures = Math.round(message.numRequiredSignatures);
@@ -1221,7 +1245,7 @@ export const SubscribeUpdateTransactionInfo = {
1221
1245
  fromPartial(object) {
1222
1246
  const message = createBaseSubscribeUpdateTransactionInfo();
1223
1247
  message.signature = object.signature ?? new Uint8Array(0);
1224
- message.slot = object.slot ?? 0;
1248
+ message.slot = object.slot ?? 0n;
1225
1249
  message.numRequiredSignatures = object.numRequiredSignatures ?? 0;
1226
1250
  message.numReadonlySignedAccounts = object.numReadonlySignedAccounts ?? 0;
1227
1251
  message.numReadonlyUnsignedAccounts = object.numReadonlyUnsignedAccounts ?? 0;
@@ -1235,14 +1259,17 @@ export const SubscribeUpdateTransactionInfo = {
1235
1259
  },
1236
1260
  };
1237
1261
  function createBaseSubscribeUpdateAccount() {
1238
- return { account: undefined, slot: 0, isStartup: false };
1262
+ return { account: undefined, slot: 0n, isStartup: false };
1239
1263
  }
1240
1264
  export const SubscribeUpdateAccount = {
1241
1265
  encode(message, writer = new BinaryWriter()) {
1242
1266
  if (message.account !== undefined) {
1243
1267
  SubscribeUpdateAccountInfo.encode(message.account, writer.uint32(10).fork()).join();
1244
1268
  }
1245
- if (message.slot !== 0) {
1269
+ if (message.slot !== 0n) {
1270
+ if (BigInt.asUintN(64, message.slot) !== message.slot) {
1271
+ throw new globalThis.Error("value provided for field message.slot of type uint64 too large");
1272
+ }
1246
1273
  writer.uint32(16).uint64(message.slot);
1247
1274
  }
1248
1275
  if (message.isStartup !== false) {
@@ -1268,7 +1295,7 @@ export const SubscribeUpdateAccount = {
1268
1295
  if (tag !== 16) {
1269
1296
  break;
1270
1297
  }
1271
- message.slot = longToNumber(reader.uint64());
1298
+ message.slot = reader.uint64();
1272
1299
  continue;
1273
1300
  }
1274
1301
  case 3: {
@@ -1289,7 +1316,7 @@ export const SubscribeUpdateAccount = {
1289
1316
  fromJSON(object) {
1290
1317
  return {
1291
1318
  account: isSet(object.account) ? SubscribeUpdateAccountInfo.fromJSON(object.account) : undefined,
1292
- slot: isSet(object.slot) ? globalThis.Number(object.slot) : 0,
1319
+ slot: isSet(object.slot) ? BigInt(object.slot) : 0n,
1293
1320
  isStartup: isSet(object.isStartup)
1294
1321
  ? globalThis.Boolean(object.isStartup)
1295
1322
  : isSet(object.is_startup)
@@ -1302,8 +1329,8 @@ export const SubscribeUpdateAccount = {
1302
1329
  if (message.account !== undefined) {
1303
1330
  obj.account = SubscribeUpdateAccountInfo.toJSON(message.account);
1304
1331
  }
1305
- if (message.slot !== 0) {
1306
- obj.slot = Math.round(message.slot);
1332
+ if (message.slot !== 0n) {
1333
+ obj.slot = message.slot.toString();
1307
1334
  }
1308
1335
  if (message.isStartup !== false) {
1309
1336
  obj.isStartup = message.isStartup;
@@ -1318,7 +1345,7 @@ export const SubscribeUpdateAccount = {
1318
1345
  message.account = (object.account !== undefined && object.account !== null)
1319
1346
  ? SubscribeUpdateAccountInfo.fromPartial(object.account)
1320
1347
  : undefined;
1321
- message.slot = object.slot ?? 0;
1348
+ message.slot = object.slot ?? 0n;
1322
1349
  message.isStartup = object.isStartup ?? false;
1323
1350
  return message;
1324
1351
  },
@@ -1326,13 +1353,13 @@ export const SubscribeUpdateAccount = {
1326
1353
  function createBaseSubscribeUpdateAccountInfo() {
1327
1354
  return {
1328
1355
  pubkey: new Uint8Array(0),
1329
- lamports: 0,
1356
+ lamports: 0n,
1330
1357
  owner: new Uint8Array(0),
1331
1358
  executable: false,
1332
- rentEpoch: 0,
1359
+ rentEpoch: 0n,
1333
1360
  data: new Uint8Array(0),
1334
- writeVersion: 0,
1335
- txnSignature: undefined,
1361
+ writeVersion: 0n,
1362
+ txnSignature: new Uint8Array(0),
1336
1363
  };
1337
1364
  }
1338
1365
  export const SubscribeUpdateAccountInfo = {
@@ -1340,7 +1367,10 @@ export const SubscribeUpdateAccountInfo = {
1340
1367
  if (message.pubkey.length !== 0) {
1341
1368
  writer.uint32(10).bytes(message.pubkey);
1342
1369
  }
1343
- if (message.lamports !== 0) {
1370
+ if (message.lamports !== 0n) {
1371
+ if (BigInt.asUintN(64, message.lamports) !== message.lamports) {
1372
+ throw new globalThis.Error("value provided for field message.lamports of type uint64 too large");
1373
+ }
1344
1374
  writer.uint32(16).uint64(message.lamports);
1345
1375
  }
1346
1376
  if (message.owner.length !== 0) {
@@ -1349,16 +1379,22 @@ export const SubscribeUpdateAccountInfo = {
1349
1379
  if (message.executable !== false) {
1350
1380
  writer.uint32(32).bool(message.executable);
1351
1381
  }
1352
- if (message.rentEpoch !== 0) {
1382
+ if (message.rentEpoch !== 0n) {
1383
+ if (BigInt.asUintN(64, message.rentEpoch) !== message.rentEpoch) {
1384
+ throw new globalThis.Error("value provided for field message.rentEpoch of type uint64 too large");
1385
+ }
1353
1386
  writer.uint32(40).uint64(message.rentEpoch);
1354
1387
  }
1355
1388
  if (message.data.length !== 0) {
1356
1389
  writer.uint32(50).bytes(message.data);
1357
1390
  }
1358
- if (message.writeVersion !== 0) {
1391
+ if (message.writeVersion !== 0n) {
1392
+ if (BigInt.asUintN(64, message.writeVersion) !== message.writeVersion) {
1393
+ throw new globalThis.Error("value provided for field message.writeVersion of type uint64 too large");
1394
+ }
1359
1395
  writer.uint32(56).uint64(message.writeVersion);
1360
1396
  }
1361
- if (message.txnSignature !== undefined) {
1397
+ if (message.txnSignature.length !== 0) {
1362
1398
  writer.uint32(66).bytes(message.txnSignature);
1363
1399
  }
1364
1400
  return writer;
@@ -1381,7 +1417,7 @@ export const SubscribeUpdateAccountInfo = {
1381
1417
  if (tag !== 16) {
1382
1418
  break;
1383
1419
  }
1384
- message.lamports = longToNumber(reader.uint64());
1420
+ message.lamports = reader.uint64();
1385
1421
  continue;
1386
1422
  }
1387
1423
  case 3: {
@@ -1402,7 +1438,7 @@ export const SubscribeUpdateAccountInfo = {
1402
1438
  if (tag !== 40) {
1403
1439
  break;
1404
1440
  }
1405
- message.rentEpoch = longToNumber(reader.uint64());
1441
+ message.rentEpoch = reader.uint64();
1406
1442
  continue;
1407
1443
  }
1408
1444
  case 6: {
@@ -1416,7 +1452,7 @@ export const SubscribeUpdateAccountInfo = {
1416
1452
  if (tag !== 56) {
1417
1453
  break;
1418
1454
  }
1419
- message.writeVersion = longToNumber(reader.uint64());
1455
+ message.writeVersion = reader.uint64();
1420
1456
  continue;
1421
1457
  }
1422
1458
  case 8: {
@@ -1437,25 +1473,25 @@ export const SubscribeUpdateAccountInfo = {
1437
1473
  fromJSON(object) {
1438
1474
  return {
1439
1475
  pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array(0),
1440
- lamports: isSet(object.lamports) ? globalThis.Number(object.lamports) : 0,
1476
+ lamports: isSet(object.lamports) ? BigInt(object.lamports) : 0n,
1441
1477
  owner: isSet(object.owner) ? bytesFromBase64(object.owner) : new Uint8Array(0),
1442
1478
  executable: isSet(object.executable) ? globalThis.Boolean(object.executable) : false,
1443
1479
  rentEpoch: isSet(object.rentEpoch)
1444
- ? globalThis.Number(object.rentEpoch)
1480
+ ? BigInt(object.rentEpoch)
1445
1481
  : isSet(object.rent_epoch)
1446
- ? globalThis.Number(object.rent_epoch)
1447
- : 0,
1482
+ ? BigInt(object.rent_epoch)
1483
+ : 0n,
1448
1484
  data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
1449
1485
  writeVersion: isSet(object.writeVersion)
1450
- ? globalThis.Number(object.writeVersion)
1486
+ ? BigInt(object.writeVersion)
1451
1487
  : isSet(object.write_version)
1452
- ? globalThis.Number(object.write_version)
1453
- : 0,
1488
+ ? BigInt(object.write_version)
1489
+ : 0n,
1454
1490
  txnSignature: isSet(object.txnSignature)
1455
1491
  ? bytesFromBase64(object.txnSignature)
1456
1492
  : isSet(object.txn_signature)
1457
1493
  ? bytesFromBase64(object.txn_signature)
1458
- : undefined,
1494
+ : new Uint8Array(0),
1459
1495
  };
1460
1496
  },
1461
1497
  toJSON(message) {
@@ -1463,8 +1499,8 @@ export const SubscribeUpdateAccountInfo = {
1463
1499
  if (message.pubkey.length !== 0) {
1464
1500
  obj.pubkey = base64FromBytes(message.pubkey);
1465
1501
  }
1466
- if (message.lamports !== 0) {
1467
- obj.lamports = Math.round(message.lamports);
1502
+ if (message.lamports !== 0n) {
1503
+ obj.lamports = message.lamports.toString();
1468
1504
  }
1469
1505
  if (message.owner.length !== 0) {
1470
1506
  obj.owner = base64FromBytes(message.owner);
@@ -1472,16 +1508,16 @@ export const SubscribeUpdateAccountInfo = {
1472
1508
  if (message.executable !== false) {
1473
1509
  obj.executable = message.executable;
1474
1510
  }
1475
- if (message.rentEpoch !== 0) {
1476
- obj.rentEpoch = Math.round(message.rentEpoch);
1511
+ if (message.rentEpoch !== 0n) {
1512
+ obj.rentEpoch = message.rentEpoch.toString();
1477
1513
  }
1478
1514
  if (message.data.length !== 0) {
1479
1515
  obj.data = base64FromBytes(message.data);
1480
1516
  }
1481
- if (message.writeVersion !== 0) {
1482
- obj.writeVersion = Math.round(message.writeVersion);
1517
+ if (message.writeVersion !== 0n) {
1518
+ obj.writeVersion = message.writeVersion.toString();
1483
1519
  }
1484
- if (message.txnSignature !== undefined) {
1520
+ if (message.txnSignature.length !== 0) {
1485
1521
  obj.txnSignature = base64FromBytes(message.txnSignature);
1486
1522
  }
1487
1523
  return obj;
@@ -1492,13 +1528,13 @@ export const SubscribeUpdateAccountInfo = {
1492
1528
  fromPartial(object) {
1493
1529
  const message = createBaseSubscribeUpdateAccountInfo();
1494
1530
  message.pubkey = object.pubkey ?? new Uint8Array(0);
1495
- message.lamports = object.lamports ?? 0;
1531
+ message.lamports = object.lamports ?? 0n;
1496
1532
  message.owner = object.owner ?? new Uint8Array(0);
1497
1533
  message.executable = object.executable ?? false;
1498
- message.rentEpoch = object.rentEpoch ?? 0;
1534
+ message.rentEpoch = object.rentEpoch ?? 0n;
1499
1535
  message.data = object.data ?? new Uint8Array(0);
1500
- message.writeVersion = object.writeVersion ?? 0;
1501
- message.txnSignature = object.txnSignature ?? undefined;
1536
+ message.writeVersion = object.writeVersion ?? 0n;
1537
+ message.txnSignature = object.txnSignature ?? new Uint8Array(0);
1502
1538
  return message;
1503
1539
  },
1504
1540
  };
@@ -2012,11 +2048,11 @@ export const Initialize = {
2012
2048
  function createBaseSetParams() {
2013
2049
  return {
2014
2050
  feeRecipient: new Uint8Array(0),
2015
- initialVirtualTokenReserves: 0,
2016
- initialVirtualSolReserves: 0,
2017
- initialRealTokenReserves: 0,
2018
- tokenTotalSupply: 0,
2019
- feeBasisPoints: 0,
2051
+ initialVirtualTokenReserves: 0n,
2052
+ initialVirtualSolReserves: 0n,
2053
+ initialRealTokenReserves: 0n,
2054
+ tokenTotalSupply: 0n,
2055
+ feeBasisPoints: 0n,
2020
2056
  };
2021
2057
  }
2022
2058
  export const SetParams = {
@@ -2024,19 +2060,34 @@ export const SetParams = {
2024
2060
  if (message.feeRecipient.length !== 0) {
2025
2061
  writer.uint32(10).bytes(message.feeRecipient);
2026
2062
  }
2027
- if (message.initialVirtualTokenReserves !== 0) {
2063
+ if (message.initialVirtualTokenReserves !== 0n) {
2064
+ if (BigInt.asUintN(64, message.initialVirtualTokenReserves) !== message.initialVirtualTokenReserves) {
2065
+ throw new globalThis.Error("value provided for field message.initialVirtualTokenReserves of type uint64 too large");
2066
+ }
2028
2067
  writer.uint32(16).uint64(message.initialVirtualTokenReserves);
2029
2068
  }
2030
- if (message.initialVirtualSolReserves !== 0) {
2069
+ if (message.initialVirtualSolReserves !== 0n) {
2070
+ if (BigInt.asUintN(64, message.initialVirtualSolReserves) !== message.initialVirtualSolReserves) {
2071
+ throw new globalThis.Error("value provided for field message.initialVirtualSolReserves of type uint64 too large");
2072
+ }
2031
2073
  writer.uint32(24).uint64(message.initialVirtualSolReserves);
2032
2074
  }
2033
- if (message.initialRealTokenReserves !== 0) {
2075
+ if (message.initialRealTokenReserves !== 0n) {
2076
+ if (BigInt.asUintN(64, message.initialRealTokenReserves) !== message.initialRealTokenReserves) {
2077
+ throw new globalThis.Error("value provided for field message.initialRealTokenReserves of type uint64 too large");
2078
+ }
2034
2079
  writer.uint32(32).uint64(message.initialRealTokenReserves);
2035
2080
  }
2036
- if (message.tokenTotalSupply !== 0) {
2081
+ if (message.tokenTotalSupply !== 0n) {
2082
+ if (BigInt.asUintN(64, message.tokenTotalSupply) !== message.tokenTotalSupply) {
2083
+ throw new globalThis.Error("value provided for field message.tokenTotalSupply of type uint64 too large");
2084
+ }
2037
2085
  writer.uint32(40).uint64(message.tokenTotalSupply);
2038
2086
  }
2039
- if (message.feeBasisPoints !== 0) {
2087
+ if (message.feeBasisPoints !== 0n) {
2088
+ if (BigInt.asUintN(64, message.feeBasisPoints) !== message.feeBasisPoints) {
2089
+ throw new globalThis.Error("value provided for field message.feeBasisPoints of type uint64 too large");
2090
+ }
2040
2091
  writer.uint32(48).uint64(message.feeBasisPoints);
2041
2092
  }
2042
2093
  return writer;
@@ -2059,35 +2110,35 @@ export const SetParams = {
2059
2110
  if (tag !== 16) {
2060
2111
  break;
2061
2112
  }
2062
- message.initialVirtualTokenReserves = longToNumber(reader.uint64());
2113
+ message.initialVirtualTokenReserves = reader.uint64();
2063
2114
  continue;
2064
2115
  }
2065
2116
  case 3: {
2066
2117
  if (tag !== 24) {
2067
2118
  break;
2068
2119
  }
2069
- message.initialVirtualSolReserves = longToNumber(reader.uint64());
2120
+ message.initialVirtualSolReserves = reader.uint64();
2070
2121
  continue;
2071
2122
  }
2072
2123
  case 4: {
2073
2124
  if (tag !== 32) {
2074
2125
  break;
2075
2126
  }
2076
- message.initialRealTokenReserves = longToNumber(reader.uint64());
2127
+ message.initialRealTokenReserves = reader.uint64();
2077
2128
  continue;
2078
2129
  }
2079
2130
  case 5: {
2080
2131
  if (tag !== 40) {
2081
2132
  break;
2082
2133
  }
2083
- message.tokenTotalSupply = longToNumber(reader.uint64());
2134
+ message.tokenTotalSupply = reader.uint64();
2084
2135
  continue;
2085
2136
  }
2086
2137
  case 6: {
2087
2138
  if (tag !== 48) {
2088
2139
  break;
2089
2140
  }
2090
- message.feeBasisPoints = longToNumber(reader.uint64());
2141
+ message.feeBasisPoints = reader.uint64();
2091
2142
  continue;
2092
2143
  }
2093
2144
  }
@@ -2106,30 +2157,30 @@ export const SetParams = {
2106
2157
  ? bytesFromBase64(object.fee_recipient)
2107
2158
  : new Uint8Array(0),
2108
2159
  initialVirtualTokenReserves: isSet(object.initialVirtualTokenReserves)
2109
- ? globalThis.Number(object.initialVirtualTokenReserves)
2160
+ ? BigInt(object.initialVirtualTokenReserves)
2110
2161
  : isSet(object.initial_virtual_token_reserves)
2111
- ? globalThis.Number(object.initial_virtual_token_reserves)
2112
- : 0,
2162
+ ? BigInt(object.initial_virtual_token_reserves)
2163
+ : 0n,
2113
2164
  initialVirtualSolReserves: isSet(object.initialVirtualSolReserves)
2114
- ? globalThis.Number(object.initialVirtualSolReserves)
2165
+ ? BigInt(object.initialVirtualSolReserves)
2115
2166
  : isSet(object.initial_virtual_sol_reserves)
2116
- ? globalThis.Number(object.initial_virtual_sol_reserves)
2117
- : 0,
2167
+ ? BigInt(object.initial_virtual_sol_reserves)
2168
+ : 0n,
2118
2169
  initialRealTokenReserves: isSet(object.initialRealTokenReserves)
2119
- ? globalThis.Number(object.initialRealTokenReserves)
2170
+ ? BigInt(object.initialRealTokenReserves)
2120
2171
  : isSet(object.initial_real_token_reserves)
2121
- ? globalThis.Number(object.initial_real_token_reserves)
2122
- : 0,
2172
+ ? BigInt(object.initial_real_token_reserves)
2173
+ : 0n,
2123
2174
  tokenTotalSupply: isSet(object.tokenTotalSupply)
2124
- ? globalThis.Number(object.tokenTotalSupply)
2175
+ ? BigInt(object.tokenTotalSupply)
2125
2176
  : isSet(object.token_total_supply)
2126
- ? globalThis.Number(object.token_total_supply)
2127
- : 0,
2177
+ ? BigInt(object.token_total_supply)
2178
+ : 0n,
2128
2179
  feeBasisPoints: isSet(object.feeBasisPoints)
2129
- ? globalThis.Number(object.feeBasisPoints)
2180
+ ? BigInt(object.feeBasisPoints)
2130
2181
  : isSet(object.fee_basis_points)
2131
- ? globalThis.Number(object.fee_basis_points)
2132
- : 0,
2182
+ ? BigInt(object.fee_basis_points)
2183
+ : 0n,
2133
2184
  };
2134
2185
  },
2135
2186
  toJSON(message) {
@@ -2137,20 +2188,20 @@ export const SetParams = {
2137
2188
  if (message.feeRecipient.length !== 0) {
2138
2189
  obj.feeRecipient = base64FromBytes(message.feeRecipient);
2139
2190
  }
2140
- if (message.initialVirtualTokenReserves !== 0) {
2141
- obj.initialVirtualTokenReserves = Math.round(message.initialVirtualTokenReserves);
2191
+ if (message.initialVirtualTokenReserves !== 0n) {
2192
+ obj.initialVirtualTokenReserves = message.initialVirtualTokenReserves.toString();
2142
2193
  }
2143
- if (message.initialVirtualSolReserves !== 0) {
2144
- obj.initialVirtualSolReserves = Math.round(message.initialVirtualSolReserves);
2194
+ if (message.initialVirtualSolReserves !== 0n) {
2195
+ obj.initialVirtualSolReserves = message.initialVirtualSolReserves.toString();
2145
2196
  }
2146
- if (message.initialRealTokenReserves !== 0) {
2147
- obj.initialRealTokenReserves = Math.round(message.initialRealTokenReserves);
2197
+ if (message.initialRealTokenReserves !== 0n) {
2198
+ obj.initialRealTokenReserves = message.initialRealTokenReserves.toString();
2148
2199
  }
2149
- if (message.tokenTotalSupply !== 0) {
2150
- obj.tokenTotalSupply = Math.round(message.tokenTotalSupply);
2200
+ if (message.tokenTotalSupply !== 0n) {
2201
+ obj.tokenTotalSupply = message.tokenTotalSupply.toString();
2151
2202
  }
2152
- if (message.feeBasisPoints !== 0) {
2153
- obj.feeBasisPoints = Math.round(message.feeBasisPoints);
2203
+ if (message.feeBasisPoints !== 0n) {
2204
+ obj.feeBasisPoints = message.feeBasisPoints.toString();
2154
2205
  }
2155
2206
  return obj;
2156
2207
  },
@@ -2160,11 +2211,11 @@ export const SetParams = {
2160
2211
  fromPartial(object) {
2161
2212
  const message = createBaseSetParams();
2162
2213
  message.feeRecipient = object.feeRecipient ?? new Uint8Array(0);
2163
- message.initialVirtualTokenReserves = object.initialVirtualTokenReserves ?? 0;
2164
- message.initialVirtualSolReserves = object.initialVirtualSolReserves ?? 0;
2165
- message.initialRealTokenReserves = object.initialRealTokenReserves ?? 0;
2166
- message.tokenTotalSupply = object.tokenTotalSupply ?? 0;
2167
- message.feeBasisPoints = object.feeBasisPoints ?? 0;
2214
+ message.initialVirtualTokenReserves = object.initialVirtualTokenReserves ?? 0n;
2215
+ message.initialVirtualSolReserves = object.initialVirtualSolReserves ?? 0n;
2216
+ message.initialRealTokenReserves = object.initialRealTokenReserves ?? 0n;
2217
+ message.tokenTotalSupply = object.tokenTotalSupply ?? 0n;
2218
+ message.feeBasisPoints = object.feeBasisPoints ?? 0n;
2168
2219
  return message;
2169
2220
  },
2170
2221
  };
@@ -2252,14 +2303,20 @@ export const Create = {
2252
2303
  },
2253
2304
  };
2254
2305
  function createBaseBuy() {
2255
- return { amount: 0, maxSolCost: 0 };
2306
+ return { amount: 0n, maxSolCost: 0n };
2256
2307
  }
2257
2308
  export const Buy = {
2258
2309
  encode(message, writer = new BinaryWriter()) {
2259
- if (message.amount !== 0) {
2310
+ if (message.amount !== 0n) {
2311
+ if (BigInt.asUintN(64, message.amount) !== message.amount) {
2312
+ throw new globalThis.Error("value provided for field message.amount of type uint64 too large");
2313
+ }
2260
2314
  writer.uint32(8).uint64(message.amount);
2261
2315
  }
2262
- if (message.maxSolCost !== 0) {
2316
+ if (message.maxSolCost !== 0n) {
2317
+ if (BigInt.asUintN(64, message.maxSolCost) !== message.maxSolCost) {
2318
+ throw new globalThis.Error("value provided for field message.maxSolCost of type uint64 too large");
2319
+ }
2263
2320
  writer.uint32(16).uint64(message.maxSolCost);
2264
2321
  }
2265
2322
  return writer;
@@ -2275,14 +2332,14 @@ export const Buy = {
2275
2332
  if (tag !== 8) {
2276
2333
  break;
2277
2334
  }
2278
- message.amount = longToNumber(reader.uint64());
2335
+ message.amount = reader.uint64();
2279
2336
  continue;
2280
2337
  }
2281
2338
  case 2: {
2282
2339
  if (tag !== 16) {
2283
2340
  break;
2284
2341
  }
2285
- message.maxSolCost = longToNumber(reader.uint64());
2342
+ message.maxSolCost = reader.uint64();
2286
2343
  continue;
2287
2344
  }
2288
2345
  }
@@ -2295,21 +2352,21 @@ export const Buy = {
2295
2352
  },
2296
2353
  fromJSON(object) {
2297
2354
  return {
2298
- amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
2355
+ amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
2299
2356
  maxSolCost: isSet(object.maxSolCost)
2300
- ? globalThis.Number(object.maxSolCost)
2357
+ ? BigInt(object.maxSolCost)
2301
2358
  : isSet(object.max_sol_cost)
2302
- ? globalThis.Number(object.max_sol_cost)
2303
- : 0,
2359
+ ? BigInt(object.max_sol_cost)
2360
+ : 0n,
2304
2361
  };
2305
2362
  },
2306
2363
  toJSON(message) {
2307
2364
  const obj = {};
2308
- if (message.amount !== 0) {
2309
- obj.amount = Math.round(message.amount);
2365
+ if (message.amount !== 0n) {
2366
+ obj.amount = message.amount.toString();
2310
2367
  }
2311
- if (message.maxSolCost !== 0) {
2312
- obj.maxSolCost = Math.round(message.maxSolCost);
2368
+ if (message.maxSolCost !== 0n) {
2369
+ obj.maxSolCost = message.maxSolCost.toString();
2313
2370
  }
2314
2371
  return obj;
2315
2372
  },
@@ -2318,20 +2375,26 @@ export const Buy = {
2318
2375
  },
2319
2376
  fromPartial(object) {
2320
2377
  const message = createBaseBuy();
2321
- message.amount = object.amount ?? 0;
2322
- message.maxSolCost = object.maxSolCost ?? 0;
2378
+ message.amount = object.amount ?? 0n;
2379
+ message.maxSolCost = object.maxSolCost ?? 0n;
2323
2380
  return message;
2324
2381
  },
2325
2382
  };
2326
2383
  function createBaseSell() {
2327
- return { amount: 0, minSolOutput: 0 };
2384
+ return { amount: 0n, minSolOutput: 0n };
2328
2385
  }
2329
2386
  export const Sell = {
2330
2387
  encode(message, writer = new BinaryWriter()) {
2331
- if (message.amount !== 0) {
2388
+ if (message.amount !== 0n) {
2389
+ if (BigInt.asUintN(64, message.amount) !== message.amount) {
2390
+ throw new globalThis.Error("value provided for field message.amount of type uint64 too large");
2391
+ }
2332
2392
  writer.uint32(8).uint64(message.amount);
2333
2393
  }
2334
- if (message.minSolOutput !== 0) {
2394
+ if (message.minSolOutput !== 0n) {
2395
+ if (BigInt.asUintN(64, message.minSolOutput) !== message.minSolOutput) {
2396
+ throw new globalThis.Error("value provided for field message.minSolOutput of type uint64 too large");
2397
+ }
2335
2398
  writer.uint32(16).uint64(message.minSolOutput);
2336
2399
  }
2337
2400
  return writer;
@@ -2347,14 +2410,14 @@ export const Sell = {
2347
2410
  if (tag !== 8) {
2348
2411
  break;
2349
2412
  }
2350
- message.amount = longToNumber(reader.uint64());
2413
+ message.amount = reader.uint64();
2351
2414
  continue;
2352
2415
  }
2353
2416
  case 2: {
2354
2417
  if (tag !== 16) {
2355
2418
  break;
2356
2419
  }
2357
- message.minSolOutput = longToNumber(reader.uint64());
2420
+ message.minSolOutput = reader.uint64();
2358
2421
  continue;
2359
2422
  }
2360
2423
  }
@@ -2367,21 +2430,21 @@ export const Sell = {
2367
2430
  },
2368
2431
  fromJSON(object) {
2369
2432
  return {
2370
- amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
2433
+ amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
2371
2434
  minSolOutput: isSet(object.minSolOutput)
2372
- ? globalThis.Number(object.minSolOutput)
2435
+ ? BigInt(object.minSolOutput)
2373
2436
  : isSet(object.min_sol_output)
2374
- ? globalThis.Number(object.min_sol_output)
2375
- : 0,
2437
+ ? BigInt(object.min_sol_output)
2438
+ : 0n,
2376
2439
  };
2377
2440
  },
2378
2441
  toJSON(message) {
2379
2442
  const obj = {};
2380
- if (message.amount !== 0) {
2381
- obj.amount = Math.round(message.amount);
2443
+ if (message.amount !== 0n) {
2444
+ obj.amount = message.amount.toString();
2382
2445
  }
2383
- if (message.minSolOutput !== 0) {
2384
- obj.minSolOutput = Math.round(message.minSolOutput);
2446
+ if (message.minSolOutput !== 0n) {
2447
+ obj.minSolOutput = message.minSolOutput.toString();
2385
2448
  }
2386
2449
  return obj;
2387
2450
  },
@@ -2390,8 +2453,8 @@ export const Sell = {
2390
2453
  },
2391
2454
  fromPartial(object) {
2392
2455
  const message = createBaseSell();
2393
- message.amount = object.amount ?? 0;
2394
- message.minSolOutput = object.minSolOutput ?? 0;
2456
+ message.amount = object.amount ?? 0n;
2457
+ message.minSolOutput = object.minSolOutput ?? 0n;
2395
2458
  return message;
2396
2459
  },
2397
2460
  };
@@ -2435,7 +2498,7 @@ export const Withdraw = {
2435
2498
  function createBaseSubscribeUpdateParsedTransaction() {
2436
2499
  return {
2437
2500
  signature: new Uint8Array(0),
2438
- slot: 0,
2501
+ slot: 0n,
2439
2502
  account: undefined,
2440
2503
  recentBlockhash: new Uint8Array(0),
2441
2504
  signatures: [],
@@ -2447,7 +2510,10 @@ export const SubscribeUpdateParsedTransaction = {
2447
2510
  if (message.signature.length !== 0) {
2448
2511
  writer.uint32(10).bytes(message.signature);
2449
2512
  }
2450
- if (message.slot !== 0) {
2513
+ if (message.slot !== 0n) {
2514
+ if (BigInt.asUintN(64, message.slot) !== message.slot) {
2515
+ throw new globalThis.Error("value provided for field message.slot of type uint64 too large");
2516
+ }
2451
2517
  writer.uint32(16).uint64(message.slot);
2452
2518
  }
2453
2519
  if (message.account !== undefined) {
@@ -2482,7 +2548,7 @@ export const SubscribeUpdateParsedTransaction = {
2482
2548
  if (tag !== 16) {
2483
2549
  break;
2484
2550
  }
2485
- message.slot = longToNumber(reader.uint64());
2551
+ message.slot = reader.uint64();
2486
2552
  continue;
2487
2553
  }
2488
2554
  case 3: {
@@ -2524,7 +2590,7 @@ export const SubscribeUpdateParsedTransaction = {
2524
2590
  fromJSON(object) {
2525
2591
  return {
2526
2592
  signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0),
2527
- slot: isSet(object.slot) ? globalThis.Number(object.slot) : 0,
2593
+ slot: isSet(object.slot) ? BigInt(object.slot) : 0n,
2528
2594
  account: isSet(object.account) ? SubscribeUpdateAccount.fromJSON(object.account) : undefined,
2529
2595
  recentBlockhash: isSet(object.recentBlockhash)
2530
2596
  ? bytesFromBase64(object.recentBlockhash)
@@ -2544,8 +2610,8 @@ export const SubscribeUpdateParsedTransaction = {
2544
2610
  if (message.signature.length !== 0) {
2545
2611
  obj.signature = base64FromBytes(message.signature);
2546
2612
  }
2547
- if (message.slot !== 0) {
2548
- obj.slot = Math.round(message.slot);
2613
+ if (message.slot !== 0n) {
2614
+ obj.slot = message.slot.toString();
2549
2615
  }
2550
2616
  if (message.account !== undefined) {
2551
2617
  obj.account = SubscribeUpdateAccount.toJSON(message.account);
@@ -2567,7 +2633,7 @@ export const SubscribeUpdateParsedTransaction = {
2567
2633
  fromPartial(object) {
2568
2634
  const message = createBaseSubscribeUpdateParsedTransaction();
2569
2635
  message.signature = object.signature ?? new Uint8Array(0);
2570
- message.slot = object.slot ?? 0;
2636
+ message.slot = object.slot ?? 0n;
2571
2637
  message.account = (object.account !== undefined && object.account !== null)
2572
2638
  ? SubscribeUpdateAccount.fromPartial(object.account)
2573
2639
  : undefined;
@@ -2768,11 +2834,14 @@ export const GetVersionResponse = {
2768
2834
  },
2769
2835
  };
2770
2836
  function createBaseGetSlotResponse() {
2771
- return { slot: 0 };
2837
+ return { slot: 0n };
2772
2838
  }
2773
2839
  export const GetSlotResponse = {
2774
2840
  encode(message, writer = new BinaryWriter()) {
2775
- if (message.slot !== 0) {
2841
+ if (message.slot !== 0n) {
2842
+ if (BigInt.asUintN(64, message.slot) !== message.slot) {
2843
+ throw new globalThis.Error("value provided for field message.slot of type uint64 too large");
2844
+ }
2776
2845
  writer.uint32(8).uint64(message.slot);
2777
2846
  }
2778
2847
  return writer;
@@ -2788,7 +2857,7 @@ export const GetSlotResponse = {
2788
2857
  if (tag !== 8) {
2789
2858
  break;
2790
2859
  }
2791
- message.slot = longToNumber(reader.uint64());
2860
+ message.slot = reader.uint64();
2792
2861
  continue;
2793
2862
  }
2794
2863
  }
@@ -2800,12 +2869,12 @@ export const GetSlotResponse = {
2800
2869
  return message;
2801
2870
  },
2802
2871
  fromJSON(object) {
2803
- return { slot: isSet(object.slot) ? globalThis.Number(object.slot) : 0 };
2872
+ return { slot: isSet(object.slot) ? BigInt(object.slot) : 0n };
2804
2873
  },
2805
2874
  toJSON(message) {
2806
2875
  const obj = {};
2807
- if (message.slot !== 0) {
2808
- obj.slot = Math.round(message.slot);
2876
+ if (message.slot !== 0n) {
2877
+ obj.slot = message.slot.toString();
2809
2878
  }
2810
2879
  return obj;
2811
2880
  },
@@ -2814,7 +2883,7 @@ export const GetSlotResponse = {
2814
2883
  },
2815
2884
  fromPartial(object) {
2816
2885
  const message = createBaseGetSlotResponse();
2817
- message.slot = object.slot ?? 0;
2886
+ message.slot = object.slot ?? 0n;
2818
2887
  return message;
2819
2888
  },
2820
2889
  };
@@ -2829,7 +2898,7 @@ export const JetstreamService = {
2829
2898
  responseSerialize: (value) => Buffer.from(SubscribeUpdate.encode(value).finish()),
2830
2899
  responseDeserialize: (value) => SubscribeUpdate.decode(value),
2831
2900
  },
2832
- /** Subscribe to data streams with filtering support and parsed instructions */
2901
+ /** Not implemented. */
2833
2902
  subscribeParsed: {
2834
2903
  path: "/jetstream.Jetstream/SubscribeParsed",
2835
2904
  requestStream: true,
@@ -2887,12 +2956,12 @@ function base64FromBytes(arr) {
2887
2956
  }
2888
2957
  }
2889
2958
  function toTimestamp(date) {
2890
- const seconds = Math.trunc(date.getTime() / 1_000);
2959
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
2891
2960
  const nanos = (date.getTime() % 1_000) * 1_000_000;
2892
2961
  return { seconds, nanos };
2893
2962
  }
2894
2963
  function fromTimestamp(t) {
2895
- let millis = (t.seconds || 0) * 1_000;
2964
+ let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;
2896
2965
  millis += (t.nanos || 0) / 1_000_000;
2897
2966
  return new globalThis.Date(millis);
2898
2967
  }
@@ -2907,16 +2976,6 @@ function fromJsonTimestamp(o) {
2907
2976
  return fromTimestamp(Timestamp.fromJSON(o));
2908
2977
  }
2909
2978
  }
2910
- function longToNumber(int64) {
2911
- const num = globalThis.Number(int64.toString());
2912
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
2913
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2914
- }
2915
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
2916
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
2917
- }
2918
- return num;
2919
- }
2920
2979
  function isObject(value) {
2921
2980
  return typeof value === "object" && value !== null;
2922
2981
  }