@cryptorubic/web3 1.0.0-alpha.no-sdk.2 → 1.0.0-alpha.no-sdk.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "1.0.0-alpha.no-sdk.2",
3
+ "version": "1.0.0-alpha.no-sdk.3",
4
4
  "dependencies": {
5
5
  "@ethersproject/bignumber": "^5.8.0",
6
6
  "@mysten/sui": "^1.24.0",
@@ -33,6 +33,11 @@ export declare class EvmAdapter extends AbstractAdapter<PublicActions & PublicCl
33
33
  multicallByContract<T>(contracts: MulticallParameters, allowErrors?: boolean): Promise<MulticallResponse<T>[]>;
34
34
  multicallByAddress<T>(address: string, abi: Abi, method: string, methodArgs?: unknown[][], allowErrors?: boolean): Promise<MulticallResponse<T>[]>;
35
35
  static encodeMethodCall(contractAddress: string, contractAbi: Abi, method: string, parameters?: unknown[], value?: string): EvmTransactionConfig;
36
+ /**
37
+ * Generate random HEX strings from a given byte size.
38
+ * @param size byte size.
39
+ */
40
+ static randomHex(size: number): string;
36
41
  simulateTransaction(config: EvmTransactionConfig, from: string, timeout?: number): Promise<string>;
37
42
  callForTokensInfo(tokenAddresses: string[] | ReadonlyArray<string>): Promise<Token<EvmBlockchainName>[]>;
38
43
  getGasPrice(): Promise<string>;
@@ -197,6 +197,15 @@ class EvmAdapter extends abstract_adapter_1.AbstractAdapter {
197
197
  throw err;
198
198
  }
199
199
  }
200
+ /**
201
+ * Generate random HEX strings from a given byte size.
202
+ * @param size byte size.
203
+ */
204
+ static randomHex(size) {
205
+ const bytes = new Uint8Array(size);
206
+ crypto.getRandomValues(bytes);
207
+ return (0, viem_1.toHex)(bytes);
208
+ }
200
209
  async simulateTransaction(config, from, timeout = 15000) {
201
210
  try {
202
211
  const callParams = {