@solana/web3.js 2.0.0-experimental.b927e84 → 2.0.0-experimental.bac4a66

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.
@@ -12,8 +12,8 @@ this.globalThis.solanaWeb3 = (function (exports) {
12
12
  var __esm = (fn, res) => function __init() {
13
13
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
14
  };
15
- var __commonJS = (cb, mod) => function __require() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ var __commonJS = (cb, mod2) => function __require() {
16
+ return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
17
17
  };
18
18
  var __copyProps = (to, from, except, desc) => {
19
19
  if (from && typeof from === "object" || typeof from === "function") {
@@ -23,13 +23,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
23
23
  }
24
24
  return to;
25
25
  };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
27
27
  // If the importer is in node compatibility mode or this is not an ESM
28
28
  // file that has been converted to a CommonJS file using a Babel-
29
29
  // compatible transform (i.e. "__esModule" has not been set), then set
30
30
  // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
31
+ isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
32
+ mod2
33
33
  ));
34
34
  var __publicField = (obj, key, value) => {
35
35
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -122,44 +122,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
122
122
  // src/index.ts
123
123
  init_env_shim();
124
124
 
125
- // ../instructions/dist/index.browser.js
126
- init_env_shim();
127
- var AccountRole = /* @__PURE__ */ ((AccountRole22) => {
128
- AccountRole22[AccountRole22["WRITABLE_SIGNER"] = /* 3 */
129
- 3] = "WRITABLE_SIGNER";
130
- AccountRole22[AccountRole22["READONLY_SIGNER"] = /* 2 */
131
- 2] = "READONLY_SIGNER";
132
- AccountRole22[AccountRole22["WRITABLE"] = /* 1 */
133
- 1] = "WRITABLE";
134
- AccountRole22[AccountRole22["READONLY"] = /* 0 */
135
- 0] = "READONLY";
136
- return AccountRole22;
137
- })(AccountRole || {});
138
- var IS_SIGNER_BITMASK = 2;
139
- var IS_WRITABLE_BITMASK = 1;
140
- function downgradeRoleToNonSigner(role) {
141
- return role & ~IS_SIGNER_BITMASK;
142
- }
143
- function downgradeRoleToReadonly(role) {
144
- return role & ~IS_WRITABLE_BITMASK;
145
- }
146
- function isSignerRole(role) {
147
- return role >= 2;
148
- }
149
- function isWritableRole(role) {
150
- return (role & IS_WRITABLE_BITMASK) !== 0;
151
- }
152
- function mergeRoles(roleA, roleB) {
153
- return roleA | roleB;
154
- }
155
- function upgradeRoleToSigner(role) {
156
- return role | IS_SIGNER_BITMASK;
157
- }
158
- function upgradeRoleToWritable(role) {
159
- return role | IS_WRITABLE_BITMASK;
160
- }
161
-
162
- // ../keys/dist/index.browser.js
125
+ // ../addresses/dist/index.browser.js
163
126
  init_env_shim();
164
127
 
165
128
  // ../../node_modules/.pnpm/@metaplex-foundation+umi-serializers@0.8.5/node_modules/@metaplex-foundation/umi-serializers/dist/esm/index.mjs
@@ -685,43 +648,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
685
648
  }
686
649
  };
687
650
  }
