@heyanon/sdk 2.1.9 → 2.1.11

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.
@@ -1,9 +1,10 @@
1
1
  import { AiTool } from '../ai';
2
2
  import { EVM, Solana, TON, WalletType, Chain } from '../blockchain';
3
- import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType } from 'viem';
3
+ import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType, Address } from 'viem';
4
4
  import { Connection, PublicKey, Transaction as SolanaTransaction, VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
5
5
  import { AdapterTag } from './misc';
6
6
  import { Address as TonAddress } from '@ton/ton';
7
+ import { DeployContractProps } from '../blockchain/evm/types';
7
8
  export interface FunctionReturn {
8
9
  readonly success: boolean;
9
10
  readonly data: string;
@@ -12,6 +13,7 @@ type SignTypedDataParameters = Omit<ViemSignTypedDataParameters, 'account'>;
12
13
  export interface EvmFunctionOptions {
13
14
  readonly getProvider: (chainId: number) => PublicClient;
14
15
  readonly sendTransactions: (props: EVM.types.SendTransactionProps) => Promise<EVM.types.TransactionReturn>;
16
+ readonly deployContracts: (props: DeployContractProps[]) => Promise<Address[]>;
15
17
  readonly signMessages?: (messages: Hex[]) => Promise<SignMessageReturnType[]>;
16
18
  readonly signTypedDatas?: (args: SignTypedDataParameters[]) => Promise<SignTypedDataReturnType[]>;
17
19
  }
@@ -1,4 +1,4 @@
1
- import { Address, Hex } from 'viem';
1
+ import { Abi, Address, Hex } from 'viem';
2
2
  export interface TransactionParams {
3
3
  readonly target: Address;
4
4
  readonly data: Hex;
@@ -18,3 +18,9 @@ export interface SendTransactionProps {
18
18
  readonly account: Address;
19
19
  readonly transactions: TransactionParams[];
20
20
  }
21
+ export interface DeployContractProps {
22
+ readonly chainId: number;
23
+ readonly abi: Abi | unknown[];
24
+ readonly bytecode: Hex;
25
+ readonly args?: unknown[];
26
+ }
package/dist/index.js CHANGED
@@ -556,6 +556,11 @@ async function retry(fn, options) {
556
556
  // src/utils/sleep.ts
557
557
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
558
558
 
559
+ // src/utils/stringify.ts
560
+ function stringify(value, space) {
561
+ return JSON.stringify(value, (_key, value2) => typeof value2 === "bigint" ? value2.toString() : value2, space);
562
+ }
563
+
559
564
  exports.AdapterTag = AdapterTag;
560
565
  exports.Chain = Chain;
561
566
  exports.EVM = evm_exports;
@@ -566,4 +571,5 @@ exports.allChains = allChains;
566
571
  exports.allEvmChains = allEvmChains;
567
572
  exports.retry = retry;
568
573
  exports.sleep = sleep;
574
+ exports.stringify = stringify;
569
575
  exports.toResult = toResult;
package/dist/index.mjs CHANGED
@@ -554,4 +554,9 @@ async function retry(fn, options) {
554
554
  // src/utils/sleep.ts
555
555
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
556
556
 
557
- export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, ton_exports as TON, WalletType, allChains, allEvmChains, retry, sleep, toResult };
557
+ // src/utils/stringify.ts
558
+ function stringify(value, space) {
559
+ return JSON.stringify(value, (_key, value2) => typeof value2 === "bigint" ? value2.toString() : value2, space);
560
+ }
561
+
562
+ export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, ton_exports as TON, WalletType, allChains, allEvmChains, retry, sleep, stringify, toResult };
@@ -1,2 +1,3 @@
1
1
  export * from './retry';
2
2
  export * from './sleep';
3
+ export * from './stringify';
@@ -0,0 +1 @@
1
+ export declare function stringify(value: any, space?: string | number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyanon/sdk",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",