@solana/web3.js 1.97.0 → 1.98.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/README.md +4 -4
- package/lib/index.browser.cjs.js +31 -39
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +29 -37
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +31 -39
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +29 -37
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +229 -106
- 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/lib/index.native.js +31 -39
- package/lib/index.native.js.map +1 -1
- package/package.json +5 -5
- package/src/connection.ts +23 -21
- package/src/programs/address-lookup-table/index.ts +5 -2
- package/src/utils/bigint.ts +14 -33
package/lib/index.native.js
CHANGED
|
@@ -7,7 +7,7 @@ var bs58 = require('bs58');
|
|
|
7
7
|
var sha256 = require('@noble/hashes/sha256');
|
|
8
8
|
var borsh = require('borsh');
|
|
9
9
|
var BufferLayout = require('@solana/buffer-layout');
|
|
10
|
-
var
|
|
10
|
+
var codecsNumbers = require('@solana/codecs-numbers');
|
|
11
11
|
var superstruct = require('superstruct');
|
|
12
12
|
var RpcClient = require('jayson/lib/client/browser');
|
|
13
13
|
var rpcWebsockets = require('rpc-websockets');
|
|
@@ -2399,32 +2399,22 @@ class NonceAccount {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
2401
|
|
|
2402
|
-
|
|
2402
|
+
function u64(property) {
|
|
2403
|
+
const layout = BufferLayout.blob(8 /* bytes */, property);
|
|
2403
2404
|
const decode = layout.decode.bind(layout);
|
|
2404
2405
|
const encode = layout.encode.bind(layout);
|
|
2405
|
-
return {
|
|
2406
|
-
decode,
|
|
2407
|
-
encode
|
|
2408
|
-
};
|
|
2409
|
-
};
|
|
2410
|
-
const bigInt = length => property => {
|
|
2411
|
-
const layout = BufferLayout.blob(length, property);
|
|
2412
|
-
const {
|
|
2413
|
-
encode,
|
|
2414
|
-
decode
|
|
2415
|
-
} = encodeDecode(layout);
|
|
2416
2406
|
const bigIntLayout = layout;
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2407
|
+
const codec = codecsNumbers.getU64Codec();
|
|
2408
|
+
bigIntLayout.decode = (buffer, offset) => {
|
|
2409
|
+
const src = decode(buffer, offset);
|
|
2410
|
+
return codec.decode(src);
|
|
2420
2411
|
};
|
|
2421
2412
|
bigIntLayout.encode = (bigInt, buffer, offset) => {
|
|
2422
|
-
const src =
|
|
2413
|
+
const src = codec.encode(bigInt);
|
|
2423
2414
|
return encode(src, buffer, offset);
|
|
2424
2415
|
};
|
|
2425
2416
|
return bigIntLayout;
|
|
2426
|
-
}
|
|
2427
|
-
const u64 = bigInt(8);
|
|
2417
|
+
}
|
|
2428
2418
|
|
|
2429
2419
|
/**
|
|
2430
2420
|
* Create account system transaction params
|
|
@@ -5005,18 +4995,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
5005
4995
|
version: superstruct.optional(TransactionVersionStruct)
|
|
5006
4996
|
})));
|
|
5007
4997
|
|
|
5008
|
-
/**
|
|
5009
|
-
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
5010
|
-
*
|
|
5011
|
-
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
5012
|
-
*/
|
|
5013
|
-
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
5014
|
-
blockhash: superstruct.string(),
|
|
5015
|
-
feeCalculator: superstruct.type({
|
|
5016
|
-
lamportsPerSignature: superstruct.number()
|
|
5017
|
-
})
|
|
5018
|
-
}));
|
|
5019
|
-
|
|
5020
4998
|
/**
|
|
5021
4999
|
* Expected JSON RPC response for the "getLatestBlockhash" message
|
|
5022
5000
|
*/
|
|
@@ -6394,13 +6372,27 @@ class Connection {
|
|
|
6394
6372
|
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
|
|
6395
6373
|
*/
|
|
6396
6374
|
async getRecentBlockhashAndContext(commitment) {
|
|
6397
|
-
const
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
}
|
|
6403
|
-
|
|
6375
|
+
const {
|
|
6376
|
+
context,
|
|
6377
|
+
value: {
|
|
6378
|
+
blockhash
|
|
6379
|
+
}
|
|
6380
|
+
} = await this.getLatestBlockhashAndContext(commitment);
|
|
6381
|
+
const feeCalculator = {
|
|
6382
|
+
get lamportsPerSignature() {
|
|
6383
|
+
throw new Error('The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' + 'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' + 'for a given message.');
|
|
6384
|
+
},
|
|
6385
|
+
toJSON() {
|
|
6386
|
+
return {};
|
|
6387
|
+
}
|
|
6388
|
+
};
|
|
6389
|
+
return {
|
|
6390
|
+
context,
|
|
6391
|
+
value: {
|
|
6392
|
+
blockhash,
|
|
6393
|
+
feeCalculator
|
|
6394
|
+
}
|
|
6395
|
+
};
|
|
6404
6396
|
}
|
|
6405
6397
|
|
|
6406
6398
|
/**
|
|
@@ -8421,7 +8413,7 @@ class AddressLookupTableProgram {
|
|
|
8421
8413
|
*/
|
|
8422
8414
|
constructor() {}
|
|
8423
8415
|
static createLookupTable(params) {
|
|
8424
|
-
const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(),
|
|
8416
|
+
const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), codecsNumbers.getU64Encoder().encode(params.recentSlot)], this.programId);
|
|
8425
8417
|
const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;
|
|
8426
8418
|
const data = encodeData(type, {
|
|
8427
8419
|
recentSlot: BigInt(params.recentSlot),
|