688
- function assertIsBase58EncodedAddress(putativeBase58EncodedAddress) {
689
- try {
690
- if (
691
- // Lowest address (32 bytes of zeroes)
692
- putativeBase58EncodedAddress.length < 32 || // Highest address (32 bytes of 255)
693
- putativeBase58EncodedAddress.length > 44
694
- ) {
695
- throw new Error("Expected input string to decode to a byte array of length 32.");
696
- }
697
- const bytes2 = base58.serialize(putativeBase58EncodedAddress);
698
- const numBytes = bytes2.byteLength;
699
- if (numBytes !== 32) {
700
- throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);
701
- }
702
- } catch (e2) {
703
- throw new Error(`\`${putativeBase58EncodedAddress}\` is not a base-58 encoded address`, {
704
- cause: e2
705
- });
706
- }
707
- }
708
- function getBase58EncodedAddressCodec(config) {
709
- return string({
710
- description: config?.description ?? ("A 32-byte account address" ),
711
- encoding: base58,
712
- size: 32
713
- });
714
- }
715
- function getBase58EncodedAddressComparator() {
716
- return new Intl.Collator("en", {
717
- caseFirst: "lower",
718
- ignorePunctuation: false,
719
- localeMatcher: "best fit",
720
- numeric: false,
721
- sensitivity: "variant",
722
- usage: "sort"
723
- }).compare;
724
- }
651
+
652
+ // ../assertions/dist/index.browser.js
653
+ init_env_shim();
725
654
  function assertIsSecureContext() {
726
655
  if (!globalThis.isSecureContext) {
727
656
  throw new Error(
@@ -751,6 +680,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
751
680
  return await cachedEd25519Decision;
752
681
  }
753
682
  }
683
+ async function assertDigestCapabilityIsAvailable() {
684
+ assertIsSecureContext();
685
+ if (typeof globalThis.crypto === "undefined" || typeof globalThis.crypto.subtle?.digest !== "function") {
686
+ throw new Error("No digest implementation could be found");
687
+ }
688
+ }
754
689
  async function assertKeyGenerationIsAvailable() {
755
690
  assertIsSecureContext();
756
691
  if (typeof globalThis.crypto === "undefined" || typeof globalThis.crypto.subtle?.generateKey !== "function") {
@@ -780,6 +715,253 @@ this.globalThis.solanaWeb3 = (function (exports) {
780
715
  throw new Error("No signature verification implementation could be found");
781
716
  }
782
717
  }
718
+ function assertIsBase58EncodedAddress(putativeBase58EncodedAddress) {
719
+ try {
720
+ if (
721
+ // Lowest address (32 bytes of zeroes)
722
+ putativeBase58EncodedAddress.length < 32 || // Highest address (32 bytes of 255)
723
+ putativeBase58EncodedAddress.length > 44
724
+ ) {
725
+ throw new Error("Expected input string to decode to a byte array of length 32.");
726
+ }
727
+ const bytes2 = base58.serialize(putativeBase58EncodedAddress);
728
+ const numBytes = bytes2.byteLength;
729
+ if (numBytes !== 32) {
730
+ throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);
731
+ }
732
+ } catch (e2) {
733
+ throw new Error(`\`${putativeBase58EncodedAddress}\` is not a base-58 encoded address`, {
734
+ cause: e2
735
+ });
736
+ }
737
+ }
738
+ function getBase58EncodedAddressCodec(config) {
739
+ return string({
740
+ description: config?.description ?? ("A 32-byte account address" ),
741
+ encoding: base58,
742
+ size: 32
743
+ });
744
+ }
745
+ function getBase58EncodedAddressComparator() {
746
+ return new Intl.Collator("en", {
747
+ caseFirst: "lower",
748
+ ignorePunctuation: false,
749
+ localeMatcher: "best fit",
750
+ numeric: false,
751
+ sensitivity: "variant",
752
+ usage: "sort"
753
+ }).compare;
754
+ }
755
+ var D = 37095705934669439343138083508754565189542113879843219016388785533085940283555n;
756
+ var P = 57896044618658097711785492504343953926634992332820282019728792003956564819949n;
757
+ var RM1 = 19681161376707505956807079304988542015446066515923890162744021073123829784752n;
758
+ function mod(a) {
759
+ const r = a % P;
760
+ return r >= 0n ? r : P + r;
761
+ }
762
+ function pow2(x, power) {
763
+ let r = x;
764
+ while (power-- > 0n) {
765
+ r *= r;
766
+ r %= P;
767
+ }
768
+ return r;
769
+ }
770
+ function pow_2_252_3(x) {
771
+ const x2 = x * x % P;
772
+ const b2 = x2 * x % P;
773
+ const b4 = pow2(b2, 2n) * b2 % P;
774
+ const b5 = pow2(b4, 1n) * x % P;
775
+ const b10 = pow2(b5, 5n) * b5 % P;
776
+ const b20 = pow2(b10, 10n) * b10 % P;
777
+ const b40 = pow2(b20, 20n) * b20 % P;
778
+ const b80 = pow2(b40, 40n) * b40 % P;
779
+ const b160 = pow2(b80, 80n) * b80 % P;
780
+ const b240 = pow2(b160, 80n) * b80 % P;
781
+ const b250 = pow2(b240, 10n) * b10 % P;
782
+ const pow_p_5_8 = pow2(b250, 2n) * x % P;
783
+ return pow_p_5_8;
784
+ }
785
+ function uvRatio(u, v) {
786
+ const v3 = mod(v * v * v);
787
+ const v7 = mod(v3 * v3 * v);
788
+ const pow = pow_2_252_3(u * v7);
789
+ let x = mod(u * v3 * pow);
790
+ const vx2 = mod(v * x * x);
791
+ const root1 = x;
792
+ const root2 = mod(x * RM1);
793
+ const useRoot1 = vx2 === u;
794
+ const useRoot2 = vx2 === mod(-u);
795
+ const noRoot = vx2 === mod(-u * RM1);
796
+ if (useRoot1)
797
+ x = root1;
798
+ if (useRoot2 || noRoot)
799
+ x = root2;
800
+ if ((mod(x) & 1n) === 1n)
801
+ x = mod(-x);
802
+ if (!useRoot1 && !useRoot2) {
803
+ return null;
804
+ }
805
+ return x;
806
+ }
807
+ function pointIsOnCurve(y, lastByte) {
808
+ const y2 = mod(y * y);
809
+ const u = mod(y2 - 1n);
810
+ const v = mod(D * y2 + 1n);
811
+ const x = uvRatio(u, v);
812
+ if (x === null) {
813
+ return false;
814
+ }
815
+ const isLastByteOdd = (lastByte & 128) !== 0;
816
+ if (x === 0n && isLastByteOdd) {
817
+ return false;
818
+ }
819
+ return true;
820
+ }
821
+ function byteToHex(byte) {
822
+ const hexString = byte.toString(16);
823
+ if (hexString.length === 1) {
824
+ return `0${hexString}`;
825
+ } else {
826
+ return hexString;
827
+ }
828
+ }
829
+ function decompressPointBytes(bytes2) {
830
+ const hexString = bytes2.reduce((acc, byte, ii) => `${byteToHex(ii === 31 ? byte & ~128 : byte)}${acc}`, "");
831
+ const integerLiteralString = `0x${hexString}`;
832
+ return BigInt(integerLiteralString);
833
+ }
834
+ async function compressedPointBytesAreOnCurve(bytes2) {
835
+ if (bytes2.byteLength !== 32) {
836
+ return false;
837
+ }
838
+ const y = decompressPointBytes(bytes2);
839
+ return pointIsOnCurve(y, bytes2[31]);
840
+ }
841
+ var MAX_SEED_LENGTH = 32;
842
+ var MAX_SEEDS = 16;
843
+ var PDA_MARKER_BYTES = [
844
+ // The string 'ProgramDerivedAddress'
845
+ 80,
846
+ 114,
847
+ 111,
848
+ 103,
849
+ 114,
850
+ 97,
851
+ 109,
852
+ 68,
853
+ 101,
854
+ 114,
855
+ 105,
856
+ 118,
857
+ 101,
858
+ 100,
859
+ 65,
860
+ 100,
861
+ 100,
862
+ 114,
863
+ 101,
864
+ 115,
865
+ 115
866
+ ];
867
+ var PointOnCurveError = class extends Error {
868
+ };
869
+ async function createProgramDerivedAddress({ programAddress, seeds }) {
870
+ await assertDigestCapabilityIsAvailable();
871
+ if (seeds.length > MAX_SEEDS) {
872
+ throw new Error(`A maximum of ${MAX_SEEDS} seeds may be supplied when creating an address`);
873
+ }
874
+ let textEncoder;
875
+ const seedBytes = seeds.reduce((acc, seed, ii) => {
876
+ const bytes2 = typeof seed === "string" ? (textEncoder || (textEncoder = new TextEncoder())).encode(seed) : seed;
877
+ if (bytes2.byteLength > MAX_SEED_LENGTH) {
878
+ throw new Error(`The seed at index ${ii} exceeds the maximum length of 32 bytes`);
879
+ }
880
+ acc.push(...bytes2);
881
+ return acc;
882
+ }, []);
883
+ const base58EncodedAddressCodec = getBase58EncodedAddressCodec();
884
+ const programAddressBytes = base58EncodedAddressCodec.serialize(programAddress);
885
+ const addressBytesBuffer = await crypto.subtle.digest(
886
+ "SHA-256",
887
+ new Uint8Array([...seedBytes, ...programAddressBytes, ...PDA_MARKER_BYTES])
888
+ );
889
+ const addressBytes = new Uint8Array(addressBytesBuffer);
890
+ if (await compressedPointBytesAreOnCurve(addressBytes)) {
891
+ throw new PointOnCurveError("Invalid seeds; point must fall off the Ed25519 curve");
892
+ }
893
+ return base58EncodedAddressCodec.deserialize(addressBytes)[0];
894
+ }
895
+ async function getProgramDerivedAddress({ programAddress, seeds }) {
896
+ let bumpSeed = 255;
897
+ while (bumpSeed > 0) {
898
+ try {
899
+ return {
900
+ bumpSeed,
901
+ pda: await createProgramDerivedAddress({
902
+ programAddress,
903
+ seeds: [...seeds, new Uint8Array([bumpSeed])]
904
+ })
905
+ };
906
+ } catch (e2) {
907
+ if (e2 instanceof PointOnCurveError) {
908
+ bumpSeed--;
909
+ } else {
910
+ throw e2;
911
+ }
912
+ }
913
+ }
914
+ throw new Error("Unable to find a viable program address bump seed");
915
+ }
916
+ async function getAddressFromPublicKey(publicKey) {
917
+ await assertKeyExporterIsAvailable();
918
+ if (publicKey.type !== "public" || publicKey.algorithm.name !== "Ed25519") {
919
+ throw new Error("The `CryptoKey` must be an `Ed25519` public key");
920
+ }
921
+ const publicKeyBytes = await crypto.subtle.exportKey("raw", publicKey);
922
+ const [base58EncodedAddress] = getBase58EncodedAddressCodec().deserialize(new Uint8Array(publicKeyBytes));
923
+ return base58EncodedAddress;
924
+ }
925
+
926
+ // ../instructions/dist/index.browser.js
927
+ init_env_shim();
928
+ var AccountRole = /* @__PURE__ */ ((AccountRole22) => {
929
+ AccountRole22[AccountRole22["WRITABLE_SIGNER"] = /* 3 */
930
+ 3] = "WRITABLE_SIGNER";
931
+ AccountRole22[AccountRole22["READONLY_SIGNER"] = /* 2 */
932
+ 2] = "READONLY_SIGNER";
933
+ AccountRole22[AccountRole22["WRITABLE"] = /* 1 */
934
+ 1] = "WRITABLE";
935
+ AccountRole22[AccountRole22["READONLY"] = /* 0 */
936
+ 0] = "READONLY";
937
+ return AccountRole22;
938
+ })(AccountRole || {});
939
+ var IS_SIGNER_BITMASK = 2;
940
+ var IS_WRITABLE_BITMASK = 1;
941
+ function downgradeRoleToNonSigner(role) {
942
+ return role & ~IS_SIGNER_BITMASK;
943
+ }
944
+ function downgradeRoleToReadonly(role) {
945
+ return role & ~IS_WRITABLE_BITMASK;
946
+ }
947
+ function isSignerRole(role) {
948
+ return role >= 2;
949
+ }
950
+ function isWritableRole(role) {
951
+ return (role & IS_WRITABLE_BITMASK) !== 0;
952
+ }
953
+ function mergeRoles(roleA, roleB) {
954
+ return roleA | roleB;
955
+ }
956
+ function upgradeRoleToSigner(role) {
957
+ return role | IS_SIGNER_BITMASK;
958
+ }
959
+ function upgradeRoleToWritable(role) {
960
+ return role | IS_WRITABLE_BITMASK;
961
+ }
962
+
963
+ // ../keys/dist/index.browser.js
964
+ init_env_shim();
783
965
  async function generateKeyPair() {
784
966
  await assertKeyGenerationIsAvailable();
785
967
  const keyPair = await crypto.subtle.generateKey(
@@ -794,15 +976,6 @@ this.globalThis.solanaWeb3 = (function (exports) {
794
976
  );
795
977
  return keyPair;
796
978
  }
797
- async function getBase58EncodedAddressFromPublicKey(publicKey) {
798
- await assertKeyExporterIsAvailable();
799
- if (publicKey.type !== "public" || publicKey.algorithm.name !== "Ed25519") {
800
- throw new Error("The `CryptoKey` must be an `Ed25519` public key");
801
- }
802
- const publicKeyBytes = await crypto.subtle.exportKey("raw", publicKey);
803
- const [base58EncodedAddress] = getBase58EncodedAddressCodec().deserialize(new Uint8Array(publicKeyBytes));
804
- return base58EncodedAddress;
805
- }
806
979
  async function signBytes(key, data) {
807
980
  await assertSigningCapabilityIsAvailable();
808
981
  const signedData = await crypto.subtle.sign("Ed25519", key, data);
@@ -1311,7 +1484,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
1311
1484
  )
1312
1485
  ],
1313
1486
  [
1314
- "addressIndices",
1487
+ "accountIndices",
1315
1488
  array(
1316
1489
  u8({
1317
1490
  description: "The index of an account, according to the well-ordered accounts list for this transaction"
@@ -1331,23 +1504,23 @@ this.globalThis.solanaWeb3 = (function (exports) {
1331
1504
  ]
1332
1505
  ]),
1333
1506
  (value) => {
1334
- if (value.addressIndices !== void 0 && value.data !== void 0) {
1507
+ if (value.accountIndices !== void 0 && value.data !== void 0) {
1335
1508
  return value;
1336
1509
  }
1337
1510
  return {
1338
1511
  ...value,
1339
- addressIndices: value.addressIndices ?? [],
1512
+ accountIndices: value.accountIndices ?? [],
1340
1513
  data: value.data ?? new Uint8Array(0)
1341
1514
  };
1342
1515
  },
1343
1516
  (value) => {
1344
- if (value.addressIndices.length && value.data.byteLength) {
1517
+ if (value.accountIndices.length && value.data.byteLength) {
1345
1518
  return value;
1346
1519
  }
1347
- const { addressIndices, data, ...rest } = value;
1520
+ const { accountIndices, data, ...rest } = value;
1348
1521
  return {
1349
1522
  ...rest,
1350
- ...addressIndices.length ? { addressIndices } : null,
1523
+ ...accountIndices.length ? { accountIndices } : null,
1351
1524
  ...data.byteLength ? { data } : null
1352
1525
  };
1353
1526
  }
@@ -1470,7 +1643,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
1470
1643
  async function signTransaction(keyPair, transaction) {
1471
1644
  const compiledMessage = compileMessage(transaction);
1472
1645
  const [signerPublicKey, signature] = await Promise.all([
1473
- getBase58EncodedAddressFromPublicKey(keyPair.publicKey),
1646
+ getAddressFromPublicKey(keyPair.publicKey),
1474
1647
  getCompiledMessageSignature(compiledMessage, keyPair.privateKey)
1475
1648
  ]);
1476
1649
  const nextSignatures = {
@@ -1574,7 +1747,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
1574
1747
  ["value", "data", "parsed", "info", "tokenAmount", "decimals"],
1575
1748
  ["value", "data", "parsed", "info", "tokenAmount", "uiAmount"],
1576
1749
  ["value", "data", "parsed", "info", "rentExemptReserve", "decimals"],
1750
+ ["value", "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
1577
1751
  ["value", "data", "parsed", "info", "delegatedAmount", "decimals"],
1752
+ ["value", "data", "parsed", "info", "delegatedAmount", "uiAmount"],
1578
1753
  [
1579
1754
  "value",
1580
1755
  "data",
@@ -1614,12 +1789,347 @@ this.globalThis.solanaWeb3 = (function (exports) {
1614
1789
  ["value", "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"]
1615
1790
  ],
1616
1791
  getBlockTime: [[]],
1792
+ getClusterNodes: [
1793
+ [KEYPATH_WILDCARD, "featureSet"],
1794
+ [KEYPATH_WILDCARD, "shredVersion"]
1795
+ ],
1796
+ getInflationGovernor: [["initial"], ["foundation"], ["foundationTerm"], ["taper"], ["terminal"]],
1797
+ getInflationRate: [["foundation"], ["total"], ["validator"]],
1617
1798
  getInflationReward: [[KEYPATH_WILDCARD, "commission"]],
1799
+ getMultipleAccounts: [
1800
+ // parsed AddressTableLookup account
1801
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "lastExtendedSlotStartIndex"],
1802
+ // parsed Config account
1803
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "slashPenalty"],
1804
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "warmupCooldownRate"],
1805
+ // parsed Token/Token22 token account
1806
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "tokenAmount", "decimals"],
1807
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "tokenAmount", "uiAmount"],
1808
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "rentExemptReserve", "decimals"],
1809
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
1810
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "delegatedAmount", "decimals"],
1811
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "delegatedAmount", "uiAmount"],
1812
+ [
1813
+ "value",
1814
+ KEYPATH_WILDCARD,
1815
+ "data",
1816
+ "parsed",
1817
+ "info",
1818
+ "extensions",
1819
+ KEYPATH_WILDCARD,
1820
+ "state",
1821
+ "olderTransferFee",
1822
+ "transferFeeBasisPoints"
1823
+ ],
1824
+ [
1825
+ "value",
1826
+ KEYPATH_WILDCARD,
1827
+ "data",
1828
+ "parsed",
1829
+ "info",
1830
+ "extensions",
1831
+ KEYPATH_WILDCARD,
1832
+ "state",
1833
+ "newerTransferFee",
1834
+ "transferFeeBasisPoints"
1835
+ ],
1836
+ [
1837
+ "value",
1838
+ KEYPATH_WILDCARD,
1839
+ "data",
1840
+ "parsed",
1841
+ "info",
1842
+ "extensions",
1843
+ KEYPATH_WILDCARD,
1844
+ "state",
1845
+ "preUpdateAverageRate"
1846
+ ],
1847
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "currentRate"],
1848
+ // parsed Token/Token22 mint account
1849
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "decimals"],
1850
+ // parsed Token/Token22 multisig account
1851
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "numRequiredSigners"],
1852
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "numValidSigners"],
1853
+ // parsed Stake account
1854
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"],
1855
+ // parsed Sysvar rent account
1856
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "exemptionThreshold"],
1857
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "burnPercent"],
1858
+ // parsed Vote account
1859
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "commission"],
1860
+ ["value", KEYPATH_WILDCARD, "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"]
1861
+ ],
1862
+ getProgramAccounts: [
1863
+ // parsed AddressTableLookup account
1864
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "lastExtendedSlotStartIndex"],
1865
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "lastExtendedSlotStartIndex"],
1866
+ // parsed Config account
1867
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "slashPenalty"],
1868
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "slashPenalty"],
1869
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "warmupCooldownRate"],
1870
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "warmupCooldownRate"],
1871
+ // parsed Token/Token22 token account
1872
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "decimals"],
1873
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "decimals"],
1874
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "uiAmount"],
1875
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "uiAmount"],
1876
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "decimals"],
1877
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "decimals"],
1878
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
1879
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
1880
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "decimals"],
1881
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "decimals"],
1882
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "uiAmount"],
1883
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "uiAmount"],
1884
+ [
1885
+ KEYPATH_WILDCARD,
1886
+ "account",
1887
+ "data",
1888
+ "parsed",
1889
+ "info",
1890
+ "extensions",
1891
+ KEYPATH_WILDCARD,
1892
+ "state",
1893
+ "olderTransferFee",
1894
+ "transferFeeBasisPoints"
1895
+ ],
1896
+ [
1897
+ "value",
1898
+ KEYPATH_WILDCARD,
1899
+ "account",
1900
+ "data",
1901
+ "parsed",
1902
+ "info",
1903
+ "extensions",
1904
+ KEYPATH_WILDCARD,
1905
+ "state",
1906
+ "olderTransferFee",
1907
+ "transferFeeBasisPoints"
1908
+ ],
1909
+ [
1910
+ KEYPATH_WILDCARD,
1911
+ "account",
1912
+ "data",
1913
+ "parsed",
1914
+ "info",
1915
+ "extensions",
1916
+ KEYPATH_WILDCARD,
1917
+ "state",
1918
+ "newerTransferFee",
1919
+ "transferFeeBasisPoints"
1920
+ ],
1921
+ [
1922
+ "value",
1923
+ KEYPATH_WILDCARD,
1924
+ "account",
1925
+ "data",
1926
+ "parsed",
1927
+ "info",
1928
+ "extensions",
1929
+ KEYPATH_WILDCARD,
1930
+ "state",
1931
+ "newerTransferFee",
1932
+ "transferFeeBasisPoints"
1933
+ ],
1934
+ [
1935
+ KEYPATH_WILDCARD,
1936
+ "account",
1937
+ "data",
1938
+ "parsed",
1939
+ "info",
1940
+ "extensions",
1941
+ KEYPATH_WILDCARD,
1942
+ "state",
1943
+ "preUpdateAverageRate"
1944
+ ],
1945
+ [
1946
+ "value",
1947
+ KEYPATH_WILDCARD,
1948
+ "account",
1949
+ "data",
1950
+ "parsed",
1951
+ "info",
1952
+ "extensions",
1953
+ KEYPATH_WILDCARD,
1954
+ "state",
1955
+ "preUpdateAverageRate"
1956
+ ],
1957
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "currentRate"],
1958
+ [
1959
+ "value",
1960
+ KEYPATH_WILDCARD,
1961
+ "account",
1962
+ "data",
1963
+ "parsed",
1964
+ "info",
1965
+ "extensions",
1966
+ KEYPATH_WILDCARD,
1967
+ "state",
1968
+ "currentRate"
1969
+ ],
1970
+ // parsed Token/Token22 mint account
1971
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "decimals"],
1972
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "decimals"],
1973
+ // parsed Token/Token22 multisig account
1974
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "numRequiredSigners"],
1975
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "numRequiredSigners"],
1976
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "numValidSigners"],
1977
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "numValidSigners"],
1978
+ // parsed Stake account
1979
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"],
1980
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"],
1981
+ // parsed Sysvar rent account
1982
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "exemptionThreshold"],
1983
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "exemptionThreshold"],
1984
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "burnPercent"],
1985
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "burnPercent"],
1986
+ // parsed Vote account
1987
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "commission"],
1988
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "commission"],
1989
+ [KEYPATH_WILDCARD, "account", "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"],
1990
+ [
1991
+ "value",
1992
+ KEYPATH_WILDCARD,
1993
+ "account",
1994
+ "data",
1995
+ "parsed",
1996
+ "info",
1997
+ "votes",
1998
+ KEYPATH_WILDCARD,
1999
+ "confirmationCount"
2000
+ ]
2001
+ ],
1618
2002
  getRecentPerformanceSamples: [[KEYPATH_WILDCARD, "samplePeriodSecs"]],
