@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.
- package/dist/adapter/types.d.ts +9 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +6 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/stringify.d.ts +1 -0
- package/package.json +1 -1
package/dist/adapter/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function stringify(value: any, space?: string | number): string;
|