@solana/web3.js 1.44.2 → 1.46.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 +184 -91
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +184 -91
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +184 -91
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +144 -18
- package/lib/index.esm.js +184 -91
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +184 -91
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +3 -3
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +3 -3
- package/src/connection.ts +283 -76
- package/src/transaction.ts +19 -12
- package/src/util/send-and-confirm-raw-transaction.ts +1 -0
- package/src/util/send-and-confirm-transaction.ts +1 -0
package/lib/index.iife.js
CHANGED
|
@@ -14201,24 +14201,27 @@ var solanaWeb3 = (function (exports) {
|
|
|
14201
14201
|
return this._message;
|
|
14202
14202
|
}
|
|
14203
14203
|
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
} = this;
|
|
14204
|
+
let recentBlockhash;
|
|
14205
|
+
let instructions;
|
|
14207
14206
|
|
|
14208
|
-
if (
|
|
14209
|
-
|
|
14210
|
-
this.instructions.unshift(nonceInfo.nonceInstruction);
|
|
14211
|
-
}
|
|
14207
|
+
if (this.nonceInfo) {
|
|
14208
|
+
recentBlockhash = this.nonceInfo.nonce;
|
|
14212
14209
|
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14210
|
+
if (this.instructions[0] != this.nonceInfo.nonceInstruction) {
|
|
14211
|
+
instructions = [this.nonceInfo.nonceInstruction, ...this.instructions];
|
|
14212
|
+
} else {
|
|
14213
|
+
instructions = this.instructions;
|
|
14214
|
+
}
|
|
14215
|
+
} else {
|
|
14216
|
+
recentBlockhash = this.recentBlockhash;
|
|
14217
|
+
instructions = this.instructions;
|
|
14218
|
+
}
|
|
14216
14219
|
|
|
14217
14220
|
if (!recentBlockhash) {
|
|
14218
14221
|
throw new Error('Transaction recentBlockhash required');
|
|
14219
14222
|
}
|
|
14220
14223
|
|
|
14221
|
-
if (
|
|
14224
|
+
if (instructions.length < 1) {
|
|
14222
14225
|
console.warn('No instructions provided');
|
|
14223
14226
|
}
|
|
14224
14227
|
|
|
@@ -14233,15 +14236,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
14233
14236
|
throw new Error('Transaction fee payer required');
|
|
14234
14237
|
}
|
|
14235
14238
|
|
|
14236
|
-
for (let i = 0; i <
|
|
14237
|
-
if (
|
|
14239
|
+
for (let i = 0; i < instructions.length; i++) {
|
|
14240
|
+
if (instructions[i].programId === undefined) {
|
|
14238
14241
|
throw new Error(`Transaction instruction index ${i} has undefined program id`);
|
|
14239
14242
|
}
|
|
14240
14243
|
}
|
|
14241
14244
|
|
|
14242
14245
|
const programIds = [];
|
|
14243
14246
|
const accountMetas = [];
|
|
14244
|
-
|
|
14247
|
+
instructions.forEach(instruction => {
|
|
14245
14248
|
instruction.keys.forEach(accountMeta => {
|
|
14246
14249
|
accountMetas.push({ ...accountMeta
|
|
14247
14250
|
});
|
|
@@ -14351,7 +14354,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14351
14354
|
}
|
|
14352
14355
|
});
|
|
14353
14356
|
const accountKeys = signedKeys.concat(unsignedKeys);
|
|
14354
|
-
const
|
|
14357
|
+
const compiledInstructions = instructions.map(instruction => {
|
|
14355
14358
|
const {
|
|
14356
14359
|
data,
|
|
14357
14360
|
programId
|
|
@@ -14362,7 +14365,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14362
14365
|
data: bs58$1.encode(data)
|
|
14363
14366
|
};
|
|
14364
14367
|
});
|
|
14365
|
-
|
|
14368
|
+
compiledInstructions.forEach(instruction => {
|
|
14366
14369
|
assert$c(instruction.programIdIndex >= 0);
|
|
14367
14370
|
instruction.accounts.forEach(keyIndex => assert$c(keyIndex >= 0));
|
|
14368
14371
|
});
|
|
@@ -14374,7 +14377,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14374
14377
|
},
|
|
14375
14378
|
accountKeys,
|
|
14376
14379
|
recentBlockhash,
|
|
14377
|
-
instructions
|
|
14380
|
+
instructions: compiledInstructions
|
|
14378
14381
|
});
|
|
14379
14382
|
}
|
|
14380
14383
|
/**
|
|
@@ -14761,7 +14764,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
14761
14764
|
const sendOptions = options && {
|
|
14762
14765
|
skipPreflight: options.skipPreflight,
|
|
14763
14766
|
preflightCommitment: options.preflightCommitment || options.commitment,
|
|
14764
|
-
maxRetries: options.maxRetries
|
|
14767
|
+
maxRetries: options.maxRetries,
|
|
14768
|
+
minContextSlot: options.minContextSlot
|
|
14765
14769
|
};
|
|
14766
14770
|
const signature = await connection.sendTransaction(transaction, signers, sendOptions);
|
|
14767
14771
|
const status = transaction.recentBlockhash != null && transaction.lastValidBlockHeight != null ? (await connection.confirmTransaction({
|
|
@@ -19421,6 +19425,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
19421
19425
|
return url.toString();
|
|
19422
19426
|
}
|
|
19423
19427
|
|
|
19428
|
+
var _process$env$npm_pack;
|
|
19424
19429
|
const PublicKeyFromString = coerce(instance(PublicKey), string(), value => new PublicKey(value));
|
|
19425
19430
|
const RawAccountDataResult = tuple([string(), literal('base64')]);
|
|
19426
19431
|
const BufferFromRawAccountData = coerce(instance(buffer.Buffer), RawAccountDataResult, value => buffer.Buffer.from(value[0], 'base64'));
|
|
@@ -19437,9 +19442,32 @@ var solanaWeb3 = (function (exports) {
|
|
|
19437
19442
|
* https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d
|
|
19438
19443
|
*/
|
|
19439
19444
|
|
|
19445
|
+
/** @internal */
|
|
19446
|
+
function extractCommitmentFromConfig(commitmentOrConfig) {
|
|
19447
|
+
let commitment;
|
|
19448
|
+
let config;
|
|
19449
|
+
|
|
19450
|
+
if (typeof commitmentOrConfig === 'string') {
|
|
19451
|
+
commitment = commitmentOrConfig;
|
|
19452
|
+
} else if (commitmentOrConfig) {
|
|
19453
|
+
const {
|
|
19454
|
+
commitment: specifiedCommitment,
|
|
19455
|
+
...specifiedConfig
|
|
19456
|
+
} = commitmentOrConfig;
|
|
19457
|
+
commitment = specifiedCommitment;
|
|
19458
|
+
config = specifiedConfig;
|
|
19459
|
+
}
|
|
19460
|
+
|
|
19461
|
+
return {
|
|
19462
|
+
commitment,
|
|
19463
|
+
config
|
|
19464
|
+
};
|
|
19465
|
+
}
|
|
19440
19466
|
/**
|
|
19441
19467
|
* @internal
|
|
19442
19468
|
*/
|
|
19469
|
+
|
|
19470
|
+
|
|
19443
19471
|
function createRpcResult(result) {
|
|
19444
19472
|
return union([type({
|
|
19445
19473
|
jsonrpc: literal('2.0'),
|
|
@@ -19631,7 +19659,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
19631
19659
|
agent,
|
|
19632
19660
|
headers: Object.assign({
|
|
19633
19661
|
'Content-Type': 'application/json'
|
|
19634
|
-
}, httpHeaders || {})
|
|
19662
|
+
}, httpHeaders || {}, COMMON_HTTP_HEADERS)
|
|
19635
19663
|
};
|
|
19636
19664
|
|
|
19637
19665
|
try {
|
|
@@ -20304,9 +20332,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
20304
20332
|
* Filter for log subscriptions.
|
|
20305
20333
|
*/
|
|
20306
20334
|
|
|
20335
|
+
/** @internal */
|
|
20336
|
+
const COMMON_HTTP_HEADERS = {
|
|
20337
|
+
'solana-client': `js/${(_process$env$npm_pack = "0.0.0-development") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
20338
|
+
};
|
|
20307
20339
|
/**
|
|
20308
20340
|
* A connection to a fullnode JSON RPC endpoint
|
|
20309
20341
|
*/
|
|
20342
|
+
|
|
20310
20343
|
class Connection {
|
|
20311
20344
|
/** @internal */
|
|
20312
20345
|
|
|
@@ -20471,8 +20504,16 @@ var solanaWeb3 = (function (exports) {
|
|
|
20471
20504
|
*/
|
|
20472
20505
|
|
|
20473
20506
|
|
|
20474
|
-
async getBalanceAndContext(publicKey,
|
|
20475
|
-
|
|
20507
|
+
async getBalanceAndContext(publicKey, commitmentOrConfig) {
|
|
20508
|
+
/** @internal */
|
|
20509
|
+
const {
|
|
20510
|
+
commitment,
|
|
20511
|
+
config
|
|
20512
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
20513
|
+
|
|
20514
|
+
const args = this._buildArgs([publicKey.toBase58()], commitment, undefined
|
|
20515
|
+
/* encoding */
|
|
20516
|
+
, config);
|
|
20476
20517
|
|
|
20477
20518
|
const unsafeRes = await this._rpcRequest('getBalance', args);
|
|
20478
20519
|
const res = create(unsafeRes, jsonRpcResultAndContext(number()));
|
|
@@ -20488,8 +20529,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
20488
20529
|
*/
|
|
20489
20530
|
|
|
20490
20531
|
|
|
20491
|
-
async getBalance(publicKey,
|
|
20492
|
-
return await this.getBalanceAndContext(publicKey,
|
|
20532
|
+
async getBalance(publicKey, commitmentOrConfig) {
|
|
20533
|
+
return await this.getBalanceAndContext(publicKey, commitmentOrConfig).then(x => x.value).catch(e => {
|
|
20493
20534
|
throw new Error('failed to get balance of account ' + publicKey.toBase58() + ': ' + e);
|
|
20494
20535
|
});
|
|
20495
20536
|
}
|
|
@@ -20611,7 +20652,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
20611
20652
|
*/
|
|
20612
20653
|
|
|
20613
20654
|
|
|
20614
|
-
async getTokenAccountsByOwner(ownerAddress, filter,
|
|
20655
|
+
async getTokenAccountsByOwner(ownerAddress, filter, commitmentOrConfig) {
|
|
20656
|
+
const {
|
|
20657
|
+
commitment,
|
|
20658
|
+
config
|
|
20659
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
20615
20660
|
let _args = [ownerAddress.toBase58()];
|
|
20616
20661
|
|
|
20617
20662
|
if ('mint' in filter) {
|
|
@@ -20624,7 +20669,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20624
20669
|
});
|
|
20625
20670
|
}
|
|
20626
20671
|
|
|
20627
|
-
const args = this._buildArgs(_args, commitment, 'base64');
|
|
20672
|
+
const args = this._buildArgs(_args, commitment, 'base64', config);
|
|
20628
20673
|
|
|
20629
20674
|
const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);
|
|
20630
20675
|
const res = create(unsafeRes, GetTokenAccountsByOwner);
|
|
@@ -20708,8 +20753,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
20708
20753
|
*/
|
|
20709
20754
|
|
|
20710
20755
|
|
|
20711
|
-
async getAccountInfoAndContext(publicKey,
|
|
20712
|
-
const
|
|
20756
|
+
async getAccountInfoAndContext(publicKey, commitmentOrConfig) {
|
|
20757
|
+
const {
|
|
20758
|
+
commitment,
|
|
20759
|
+
config
|
|
20760
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
20761
|
+
|
|
20762
|
+
const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64', config);
|
|
20713
20763
|
|
|
20714
20764
|
const unsafeRes = await this._rpcRequest('getAccountInfo', args);
|
|
20715
20765
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult)));
|
|
@@ -20742,9 +20792,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
20742
20792
|
*/
|
|
20743
20793
|
|
|
20744
20794
|
|
|
20745
|
-
async getAccountInfo(publicKey,
|
|
20795
|
+
async getAccountInfo(publicKey, commitmentOrConfig) {
|
|
20746
20796
|
try {
|
|
20747
|
-
const res = await this.getAccountInfoAndContext(publicKey,
|
|
20797
|
+
const res = await this.getAccountInfoAndContext(publicKey, commitmentOrConfig);
|
|
20748
20798
|
return res.value;
|
|
20749
20799
|
} catch (e) {
|
|
20750
20800
|
throw new Error('failed to get info about account ' + publicKey.toBase58() + ': ' + e);
|
|
@@ -20755,10 +20805,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
20755
20805
|
*/
|
|
20756
20806
|
|
|
20757
20807
|
|
|
20758
|
-
async getMultipleAccountsInfoAndContext(publicKeys,
|
|
20808
|
+
async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) {
|
|
20809
|
+
const {
|
|
20810
|
+
commitment,
|
|
20811
|
+
config
|
|
20812
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
20759
20813
|
const keys = publicKeys.map(key => key.toBase58());
|
|
20760
20814
|
|
|
20761
|
-
const args = this._buildArgs([keys], commitment, 'base64');
|
|
20815
|
+
const args = this._buildArgs([keys], commitment, 'base64', config);
|
|
20762
20816
|
|
|
20763
20817
|
const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
|
|
20764
20818
|
const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult))));
|
|
@@ -20774,8 +20828,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
20774
20828
|
*/
|
|
20775
20829
|
|
|
20776
20830
|
|
|
20777
|
-
async getMultipleAccountsInfo(publicKeys,
|
|
20778
|
-
const res = await this.getMultipleAccountsInfoAndContext(publicKeys,
|
|
20831
|
+
async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) {
|
|
20832
|
+
const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig);
|
|
20779
20833
|
return res.value;
|
|
20780
20834
|
}
|
|
20781
20835
|
/**
|
|
@@ -20783,10 +20837,17 @@ var solanaWeb3 = (function (exports) {
|
|
|
20783
20837
|
*/
|
|
20784
20838
|
|
|
20785
20839
|
|
|
20786
|
-
async getStakeActivation(publicKey,
|
|
20787
|
-
const
|
|
20788
|
-
|
|
20789
|
-
|
|
20840
|
+
async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
|
|
20841
|
+
const {
|
|
20842
|
+
commitment,
|
|
20843
|
+
config
|
|
20844
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
20845
|
+
|
|
20846
|
+
const args = this._buildArgs([publicKey.toBase58()], commitment, undefined
|
|
20847
|
+
/* encoding */
|
|
20848
|
+
, { ...config,
|
|
20849
|
+
epoch: epoch != null ? epoch : config === null || config === void 0 ? void 0 : config.epoch
|
|
20850
|
+
});
|
|
20790
20851
|
|
|
20791
20852
|
const unsafeRes = await this._rpcRequest('getStakeActivation', args);
|
|
20792
20853
|
const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));
|
|
@@ -20805,28 +20866,16 @@ var solanaWeb3 = (function (exports) {
|
|
|
20805
20866
|
|
|
20806
20867
|
|
|
20807
20868
|
async getProgramAccounts(programId, configOrCommitment) {
|
|
20808
|
-
const
|
|
20809
|
-
|
|
20810
|
-
|
|
20811
|
-
|
|
20812
|
-
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20816
|
-
commitment = configOrCommitment.commitment;
|
|
20817
|
-
encoding = configOrCommitment.encoding;
|
|
20818
|
-
|
|
20819
|
-
if (configOrCommitment.dataSlice) {
|
|
20820
|
-
extra.dataSlice = configOrCommitment.dataSlice;
|
|
20821
|
-
}
|
|
20822
|
-
|
|
20823
|
-
if (configOrCommitment.filters) {
|
|
20824
|
-
extra.filters = configOrCommitment.filters;
|
|
20825
|
-
}
|
|
20826
|
-
}
|
|
20827
|
-
}
|
|
20869
|
+
const {
|
|
20870
|
+
commitment,
|
|
20871
|
+
config
|
|
20872
|
+
} = extractCommitmentFromConfig(configOrCommitment);
|
|
20873
|
+
const {
|
|
20874
|
+
encoding,
|
|
20875
|
+
...configWithoutEncoding
|
|
20876
|
+
} = config || {};
|
|
20828
20877
|
|
|
20829
|
-
const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64',
|
|
20878
|
+
const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', configWithoutEncoding);
|
|
20830
20879
|
|
|
20831
20880
|
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
|
|
20832
20881
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));
|
|
@@ -20845,22 +20894,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
20845
20894
|
|
|
20846
20895
|
|
|
20847
20896
|
async getParsedProgramAccounts(programId, configOrCommitment) {
|
|
20848
|
-
const
|
|
20849
|
-
|
|
20850
|
-
|
|
20851
|
-
|
|
20852
|
-
if (typeof configOrCommitment === 'string') {
|
|
20853
|
-
commitment = configOrCommitment;
|
|
20854
|
-
} else {
|
|
20855
|
-
commitment = configOrCommitment.commitment;
|
|
20856
|
-
|
|
20857
|
-
if (configOrCommitment.filters) {
|
|
20858
|
-
extra.filters = configOrCommitment.filters;
|
|
20859
|
-
}
|
|
20860
|
-
}
|
|
20861
|
-
}
|
|
20897
|
+
const {
|
|
20898
|
+
commitment,
|
|
20899
|
+
config
|
|
20900
|
+
} = extractCommitmentFromConfig(configOrCommitment);
|
|
20862
20901
|
|
|
20863
|
-
const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed',
|
|
20902
|
+
const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed', config);
|
|
20864
20903
|
|
|
20865
20904
|
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
|
|
20866
20905
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult)));
|
|
@@ -21027,8 +21066,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21027
21066
|
*/
|
|
21028
21067
|
|
|
21029
21068
|
|
|
21030
|
-
async getSlot(
|
|
21031
|
-
const
|
|
21069
|
+
async getSlot(commitmentOrConfig) {
|
|
21070
|
+
const {
|
|
21071
|
+
commitment,
|
|
21072
|
+
config
|
|
21073
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21074
|
+
|
|
21075
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21076
|
+
/* encoding */
|
|
21077
|
+
, config);
|
|
21032
21078
|
|
|
21033
21079
|
const unsafeRes = await this._rpcRequest('getSlot', args);
|
|
21034
21080
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
@@ -21044,8 +21090,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21044
21090
|
*/
|
|
21045
21091
|
|
|
21046
21092
|
|
|
21047
|
-
async getSlotLeader(
|
|
21048
|
-
const
|
|
21093
|
+
async getSlotLeader(commitmentOrConfig) {
|
|
21094
|
+
const {
|
|
21095
|
+
commitment,
|
|
21096
|
+
config
|
|
21097
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21098
|
+
|
|
21099
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21100
|
+
/* encoding */
|
|
21101
|
+
, config);
|
|
21049
21102
|
|
|
21050
21103
|
const unsafeRes = await this._rpcRequest('getSlotLeader', args);
|
|
21051
21104
|
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
@@ -21118,8 +21171,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21118
21171
|
*/
|
|
21119
21172
|
|
|
21120
21173
|
|
|
21121
|
-
async getTransactionCount(
|
|
21122
|
-
const
|
|
21174
|
+
async getTransactionCount(commitmentOrConfig) {
|
|
21175
|
+
const {
|
|
21176
|
+
commitment,
|
|
21177
|
+
config
|
|
21178
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21179
|
+
|
|
21180
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21181
|
+
/* encoding */
|
|
21182
|
+
, config);
|
|
21123
21183
|
|
|
21124
21184
|
const unsafeRes = await this._rpcRequest('getTransactionCount', args);
|
|
21125
21185
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
@@ -21166,9 +21226,16 @@ var solanaWeb3 = (function (exports) {
|
|
|
21166
21226
|
*/
|
|
21167
21227
|
|
|
21168
21228
|
|
|
21169
|
-
async getInflationReward(addresses, epoch,
|
|
21170
|
-
const
|
|
21171
|
-
|
|
21229
|
+
async getInflationReward(addresses, epoch, commitmentOrConfig) {
|
|
21230
|
+
const {
|
|
21231
|
+
commitment,
|
|
21232
|
+
config
|
|
21233
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21234
|
+
|
|
21235
|
+
const args = this._buildArgs([addresses.map(pubkey => pubkey.toBase58())], commitment, undefined
|
|
21236
|
+
/* encoding */
|
|
21237
|
+
, { ...config,
|
|
21238
|
+
epoch: epoch != null ? epoch : config === null || config === void 0 ? void 0 : config.epoch
|
|
21172
21239
|
});
|
|
21173
21240
|
|
|
21174
21241
|
const unsafeRes = await this._rpcRequest('getInflationReward', args);
|
|
@@ -21185,8 +21252,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21185
21252
|
*/
|
|
21186
21253
|
|
|
21187
21254
|
|
|
21188
|
-
async getEpochInfo(
|
|
21189
|
-
const
|
|
21255
|
+
async getEpochInfo(commitmentOrConfig) {
|
|
21256
|
+
const {
|
|
21257
|
+
commitment,
|
|
21258
|
+
config
|
|
21259
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21260
|
+
|
|
21261
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21262
|
+
/* encoding */
|
|
21263
|
+
, config);
|
|
21190
21264
|
|
|
21191
21265
|
const unsafeRes = await this._rpcRequest('getEpochInfo', args);
|
|
21192
21266
|
const res = create(unsafeRes, GetEpochInfoRpcResult);
|
|
@@ -21357,9 +21431,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
21357
21431
|
*/
|
|
21358
21432
|
|
|
21359
21433
|
|
|
21360
|
-
async getLatestBlockhash(
|
|
21434
|
+
async getLatestBlockhash(commitmentOrConfig) {
|
|
21361
21435
|
try {
|
|
21362
|
-
const res = await this.getLatestBlockhashAndContext(
|
|
21436
|
+
const res = await this.getLatestBlockhashAndContext(commitmentOrConfig);
|
|
21363
21437
|
return res.value;
|
|
21364
21438
|
} catch (e) {
|
|
21365
21439
|
throw new Error('failed to get recent blockhash: ' + e);
|
|
@@ -21371,8 +21445,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21371
21445
|
*/
|
|
21372
21446
|
|
|
21373
21447
|
|
|
21374
|
-
async getLatestBlockhashAndContext(
|
|
21375
|
-
const
|
|
21448
|
+
async getLatestBlockhashAndContext(commitmentOrConfig) {
|
|
21449
|
+
const {
|
|
21450
|
+
commitment,
|
|
21451
|
+
config
|
|
21452
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21453
|
+
|
|
21454
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21455
|
+
/* encoding */
|
|
21456
|
+
, config);
|
|
21376
21457
|
|
|
21377
21458
|
const unsafeRes = await this._rpcRequest('getLatestBlockhash', args);
|
|
21378
21459
|
const res = create(unsafeRes, GetLatestBlockhashRpcResult);
|
|
@@ -21450,8 +21531,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
21450
21531
|
*/
|
|
21451
21532
|
|
|
21452
21533
|
|
|
21453
|
-
async getBlockHeight(
|
|
21454
|
-
const
|
|
21534
|
+
async getBlockHeight(commitmentOrConfig) {
|
|
21535
|
+
const {
|
|
21536
|
+
commitment,
|
|
21537
|
+
config
|
|
21538
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
21539
|
+
|
|
21540
|
+
const args = this._buildArgs([], commitment, undefined
|
|
21541
|
+
/* encoding */
|
|
21542
|
+
, config);
|
|
21455
21543
|
|
|
21456
21544
|
const unsafeRes = await this._rpcRequest('getBlockHeight', args);
|
|
21457
21545
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
@@ -22180,6 +22268,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
22180
22268
|
config.maxRetries = options.maxRetries;
|
|
22181
22269
|
}
|
|
22182
22270
|
|
|
22271
|
+
if (options && options.minContextSlot != null) {
|
|
22272
|
+
config.minContextSlot = options.minContextSlot;
|
|
22273
|
+
}
|
|
22274
|
+
|
|
22183
22275
|
if (skipPreflight) {
|
|
22184
22276
|
config.skipPreflight = skipPreflight;
|
|
22185
22277
|
}
|
|
@@ -30182,7 +30274,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
30182
30274
|
|
|
30183
30275
|
const sendOptions = options && {
|
|
30184
30276
|
skipPreflight: options.skipPreflight,
|
|
30185
|
-
preflightCommitment: options.preflightCommitment || options.commitment
|
|
30277
|
+
preflightCommitment: options.preflightCommitment || options.commitment,
|
|
30278
|
+
minContextSlot: options.minContextSlot
|
|
30186
30279
|
};
|
|
30187
30280
|
const signature = await connection.sendRawTransaction(rawTransaction, sendOptions);
|
|
30188
30281
|
const commitment = options && options.commitment;
|