2003
+ getTokenAccountBalance: [
2004
+ ["value", "decimals"],
2005
+ ["value", "uiAmount"]
2006
+ ],
2007
+ getTokenAccountsByDelegate: [
2008
+ // parsed Token/Token22 token account
2009
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "decimals"],
2010
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "uiAmount"],
2011
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "decimals"],
2012
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
2013
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "decimals"],
2014
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "uiAmount"],
2015
+ [
2016
+ "value",
2017
+ KEYPATH_WILDCARD,
2018
+ "account",
2019
+ "data",
2020
+ "parsed",
2021
+ "info",
2022
+ "extensions",
2023
+ KEYPATH_WILDCARD,
2024
+ "state",
2025
+ "olderTransferFee",
2026
+ "transferFeeBasisPoints"
2027
+ ],
2028
+ [
2029
+ "value",
2030
+ KEYPATH_WILDCARD,
2031
+ "account",
2032
+ "data",
2033
+ "parsed",
2034
+ "info",
2035
+ "extensions",
2036
+ KEYPATH_WILDCARD,
2037
+ "state",
2038
+ "newerTransferFee",
2039
+ "transferFeeBasisPoints"
2040
+ ],
2041
+ [
2042
+ "value",
2043
+ KEYPATH_WILDCARD,
2044
+ "account",
2045
+ "data",
2046
+ "parsed",
2047
+ "info",
2048
+ "extensions",
2049
+ KEYPATH_WILDCARD,
2050
+ "state",
2051
+ "preUpdateAverageRate"
2052
+ ],
2053
+ [
2054
+ "value",
2055
+ KEYPATH_WILDCARD,
2056
+ "account",
2057
+ "data",
2058
+ "parsed",
2059
+ "info",
2060
+ "extensions",
2061
+ KEYPATH_WILDCARD,
2062
+ "state",
2063
+ "currentRate"
2064
+ ]
2065
+ ],
2066
+ getTokenAccountsByOwner: [
2067
+ // parsed Token/Token22 token account
2068
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "decimals"],
2069
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "tokenAmount", "uiAmount"],
2070
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "decimals"],
2071
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "rentExemptReserve", "uiAmount"],
2072
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "decimals"],
2073
+ ["value", KEYPATH_WILDCARD, "account", "data", "parsed", "info", "delegatedAmount", "uiAmount"],
2074
+ [
2075
+ "value",
2076
+ KEYPATH_WILDCARD,
2077
+ "account",
2078
+ "data",
2079
+ "parsed",
2080
+ "info",
2081
+ "extensions",
2082
+ KEYPATH_WILDCARD,
2083
+ "state",
2084
+ "olderTransferFee",
2085
+ "transferFeeBasisPoints"
2086
+ ],
2087
+ [
2088
+ "value",
2089
+ KEYPATH_WILDCARD,
2090
+ "account",
2091
+ "data",
2092
+ "parsed",
2093
+ "info",
2094
+ "extensions",
2095
+ KEYPATH_WILDCARD,
2096
+ "state",
2097
+ "newerTransferFee",
2098
+ "transferFeeBasisPoints"
2099
+ ],
2100
+ [
2101
+ "value",
2102
+ KEYPATH_WILDCARD,
2103
+ "account",
2104
+ "data",
2105
+ "parsed",
2106
+ "info",
2107
+ "extensions",
2108
+ KEYPATH_WILDCARD,
2109
+ "state",
2110
+ "preUpdateAverageRate"
2111
+ ],
2112
+ [
2113
+ "value",
2114
+ KEYPATH_WILDCARD,
2115
+ "account",
2116
+ "data",
2117
+ "parsed",
2118
+ "info",
2119
+ "extensions",
2120
+ KEYPATH_WILDCARD,
2121
+ "state",
2122
+ "currentRate"
2123
+ ]
2124
+ ],
1619
2125
  getTokenLargestAccounts: [
1620
2126
  ["value", KEYPATH_WILDCARD, "decimals"],
1621
2127
  ["value", KEYPATH_WILDCARD, "uiAmount"]
1622
2128
  ],
