@solana/web3.js 1.78.0 → 1.78.2
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 +10135 -6780
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +10122 -6780
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +10162 -6784
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +48 -5
- package/lib/index.esm.js +10149 -6784
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +30585 -26721
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +9 -9
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +10135 -6780
- package/lib/index.native.js.map +1 -1
- package/package.json +22 -22
- package/src/connection.ts +2 -2
- package/src/fetch-impl.ts +14 -11
- package/src/keypair.ts +11 -2
- package/src/transaction/legacy.ts +31 -1
- package/src/utils/cluster.ts +4 -0
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ declare module "@solana/web3.js" {
|
|
|
3
3
|
import { Buffer } from 'buffer';
|
|
4
4
|
import { Agent } from 'http';
|
|
5
5
|
import { Agent as Agent$1 } from 'https';
|
|
6
|
-
import * as nodeFetch from 'node-fetch';
|
|
7
6
|
|
|
8
7
|
export class Struct {
|
|
9
8
|
constructor(properties: any);
|
|
@@ -169,7 +168,8 @@ export class EpochSchedule {
|
|
|
169
168
|
getSlotsInEpoch(epoch: number): number;
|
|
170
169
|
}
|
|
171
170
|
|
|
172
|
-
export
|
|
171
|
+
export const _default: typeof fetch;
|
|
172
|
+
//# sourceMappingURL=fetch-impl.d.ts.map
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* Calculator for transaction fees.
|
|
@@ -232,11 +232,13 @@ export class Keypair {
|
|
|
232
232
|
* Create a new keypair instance.
|
|
233
233
|
* Generate random keypair if no {@link Ed25519Keypair} is provided.
|
|
234
234
|
*
|
|
235
|
-
* @param keypair ed25519 keypair
|
|
235
|
+
* @param {Ed25519Keypair} keypair ed25519 keypair
|
|
236
236
|
*/
|
|
237
237
|
constructor(keypair?: Ed25519Keypair);
|
|
238
238
|
/**
|
|
239
239
|
* Generate a new random keypair
|
|
240
|
+
*
|
|
241
|
+
* @returns {Keypair} Keypair
|
|
240
242
|
*/
|
|
241
243
|
static generate(): Keypair;
|
|
242
244
|
/**
|
|
@@ -249,7 +251,9 @@ export class Keypair {
|
|
|
249
251
|
* @throws error if the provided secret key is invalid and validation is not skipped.
|
|
250
252
|
*
|
|
251
253
|
* @param secretKey secret key byte array
|
|
252
|
-
* @param options
|
|
254
|
+
* @param options skip secret key validation
|
|
255
|
+
*
|
|
256
|
+
* @returns {Keypair} Keypair
|
|
253
257
|
*/
|
|
254
258
|
static fromSecretKey(secretKey: Uint8Array, options?: {
|
|
255
259
|
skipValidation?: boolean;
|
|
@@ -258,14 +262,19 @@ export class Keypair {
|
|
|
258
262
|
* Generate a keypair from a 32 byte seed.
|
|
259
263
|
*
|
|
260
264
|
* @param seed seed byte array
|
|
265
|
+
*
|
|
266
|
+
* @returns {Keypair} Keypair
|
|
261
267
|
*/
|
|
262
268
|
static fromSeed(seed: Uint8Array): Keypair;
|
|
263
269
|
/**
|
|
264
270
|
* The public key for this keypair
|
|
271
|
+
*
|
|
272
|
+
* @returns {PublicKey} PublicKey
|
|
265
273
|
*/
|
|
266
274
|
get publicKey(): PublicKey;
|
|
267
275
|
/**
|
|
268
276
|
* The raw secret key for this keypair
|
|
277
|
+
* @returns {Uint8Array} Secret key in an array of Uint8 bytes
|
|
269
278
|
*/
|
|
270
279
|
get secretKey(): Uint8Array;
|
|
271
280
|
}
|
|
@@ -1576,6 +1585,8 @@ export class Transaction {
|
|
|
1576
1585
|
signatures: Array<SignaturePubkeyPair>;
|
|
1577
1586
|
/**
|
|
1578
1587
|
* The first (payer) Transaction signature
|
|
1588
|
+
*
|
|
1589
|
+
* @returns {Buffer | null} Buffer of payer's signature
|
|
1579
1590
|
*/
|
|
1580
1591
|
get signature(): Buffer | null;
|
|
1581
1592
|
/**
|
|
@@ -1616,6 +1627,8 @@ export class Transaction {
|
|
|
1616
1627
|
constructor(opts?: TransactionCtorFields_DEPRECATED);
|
|
1617
1628
|
/**
|
|
1618
1629
|
* Add one or more instructions to this Transaction
|
|
1630
|
+
*
|
|
1631
|
+
* @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction
|
|
1619
1632
|
*/
|
|
1620
1633
|
add(...items: Array<Transaction | TransactionInstruction | TransactionInstructionCtorFields>): Transaction;
|
|
1621
1634
|
/**
|
|
@@ -1628,6 +1641,10 @@ export class Transaction {
|
|
|
1628
1641
|
serializeMessage(): Buffer;
|
|
1629
1642
|
/**
|
|
1630
1643
|
* Get the estimated fee associated with a transaction
|
|
1644
|
+
*
|
|
1645
|
+
* @param {Connection} connection Connection to RPC Endpoint.
|
|
1646
|
+
*
|
|
1647
|
+
* @returns {Promise<number | null>} The estimated fee for the transaction
|
|
1631
1648
|
*/
|
|
1632
1649
|
getEstimatedFee(connection: Connection): Promise<number | null>;
|
|
1633
1650
|
/**
|
|
@@ -1654,6 +1671,8 @@ export class Transaction {
|
|
|
1654
1671
|
* rejected.
|
|
1655
1672
|
*
|
|
1656
1673
|
* The Transaction must be assigned a valid `recentBlockhash` before invoking this method
|
|
1674
|
+
*
|
|
1675
|
+
* @param {Array<Signer>} signers Array of signers that will sign the transaction
|
|
1657
1676
|
*/
|
|
1658
1677
|
sign(...signers: Array<Signer>): void;
|
|
1659
1678
|
/**
|
|
@@ -1662,30 +1681,50 @@ export class Transaction {
|
|
|
1662
1681
|
* instructions.
|
|
1663
1682
|
*
|
|
1664
1683
|
* All the caveats from the `sign` method apply to `partialSign`
|
|
1684
|
+
*
|
|
1685
|
+
* @param {Array<Signer>} signers Array of signers that will sign the transaction
|
|
1665
1686
|
*/
|
|
1666
1687
|
partialSign(...signers: Array<Signer>): void;
|
|
1667
1688
|
/**
|
|
1668
1689
|
* Add an externally created signature to a transaction. The public key
|
|
1669
1690
|
* must correspond to either the fee payer or a signer account in the transaction
|
|
1670
1691
|
* instructions.
|
|
1692
|
+
*
|
|
1693
|
+
* @param {PublicKey} pubkey Public key that will be added to the transaction.
|
|
1694
|
+
* @param {Buffer} signature An externally created signature to add to the transaction.
|
|
1671
1695
|
*/
|
|
1672
1696
|
addSignature(pubkey: PublicKey, signature: Buffer): void;
|
|
1673
1697
|
/**
|
|
1674
1698
|
* Verify signatures of a Transaction
|
|
1675
1699
|
* Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
|
|
1676
1700
|
* If no boolean is provided, we expect a fully signed Transaction by default.
|
|
1701
|
+
*
|
|
1702
|
+
* @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction
|
|
1677
1703
|
*/
|
|
1678
1704
|
verifySignatures(requireAllSignatures?: boolean): boolean;
|
|
1679
1705
|
/**
|
|
1680
1706
|
* Serialize the Transaction in the wire format.
|
|
1707
|
+
*
|
|
1708
|
+
* @param {Buffer} [config] Config of transaction.
|
|
1709
|
+
*
|
|
1710
|
+
* @returns {Buffer} Signature of transaction in wire format.
|
|
1681
1711
|
*/
|
|
1682
1712
|
serialize(config?: SerializeConfig): Buffer;
|
|
1683
1713
|
/**
|
|
1684
1714
|
* Parse a wire transaction into a Transaction object.
|
|
1715
|
+
*
|
|
1716
|
+
* @param {Buffer | Uint8Array | Array<number>} buffer Signature of wire Transaction
|
|
1717
|
+
*
|
|
1718
|
+
* @returns {Transaction} Transaction associated with the signature
|
|
1685
1719
|
*/
|
|
1686
1720
|
static from(buffer: Buffer | Uint8Array | Array<number>): Transaction;
|
|
1687
1721
|
/**
|
|
1688
1722
|
* Populate Transaction object from message and signatures
|
|
1723
|
+
*
|
|
1724
|
+
* @param {Message} message Message of transaction
|
|
1725
|
+
* @param {Array<string>} signatures List of signatures to assign to the transaction
|
|
1726
|
+
*
|
|
1727
|
+
* @returns {Transaction} The populated Transaction
|
|
1689
1728
|
*/
|
|
1690
1729
|
static populate(message: Message, signatures?: Array<string>): Transaction;
|
|
1691
1730
|
}
|
|
@@ -3061,7 +3100,7 @@ type HttpHeaders = {
|
|
|
3061
3100
|
/**
|
|
3062
3101
|
* The type of the JavaScript `fetch()` API
|
|
3063
3102
|
*/
|
|
3064
|
-
type FetchFn = typeof
|
|
3103
|
+
type FetchFn = typeof _default;
|
|
3065
3104
|
/**
|
|
3066
3105
|
* A callback used to augment the outgoing HTTP request
|
|
3067
3106
|
*/
|
|
@@ -3860,6 +3899,10 @@ export const SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey;
|
|
|
3860
3899
|
type Cluster = 'devnet' | 'testnet' | 'mainnet-beta';
|
|
3861
3900
|
/**
|
|
3862
3901
|
* Retrieves the RPC API URL for the specified cluster
|
|
3902
|
+
* @param {Cluster} [cluster="devnet"] - The cluster name of the RPC API URL to use. Possible options: 'devnet' | 'testnet' | 'mainnet-beta'
|
|
3903
|
+
* @param {boolean} [tls="http"] - Use TLS when connecting to cluster.
|
|
3904
|
+
*
|
|
3905
|
+
* @returns {string} URL string of the RPC endpoint
|
|
3863
3906
|
*/
|
|
3864
3907
|
export function clusterApiUrl(cluster?: Cluster, tls?: boolean): string;
|
|
3865
3908
|
|