@solana/web3.js 1.18.1 → 1.19.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/lib/index.browser.esm.js +33 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +33 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +27 -0
- package/lib/index.esm.js +33 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +33 -0
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/module.flow.js +42 -16
- package/package.json +5 -5
- package/src/connection.ts +59 -0
package/module.flow.js
CHANGED
|
@@ -107,7 +107,7 @@ declare module "@solana/web3.js" {
|
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* An account key pair (public and secret keys).
|
|
110
|
-
* @deprecated
|
|
110
|
+
* @deprecated [object Object],[object Object],[object Object]
|
|
111
111
|
*/
|
|
112
112
|
declare export class Account {
|
|
113
113
|
/**
|
|
@@ -137,9 +137,7 @@ declare module "@solana/web3.js" {
|
|
|
137
137
|
declare export var BPF_LOADER_DEPRECATED_PROGRAM_ID: PublicKey;
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
141
|
-
* (see https://docs.solana.com/terminology#epoch)
|
|
142
|
-
* Can be retrieved with the {@link connection.getEpochSchedule} method
|
|
140
|
+
* [object Object],[object Object],[object Object]
|
|
143
141
|
*/
|
|
144
142
|
declare export class EpochSchedule {
|
|
145
143
|
/**
|
|
@@ -230,8 +228,7 @@ declare module "@solana/web3.js" {
|
|
|
230
228
|
*/
|
|
231
229
|
declare export class Keypair {
|
|
232
230
|
/**
|
|
233
|
-
*
|
|
234
|
-
* Generate random keypair if no {@link Ed25519Keypair} is provided.
|
|
231
|
+
* [object Object],[object Object],[object Object]
|
|
235
232
|
* @param keypair ed25519 keypair
|
|
236
233
|
*/
|
|
237
234
|
constructor(keypair?: Ed25519Keypair): this;
|
|
@@ -242,11 +239,7 @@ declare module "@solana/web3.js" {
|
|
|
242
239
|
static generate(): Keypair;
|
|
243
240
|
|
|
244
241
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* This method should only be used to recreate a keypair from a previously
|
|
248
|
-
* generated secret key. Generating keypairs from a random seed should be done
|
|
249
|
-
* with the {@link Keypair.fromSeed} method.
|
|
242
|
+
* [object Object],[object Object],[object Object]
|
|
250
243
|
* @throws error if the provided secret key is invalid and validation is not skipped.
|
|
251
244
|
* @param secretKey secret key byte array
|
|
252
245
|
* @param options : skip secret key validation
|
|
@@ -700,6 +693,28 @@ declare module "@solana/web3.js" {
|
|
|
700
693
|
...
|
|
701
694
|
};
|
|
702
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Options for getSignaturesForAddress
|
|
698
|
+
*/
|
|
699
|
+
declare export type SignaturesForAddressOptions = {
|
|
700
|
+
/**
|
|
701
|
+
* Start searching backwards from this transaction signature.
|
|
702
|
+
* @remark If not provided the search starts from the highest max confirmed block.
|
|
703
|
+
*/
|
|
704
|
+
before?: TransactionSignature,
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Search until this transaction signature is reached, if found before `limit`.
|
|
708
|
+
*/
|
|
709
|
+
until?: TransactionSignature,
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Maximum transaction signatures to return (between 1 and 1,000, default: 1,000).
|
|
713
|
+
*/
|
|
714
|
+
limit?: number,
|
|
715
|
+
...
|
|
716
|
+
};
|
|
717
|
+
|
|
703
718
|
/**
|
|
704
719
|
* RPC Response with extra contextual information
|
|
705
720
|
*/
|
|
@@ -2255,7 +2270,7 @@ account: AccountInfo<Buffer | ParsedAccountData>,...
|
|
|
2255
2270
|
|
|
2256
2271
|
/**
|
|
2257
2272
|
* Fetch the current total currency supply of the cluster in lamports
|
|
2258
|
-
* @deprecated
|
|
2273
|
+
* @deprecated [object Object],[object Object],[object Object]
|
|
2259
2274
|
*/
|
|
2260
2275
|
getTotalSupply(commitment?: Commitment): Promise<number>;
|
|
2261
2276
|
|
|
@@ -2370,7 +2385,7 @@ feeCalculator: FeeCalculator,...
|
|
|
2370
2385
|
/**
|
|
2371
2386
|
* Fetch a list of Transactions and transaction statuses from the cluster
|
|
2372
2387
|
* for a confirmed block.
|
|
2373
|
-
* @deprecated
|
|
2388
|
+
* @deprecated [object Object],[object Object],[object Object]
|
|
2374
2389
|
*/
|
|
2375
2390
|
getConfirmedBlock(
|
|
2376
2391
|
slot: number,
|
|
@@ -2412,7 +2427,7 @@ feeCalculator: FeeCalculator,...
|
|
|
2412
2427
|
/**
|
|
2413
2428
|
* Fetch a list of all the confirmed signatures for transactions involving an address
|
|
2414
2429
|
* within a specified slot range. Max range allowed is 10,000 slots.
|
|
2415
|
-
* @deprecated
|
|
2430
|
+
* @deprecated [object Object],[object Object],[object Object]
|
|
2416
2431
|
* @param address queried address
|
|
2417
2432
|
* @param startSlot start slot, inclusive
|
|
2418
2433
|
* @param endSlot end slot, inclusive
|
|
@@ -2435,6 +2450,18 @@ feeCalculator: FeeCalculator,...
|
|
|
2435
2450
|
commitment?: Finality
|
|
2436
2451
|
): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2437
2452
|
|
|
2453
|
+
/**
|
|
2454
|
+
* Returns confirmed signatures for transactions involving an
|
|
2455
|
+
* address backwards in time from the provided signature or most recent confirmed block
|
|
2456
|
+
* @param address queried address
|
|
2457
|
+
* @param options
|
|
2458
|
+
*/
|
|
2459
|
+
getSignaturesForAddress(
|
|
2460
|
+
address: PublicKey,
|
|
2461
|
+
options?: SignaturesForAddressOptions,
|
|
2462
|
+
commitment?: Finality
|
|
2463
|
+
): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2464
|
+
|
|
2438
2465
|
/**
|
|
2439
2466
|
* Fetch the contents of a Nonce account from the cluster, return with context
|
|
2440
2467
|
*/
|
|
@@ -2573,8 +2600,7 @@ feeCalculator: FeeCalculator,...
|
|
|
2573
2600
|
removeSlotChangeListener(id: number): Promise<void>;
|
|
2574
2601
|
|
|
2575
2602
|
/**
|
|
2576
|
-
*
|
|
2577
|
-
* may be useful to track live progress of a cluster.
|
|
2603
|
+
* [object Object],[object Object],[object Object]
|
|
2578
2604
|
* @param callback Function to invoke whenever the slot updates
|
|
2579
2605
|
* @return subscription id
|
|
2580
2606
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/web3.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Solana Javascript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"http-server": "^0.12.3",
|
|
97
97
|
"mocha": "^8.2.1",
|
|
98
98
|
"mocha-headless-chrome": "^3.1.0",
|
|
99
|
-
"mockttp": "^
|
|
99
|
+
"mockttp": "^2.0.1",
|
|
100
100
|
"mz": "^2.7.0",
|
|
101
101
|
"npm-run-all": "^4.1.5",
|
|
102
102
|
"nyc": "^15.1.0",
|
|
103
103
|
"prettier": "^2.3.0",
|
|
104
104
|
"rimraf": "3.0.2",
|
|
105
|
-
"rollup": "2.51.
|
|
105
|
+
"rollup": "2.51.2",
|
|
106
106
|
"rollup-plugin-dts": "^3.0.1",
|
|
107
107
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
108
108
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"start-server-and-test": "^1.12.0",
|
|
112
112
|
"ts-node": "^10.0.0",
|
|
113
113
|
"tslib": "^2.1.0",
|
|
114
|
-
"typedoc": "^0.
|
|
115
|
-
"typescript": "^4.
|
|
114
|
+
"typedoc": "^0.21.0-beta.2",
|
|
115
|
+
"typescript": "^4.3.2"
|
|
116
116
|
},
|
|
117
117
|
"scripts": {
|
|
118
118
|
"build": "npm run clean; cross-env NODE_ENV=production rollup -c; npm run type:gen; npm run flow:gen; npm run flow:check",
|
package/src/connection.ts
CHANGED
|
@@ -127,6 +127,21 @@ export type ConfirmedSignaturesForAddress2Options = {
|
|
|
127
127
|
limit?: number;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Options for getSignaturesForAddress
|
|
132
|
+
*/
|
|
133
|
+
export type SignaturesForAddressOptions = {
|
|
134
|
+
/**
|
|
135
|
+
* Start searching backwards from this transaction signature.
|
|
136
|
+
* @remark If not provided the search starts from the highest max confirmed block.
|
|
137
|
+
*/
|
|
138
|
+
before?: TransactionSignature;
|
|
139
|
+
/** Search until this transaction signature is reached, if found before `limit`. */
|
|
140
|
+
until?: TransactionSignature;
|
|
141
|
+
/** Maximum transaction signatures to return (between 1 and 1,000, default: 1,000). */
|
|
142
|
+
limit?: number;
|
|
143
|
+
};
|
|
144
|
+
|
|
130
145
|
/**
|
|
131
146
|
* RPC Response with extra contextual information
|
|
132
147
|
*/
|
|
@@ -1060,6 +1075,21 @@ const GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(
|
|
|
1060
1075
|
),
|
|
1061
1076
|
);
|
|
1062
1077
|
|
|
1078
|
+
/**
|
|
1079
|
+
* Expected JSON RPC response for the "getSignaturesForAddress" message
|
|
1080
|
+
*/
|
|
1081
|
+
const GetSignaturesForAddressRpcResult = jsonRpcResult(
|
|
1082
|
+
array(
|
|
1083
|
+
pick({
|
|
1084
|
+
signature: string(),
|
|
1085
|
+
slot: number(),
|
|
1086
|
+
err: TransactionErrorResult,
|
|
1087
|
+
memo: nullable(string()),
|
|
1088
|
+
blockTime: optional(nullable(number())),
|
|
1089
|
+
}),
|
|
1090
|
+
),
|
|
1091
|
+
);
|
|
1092
|
+
|
|
1063
1093
|
/***
|
|
1064
1094
|
* Expected JSON RPC response for the "accountNotification" message
|
|
1065
1095
|
*/
|
|
@@ -3205,6 +3235,35 @@ export class Connection {
|
|
|
3205
3235
|
return res.result;
|
|
3206
3236
|
}
|
|
3207
3237
|
|
|
3238
|
+
/**
|
|
3239
|
+
* Returns confirmed signatures for transactions involving an
|
|
3240
|
+
* address backwards in time from the provided signature or most recent confirmed block
|
|
3241
|
+
*
|
|
3242
|
+
*
|
|
3243
|
+
* @param address queried address
|
|
3244
|
+
* @param options
|
|
3245
|
+
*/
|
|
3246
|
+
async getSignaturesForAddress(
|
|
3247
|
+
address: PublicKey,
|
|
3248
|
+
options?: SignaturesForAddressOptions,
|
|
3249
|
+
commitment?: Finality,
|
|
3250
|
+
): Promise<Array<ConfirmedSignatureInfo>> {
|
|
3251
|
+
const args = this._buildArgsAtLeastConfirmed(
|
|
3252
|
+
[address.toBase58()],
|
|
3253
|
+
commitment,
|
|
3254
|
+
undefined,
|
|
3255
|
+
options,
|
|
3256
|
+
);
|
|
3257
|
+
const unsafeRes = await this._rpcRequest('getSignaturesForAddress', args);
|
|
3258
|
+
const res = create(unsafeRes, GetSignaturesForAddressRpcResult);
|
|
3259
|
+
if ('error' in res) {
|
|
3260
|
+
throw new Error(
|
|
3261
|
+
'failed to get signatures for address: ' + res.error.message,
|
|
3262
|
+
);
|
|
3263
|
+
}
|
|
3264
|
+
return res.result;
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3208
3267
|
/**
|
|
3209
3268
|
* Fetch the contents of a Nonce account from the cluster, return with context
|
|
3210
3269
|
*/
|