@solana/web3.js 1.93.4 → 1.95.0
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/lib/index.browser.cjs.js +22 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +22 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +22 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.esm.js +22 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +143 -150
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +7 -7
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +22 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/connection.ts +46 -0
- package/src/validator-info.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/web3.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.95.0",
|
|
4
4
|
"description": "Solana Javascript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@babel/runtime": "^7.24.7",
|
|
59
|
-
"@noble/curves": "^1.4.
|
|
59
|
+
"@noble/curves": "^1.4.2",
|
|
60
60
|
"@noble/hashes": "^1.4.0",
|
|
61
61
|
"@solana/buffer-layout": "^4.0.1",
|
|
62
62
|
"agentkeepalive": "^4.5.0",
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"jayson": "^4.1.0",
|
|
70
70
|
"node-fetch": "^2.7.0",
|
|
71
71
|
"rpc-websockets": "^9.0.2",
|
|
72
|
-
"superstruct": "^
|
|
72
|
+
"superstruct": "^2.0.2"
|
|
73
73
|
}
|
|
74
74
|
}
|
package/src/connection.ts
CHANGED
|
@@ -952,6 +952,8 @@ export type SimulateTransactionConfig = {
|
|
|
952
952
|
};
|
|
953
953
|
/** Optional parameter used to specify the minimum block slot that can be used for simulation */
|
|
954
954
|
minContextSlot?: number;
|
|
955
|
+
/** Optional parameter used to include inner instructions in the simulation */
|
|
956
|
+
innerInstructions?: boolean;
|
|
955
957
|
};
|
|
956
958
|
|
|
957
959
|
export type SimulatedTransactionResponse = {
|
|
@@ -960,7 +962,20 @@ export type SimulatedTransactionResponse = {
|
|
|
960
962
|
accounts?: (SimulatedTransactionAccountInfo | null)[] | null;
|
|
961
963
|
unitsConsumed?: number;
|
|
962
964
|
returnData?: TransactionReturnData | null;
|
|
965
|
+
innerInstructions?: ParsedInnerInstruction[] | null;
|
|
963
966
|
};
|
|
967
|
+
const ParsedInstructionStruct = pick({
|
|
968
|
+
program: string(),
|
|
969
|
+
programId: PublicKeyFromString,
|
|
970
|
+
parsed: unknown(),
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
const PartiallyDecodedInstructionStruct = pick({
|
|
974
|
+
programId: PublicKeyFromString,
|
|
975
|
+
accounts: array(PublicKeyFromString),
|
|
976
|
+
data: string(),
|
|
977
|
+
});
|
|
978
|
+
|
|
964
979
|
const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(
|
|
965
980
|
pick({
|
|
966
981
|
err: nullable(union([pick({}), string()])),
|
|
@@ -989,6 +1004,21 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(
|
|
|
989
1004
|
}),
|
|
990
1005
|
),
|
|
991
1006
|
),
|
|
1007
|
+
innerInstructions: optional(
|
|
1008
|
+
nullable(
|
|
1009
|
+
array(
|
|
1010
|
+
pick({
|
|
1011
|
+
index: number(),
|
|
1012
|
+
instructions: array(
|
|
1013
|
+
union([
|
|
1014
|
+
ParsedInstructionStruct,
|
|
1015
|
+
PartiallyDecodedInstructionStruct,
|
|
1016
|
+
]),
|
|
1017
|
+
),
|
|
1018
|
+
}),
|
|
1019
|
+
),
|
|
1020
|
+
),
|
|
1021
|
+
),
|
|
992
1022
|
}),
|
|
993
1023
|
);
|
|
994
1024
|
|
|
@@ -5712,6 +5742,14 @@ export class Connection {
|
|
|
5712
5742
|
config.commitment = this.commitment;
|
|
5713
5743
|
}
|
|
5714
5744
|
|
|
5745
|
+
if (
|
|
5746
|
+
configOrSigners &&
|
|
5747
|
+
typeof configOrSigners === 'object' &&
|
|
5748
|
+
'innerInstructions' in configOrSigners
|
|
5749
|
+
) {
|
|
5750
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
5751
|
+
}
|
|
5752
|
+
|
|
5715
5753
|
const args = [encodedTransaction, config];
|
|
5716
5754
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
5717
5755
|
const res = create(unsafeRes, SimulatedTransactionResponseStruct);
|
|
@@ -5802,6 +5840,14 @@ export class Connection {
|
|
|
5802
5840
|
config.sigVerify = true;
|
|
5803
5841
|
}
|
|
5804
5842
|
|
|
5843
|
+
if (
|
|
5844
|
+
configOrSigners &&
|
|
5845
|
+
typeof configOrSigners === 'object' &&
|
|
5846
|
+
'innerInstructions' in configOrSigners
|
|
5847
|
+
) {
|
|
5848
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
5849
|
+
}
|
|
5850
|
+
|
|
5805
5851
|
const args = [encodedTransaction, config];
|
|
5806
5852
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
5807
5853
|
const res = create(unsafeRes, SimulatedTransactionResponseStruct);
|
package/src/validator-info.ts
CHANGED
|
@@ -33,6 +33,8 @@ export type Info = {
|
|
|
33
33
|
website?: string;
|
|
34
34
|
/** optional, extra information the validator chose to share */
|
|
35
35
|
details?: string;
|
|
36
|
+
/** optional, validator logo URL */
|
|
37
|
+
iconUrl?: string;
|
|
36
38
|
/** optional, used to identify validators on keybase.io */
|
|
37
39
|
keybaseUsername?: string;
|
|
38
40
|
};
|
|
@@ -41,6 +43,7 @@ const InfoString = pick({
|
|
|
41
43
|
name: string(),
|
|
42
44
|
website: optional(string()),
|
|
43
45
|
details: optional(string()),
|
|
46
|
+
iconUrl: optional(string()),
|
|
44
47
|
keybaseUsername: optional(string()),
|
|
45
48
|
});
|
|
46
49
|
|