@heyanon/sdk 2.1.8 → 2.1.10

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,5 +1,5 @@
1
1
  import { AiTool } from '../ai';
2
- import { EVM, Solana, TON, WalletType } from '../blockchain';
2
+ import { EVM, Solana, TON, WalletType, Chain } from '../blockchain';
3
3
  import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType } from 'viem';
4
4
  import { Connection, PublicKey, Transaction as SolanaTransaction, VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
5
5
  import { AdapterTag } from './misc';
@@ -26,12 +26,20 @@ export interface TonFunctionOptions {
26
26
  readonly getClient: () => Promise<TON.types.Client>;
27
27
  readonly sendTransactions: (props: TON.types.SendTransactionProps) => Promise<TON.types.TransactionReturn>;
28
28
  }
29
+ export interface UserToken {
30
+ readonly chain: Chain;
31
+ readonly name: string;
32
+ readonly symbol: string;
33
+ readonly address: string;
34
+ readonly decimals: number;
35
+ }
29
36
  export interface FunctionOptions {
30
37
  readonly evm: EvmFunctionOptions;
31
38
  readonly solana: SolanaFunctionOptions;
32
39
  readonly ton: TonFunctionOptions;
33
40
  readonly notify: (message: string) => Promise<void>;
34
41
  readonly getRecipient: (type: WalletType) => Promise<string>;
42
+ readonly getUserTokens: () => Promise<UserToken[]>;
35
43
  }
36
44
  export interface AdapterExport {
37
45
  readonly tools: AiTool[];
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.8",
3
+ "version": "2.1.10",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",