starknet 8.2.0 → 8.3.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +55 -29
- package/dist/index.global.js +55 -36
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +55 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7039,7 +7039,7 @@ var Subscription = class {
|
|
|
7039
7039
|
}
|
|
7040
7040
|
};
|
|
7041
7041
|
|
|
7042
|
-
// src/channel/ws/
|
|
7042
|
+
// src/channel/ws/ws_0_9.ts
|
|
7043
7043
|
var WebSocketChannel = class {
|
|
7044
7044
|
/**
|
|
7045
7045
|
* The URL of the WebSocket RPC Node.
|
|
@@ -7387,19 +7387,19 @@ var WebSocketChannel = class {
|
|
|
7387
7387
|
}
|
|
7388
7388
|
/**
|
|
7389
7389
|
* Subscribes to new block headers.
|
|
7390
|
-
* @param {
|
|
7390
|
+
* @param {SubscribeNewHeadsParams} params - The parameters for the subscription.
|
|
7391
7391
|
* @returns {Promise<Subscription<BLOCK_HEADER>>} A Promise that resolves with a `Subscription` object for new block headers.
|
|
7392
7392
|
*/
|
|
7393
|
-
async subscribeNewHeads(
|
|
7393
|
+
async subscribeNewHeads(params = {}) {
|
|
7394
7394
|
const method = "starknet_subscribeNewHeads";
|
|
7395
|
-
const
|
|
7396
|
-
block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
|
|
7395
|
+
const rpcParams = {
|
|
7396
|
+
block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0
|
|
7397
7397
|
};
|
|
7398
|
-
const subId = await this.sendReceive(method,
|
|
7398
|
+
const subId = await this.sendReceive(method, rpcParams);
|
|
7399
7399
|
const subscription = new Subscription({
|
|
7400
7400
|
channel: this,
|
|
7401
7401
|
method,
|
|
7402
|
-
params,
|
|
7402
|
+
params: rpcParams,
|
|
7403
7403
|
id: subId,
|
|
7404
7404
|
maxBufferSize: this.maxBufferSize
|
|
7405
7405
|
});
|
|
@@ -7408,23 +7408,22 @@ var WebSocketChannel = class {
|
|
|
7408
7408
|
}
|
|
7409
7409
|
/**
|
|
7410
7410
|
* Subscribes to events matching a given filter.
|
|
7411
|
-
* @param {
|
|
7412
|
-
* @param {string[][]} [keys] - The event keys to filter by.
|
|
7413
|
-
* @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
|
|
7411
|
+
* @param {SubscribeEventsParams} params - The parameters for the subscription.
|
|
7414
7412
|
* @returns {Promise<Subscription<EMITTED_EVENT>>} A Promise that resolves with a `Subscription` object for the specified events.
|
|
7415
7413
|
*/
|
|
7416
|
-
async subscribeEvents(
|
|
7414
|
+
async subscribeEvents(params = {}) {
|
|
7417
7415
|
const method = "starknet_subscribeEvents";
|
|
7418
|
-
const
|
|
7419
|
-
from_address: fromAddress !== void 0 ? toHex(fromAddress) : void 0,
|
|
7420
|
-
keys,
|
|
7421
|
-
block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
|
|
7416
|
+
const rpcParams = {
|
|
7417
|
+
from_address: params.fromAddress !== void 0 ? toHex(params.fromAddress) : void 0,
|
|
7418
|
+
keys: params.keys,
|
|
7419
|
+
block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0,
|
|
7420
|
+
finality_status: params.finalityStatus
|
|
7422
7421
|
};
|
|
7423
|
-
const subId = await this.sendReceive(method,
|
|
7422
|
+
const subId = await this.sendReceive(method, rpcParams);
|
|
7424
7423
|
const subscription = new Subscription({
|
|
7425
7424
|
channel: this,
|
|
7426
7425
|
method,
|
|
7427
|
-
params,
|
|
7426
|
+
params: rpcParams,
|
|
7428
7427
|
id: subId,
|
|
7429
7428
|
maxBufferSize: this.maxBufferSize
|
|
7430
7429
|
});
|
|
@@ -7433,21 +7432,20 @@ var WebSocketChannel = class {
|
|
|
7433
7432
|
}
|
|
7434
7433
|
/**
|
|
7435
7434
|
* Subscribes to status updates for a specific transaction.
|
|
7436
|
-
* @param {
|
|
7437
|
-
* @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block context. Not typically required.
|
|
7435
|
+
* @param {SubscribeTransactionStatusParams} params - The parameters for the subscription.
|
|
7438
7436
|
* @returns {Promise<Subscription<NEW_TXN_STATUS>>} A Promise that resolves with a `Subscription` object for the transaction's status.
|
|
7439
7437
|
*/
|
|
7440
|
-
async subscribeTransactionStatus(
|
|
7438
|
+
async subscribeTransactionStatus(params) {
|
|
7441
7439
|
const method = "starknet_subscribeTransactionStatus";
|
|
7442
|
-
const
|
|
7443
|
-
transaction_hash: toHex(transactionHash),
|
|
7444
|
-
block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
|
|
7440
|
+
const rpcParams = {
|
|
7441
|
+
transaction_hash: toHex(params.transactionHash),
|
|
7442
|
+
block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0
|
|
7445
7443
|
};
|
|
7446
|
-
const subId = await this.sendReceive(method,
|
|
7444
|
+
const subId = await this.sendReceive(method, rpcParams);
|
|
7447
7445
|
const subscription = new Subscription({
|
|
7448
7446
|
channel: this,
|
|
7449
7447
|
method,
|
|
7450
|
-
params,
|
|
7448
|
+
params: rpcParams,
|
|
7451
7449
|
id: subId,
|
|
7452
7450
|
maxBufferSize: this.maxBufferSize
|
|
7453
7451
|
});
|
|
@@ -7455,22 +7453,43 @@ var WebSocketChannel = class {
|
|
|
7455
7453
|
return subscription;
|
|
7456
7454
|
}
|
|
7457
7455
|
/**
|
|
7458
|
-
* Subscribes to
|
|
7459
|
-
* @param {
|
|
7460
|
-
* @
|
|
7461
|
-
* @returns {Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>} A Promise that resolves with a `Subscription` object for pending transactions.
|
|
7456
|
+
* Subscribes to new transaction receipts.
|
|
7457
|
+
* @param {SubscribeNewTransactionReceiptsParams} params - The parameters for the subscription.
|
|
7458
|
+
* @returns {Promise<Subscription<NewTransactionReceiptsEvent['result']>>} A Promise that resolves with a `Subscription` object for new transaction receipts.
|
|
7462
7459
|
*/
|
|
7463
|
-
async
|
|
7464
|
-
const method = "
|
|
7465
|
-
const
|
|
7466
|
-
|
|
7467
|
-
sender_address: senderAddress && bigNumberishArrayToHexadecimalStringArray(senderAddress)
|
|
7460
|
+
async subscribeNewTransactionReceipts(params = {}) {
|
|
7461
|
+
const method = "starknet_subscribeNewTransactionReceipts";
|
|
7462
|
+
const rpcParams = {
|
|
7463
|
+
finality_status: params.finalityStatus,
|
|
7464
|
+
sender_address: params.senderAddress && bigNumberishArrayToHexadecimalStringArray(params.senderAddress)
|
|
7465
|
+
};
|
|
7466
|
+
const subId = await this.sendReceive(method, rpcParams);
|
|
7467
|
+
const subscription = new Subscription({
|
|
7468
|
+
channel: this,
|
|
7469
|
+
method,
|
|
7470
|
+
params: rpcParams,
|
|
7471
|
+
id: subId,
|
|
7472
|
+
maxBufferSize: this.maxBufferSize
|
|
7473
|
+
});
|
|
7474
|
+
this.activeSubscriptions.set(subId, subscription);
|
|
7475
|
+
return subscription;
|
|
7476
|
+
}
|
|
7477
|
+
/**
|
|
7478
|
+
* Subscribes to new transactions.
|
|
7479
|
+
* @param {SubscribeNewTransactionsParams} params - The parameters for the subscription.
|
|
7480
|
+
* @returns {Promise<Subscription<NewTransactionEvent['result']>>} A Promise that resolves with a `Subscription` object for new transactions.
|
|
7481
|
+
*/
|
|
7482
|
+
async subscribeNewTransactions(params = {}) {
|
|
7483
|
+
const method = "starknet_subscribeNewTransactions";
|
|
7484
|
+
const rpcParams = {
|
|
7485
|
+
finality_status: params.finalityStatus,
|
|
7486
|
+
sender_address: params.senderAddress && bigNumberishArrayToHexadecimalStringArray(params.senderAddress)
|
|
7468
7487
|
};
|
|
7469
|
-
const subId = await this.sendReceive(method,
|
|
7488
|
+
const subId = await this.sendReceive(method, rpcParams);
|
|
7470
7489
|
const subscription = new Subscription({
|
|
7471
7490
|
channel: this,
|
|
7472
7491
|
method,
|
|
7473
|
-
params,
|
|
7492
|
+
params: rpcParams,
|
|
7474
7493
|
id: subId,
|
|
7475
7494
|
maxBufferSize: this.maxBufferSize
|
|
7476
7495
|
});
|