2129
+ getTokenSupply: [
2130
+ ["value", "decimals"],
2131
+ ["value", "uiAmount"]
2132
+ ],
1623
2133
  getTransaction: [
1624
2134
  ["meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"],
1625
2135
  ["meta", "preTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"],
@@ -1637,6 +2147,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
1637
2147
  ["transaction", "message", "header", "numReadonlyUnsignedAccounts"],
1638
2148
  ["transaction", "message", "header", "numRequiredSignatures"]
1639
2149
  ],
2150
+ getVersion: [["feature-set"]],
1640
2151
  getVoteAccounts: [
1641
2152
  ["current", KEYPATH_WILDCARD, "commission"],
1642
2153
  ["delinquent", KEYPATH_WILDCARD, "commission"]
@@ -2013,10 +2524,11 @@ this.globalThis.solanaWeb3 = (function (exports) {
2013
2524
  exports.downgradeRoleToNonSigner = downgradeRoleToNonSigner;
2014
2525
  exports.downgradeRoleToReadonly = downgradeRoleToReadonly;
2015
2526
  exports.generateKeyPair = generateKeyPair;
2527
+ exports.getAddressFromPublicKey = getAddressFromPublicKey;
2016
2528
  exports.getBase58EncodedAddressCodec = getBase58EncodedAddressCodec;
2017
2529
  exports.getBase58EncodedAddressComparator = getBase58EncodedAddressComparator;
2018
- exports.getBase58EncodedAddressFromPublicKey = getBase58EncodedAddressFromPublicKey;
2019
2530
  exports.getBase64EncodedWireTransaction = getBase64EncodedWireTransaction;
2531
+ exports.getProgramDerivedAddress = getProgramDerivedAddress;
2020
2532
  exports.isSignerRole = isSignerRole;
2021
2533
  exports.isWritableRole = isWritableRole;
2022
2534
  exports.mergeRoles = mergeRoles;