@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.cjs.js CHANGED
@@ -2978,6 +2978,17 @@ const GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(superstruct.arr
2978
2978
  memo: superstruct.nullable(superstruct.string()),
2979
2979
  blockTime: superstruct.optional(superstruct.nullable(superstruct.number()))
2980
2980
  })));
2981
+ /**
2982
+ * Expected JSON RPC response for the "getSignaturesForAddress" message
2983
+ */
2984
+
2985
+ const GetSignaturesForAddressRpcResult = jsonRpcResult(superstruct.array(superstruct.type({
2986
+ signature: superstruct.string(),
2987
+ slot: superstruct.number(),
2988
+ err: TransactionErrorResult,
2989
+ memo: superstruct.nullable(superstruct.string()),
2990
+ blockTime: superstruct.optional(superstruct.nullable(superstruct.number()))
2991
+ })));
2981
2992
  /***
2982
2993
  * Expected JSON RPC response for the "accountNotification" message
2983
2994
  */
@@ -4563,6 +4574,28 @@ class Connection {
4563
4574
 
4564
4575
  return res.result;
4565
4576
  }
4577
+ /**
4578
+ * Returns confirmed signatures for transactions involving an
4579
+ * address backwards in time from the provided signature or most recent confirmed block
4580
+ *
4581
+ *
4582
+ * @param address queried address
4583
+ * @param options
4584
+ */
4585
+
4586
+
4587
+ async getSignaturesForAddress(address, options, commitment) {
4588
+ const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
4589
+
4590
+ const unsafeRes = await this._rpcRequest('getSignaturesForAddress', args);
4591
+ const res = superstruct.create(unsafeRes, GetSignaturesForAddressRpcResult);
4592
+
4593
+ if ('error' in res) {
4594
+ throw new Error('failed to get signatures for address: ' + res.error.message);
4595
+ }
4596
+
4597
+ return res.result;
4598
+ }
4566
4599
  /**
4567
4600
  * Fetch the contents of a Nonce account from the cluster, return with context
4568
4601
  */