@heyanon/sdk 2.1.2 → 2.1.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AiTool } from '../ai';
|
|
2
|
-
import { EVM, Solana, TON } from '../blockchain';
|
|
3
|
-
import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType
|
|
2
|
+
import { EVM, Solana, TON, WalletType } from '../blockchain';
|
|
3
|
+
import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType } from 'viem';
|
|
4
4
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
5
5
|
import { AdapterTag } from './misc';
|
|
6
6
|
import { Address as TonAddress } from '@ton/ton';
|
|
@@ -11,14 +11,12 @@ export interface FunctionReturn {
|
|
|
11
11
|
type SignTypedDataParameters = Omit<ViemSignTypedDataParameters, 'account'>;
|
|
12
12
|
export interface EvmFunctionOptions {
|
|
13
13
|
readonly getProvider: (chainId: number) => PublicClient;
|
|
14
|
-
readonly getRecipient: () => Promise<EvmAddress>;
|
|
15
14
|
readonly sendTransactions: (props: EVM.types.SendTransactionProps) => Promise<EVM.types.TransactionReturn>;
|
|
16
15
|
readonly signMessages?: (messages: Hex[]) => Promise<SignMessageReturnType[]>;
|
|
17
16
|
readonly signTypedDatas?: (args: SignTypedDataParameters[]) => Promise<SignTypedDataReturnType[]>;
|
|
18
17
|
}
|
|
19
18
|
export interface SolanaFunctionOptions {
|
|
20
19
|
readonly getConnection: () => Connection;
|
|
21
|
-
readonly getRecipient: () => Promise<PublicKey>;
|
|
22
20
|
readonly getPublicKey: () => Promise<PublicKey>;
|
|
23
21
|
readonly sendTransactions: (props: Solana.types.SendTransactionProps) => Promise<Solana.types.TransactionReturn>;
|
|
24
22
|
}
|
|
@@ -32,6 +30,7 @@ export interface FunctionOptions {
|
|
|
32
30
|
readonly solana: SolanaFunctionOptions;
|
|
33
31
|
readonly ton: TonFunctionOptions;
|
|
34
32
|
readonly notify: (message: string) => Promise<void>;
|
|
33
|
+
readonly getRecipient: (type: WalletType) => Promise<string>;
|
|
35
34
|
}
|
|
36
35
|
export interface AdapterExport {
|
|
37
36
|
readonly tools: AiTool[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SenderArguments } from '@ton/core';
|
|
2
2
|
import { TonApiClient } from '@ton-api/client';
|
|
3
3
|
import { ContractAdapter } from '@ton-api/ton-adapter';
|
|
4
|
-
import { Address } from '@ton/ton';
|
|
4
|
+
import { Address, TonClient, TonClient4 } from '@ton/ton';
|
|
5
5
|
export interface TransactionReturnData {
|
|
6
6
|
readonly message: string;
|
|
7
7
|
readonly hash: string;
|
|
@@ -15,5 +15,7 @@ export interface SendTransactionProps {
|
|
|
15
15
|
}
|
|
16
16
|
export interface Client {
|
|
17
17
|
readonly api: TonApiClient;
|
|
18
|
+
readonly client: TonClient;
|
|
19
|
+
readonly client4: TonClient4;
|
|
18
20
|
readonly adapter: ContractAdapter;
|
|
19
21
|
}
|
package/dist/index.js
CHANGED
|
@@ -127,6 +127,14 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
127
127
|
})(Chain || {});
|
|
128
128
|
var allChains = Object.values(Chain);
|
|
129
129
|
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */ && chain !== "ton" /* TON */);
|
|
130
|
+
|
|
131
|
+
// src/blockchain/constants/types.ts
|
|
132
|
+
var WalletType = /* @__PURE__ */ ((WalletType2) => {
|
|
133
|
+
WalletType2["EVM"] = "evm";
|
|
134
|
+
WalletType2["SOLANA"] = "solana";
|
|
135
|
+
WalletType2["TON"] = "ton";
|
|
136
|
+
return WalletType2;
|
|
137
|
+
})(WalletType || {});
|
|
130
138
|
var WETH9 = {
|
|
131
139
|
["ethereum" /* ETHEREUM */]: sdk.ethereumTokens.weth,
|
|
132
140
|
["optimism" /* OPTIMISM */]: sdk.optimismTokens.weth,
|
|
@@ -549,6 +557,7 @@ exports.Chain = Chain;
|
|
|
549
557
|
exports.EVM = evm_exports;
|
|
550
558
|
exports.Solana = solana_exports;
|
|
551
559
|
exports.TON = ton_exports;
|
|
560
|
+
exports.WalletType = WalletType;
|
|
552
561
|
exports.allChains = allChains;
|
|
553
562
|
exports.allEvmChains = allEvmChains;
|
|
554
563
|
exports.retry = retry;
|
package/dist/index.mjs
CHANGED
|
@@ -125,6 +125,14 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
125
125
|
})(Chain || {});
|
|
126
126
|
var allChains = Object.values(Chain);
|
|
127
127
|
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */ && chain !== "ton" /* TON */);
|
|
128
|
+
|
|
129
|
+
// src/blockchain/constants/types.ts
|
|
130
|
+
var WalletType = /* @__PURE__ */ ((WalletType2) => {
|
|
131
|
+
WalletType2["EVM"] = "evm";
|
|
132
|
+
WalletType2["SOLANA"] = "solana";
|
|
133
|
+
WalletType2["TON"] = "ton";
|
|
134
|
+
return WalletType2;
|
|
135
|
+
})(WalletType || {});
|
|
128
136
|
var WETH9 = {
|
|
129
137
|
["ethereum" /* ETHEREUM */]: ethereumTokens.weth,
|
|
130
138
|
["optimism" /* OPTIMISM */]: optimismTokens.weth,
|
|
@@ -542,4 +550,4 @@ async function retry(fn, options) {
|
|
|
542
550
|
// src/utils/sleep.ts
|
|
543
551
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
544
552
|
|
|
545
|
-
export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, ton_exports as TON, allChains, allEvmChains, retry, sleep, toResult };
|
|
553
|
+
export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, ton_exports as TON, WalletType, allChains, allEvmChains, retry, sleep, toResult };
|