@heyanon/sdk 2.0.4 → 2.1.0
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 +10 -3
- package/dist/blockchain/constants/chains.d.ts +3 -2
- package/dist/blockchain/index.d.ts +1 -0
- package/dist/blockchain/ton/index.d.ts +1 -0
- package/dist/blockchain/ton/types.d.ts +19 -0
- package/dist/index.js +12 -1
- package/dist/index.mjs +12 -2
- package/package.json +5 -1
package/dist/adapter/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AiTool } from '../ai';
|
|
2
|
-
import { EVM, Solana } from '../blockchain';
|
|
3
|
-
import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType, Address } from 'viem';
|
|
2
|
+
import { EVM, Solana, TON } from '../blockchain';
|
|
3
|
+
import { Hex, PublicClient, SignMessageReturnType, SignTypedDataParameters as ViemSignTypedDataParameters, SignTypedDataReturnType, Address as EvmAddress } from 'viem';
|
|
4
4
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
5
5
|
import { AdapterTag } from './misc';
|
|
6
|
+
import { Address as TonAddress } from '@ton/ton';
|
|
6
7
|
export interface FunctionReturn {
|
|
7
8
|
readonly success: boolean;
|
|
8
9
|
readonly data: string;
|
|
@@ -10,7 +11,7 @@ export interface FunctionReturn {
|
|
|
10
11
|
type SignTypedDataParameters = Omit<ViemSignTypedDataParameters, 'account'>;
|
|
11
12
|
export interface EvmFunctionOptions {
|
|
12
13
|
readonly getProvider: (chainId: number) => PublicClient;
|
|
13
|
-
readonly getRecipient: () => Promise<
|
|
14
|
+
readonly getRecipient: () => Promise<EvmAddress>;
|
|
14
15
|
readonly sendTransactions: (props: EVM.types.SendTransactionProps) => Promise<EVM.types.TransactionReturn>;
|
|
15
16
|
readonly signMessages?: (messages: Hex[]) => Promise<SignMessageReturnType[]>;
|
|
16
17
|
readonly signTypedDatas?: (args: SignTypedDataParameters[]) => Promise<SignTypedDataReturnType[]>;
|
|
@@ -21,9 +22,15 @@ export interface SolanaFunctionOptions {
|
|
|
21
22
|
readonly getPublicKey: () => Promise<PublicKey>;
|
|
22
23
|
readonly sendTransactions: (props: Solana.types.SendTransactionProps) => Promise<Solana.types.TransactionReturn>;
|
|
23
24
|
}
|
|
25
|
+
export interface TonFunctionOptions {
|
|
26
|
+
readonly getAddress: () => Promise<TonAddress>;
|
|
27
|
+
readonly getClient: () => Promise<TON.types.Client>;
|
|
28
|
+
readonly sendTransactions: (props: TON.types.SendTransactionProps) => Promise<TON.types.TransactionReturn>;
|
|
29
|
+
}
|
|
24
30
|
export interface FunctionOptions {
|
|
25
31
|
readonly evm: EvmFunctionOptions;
|
|
26
32
|
readonly solana: SolanaFunctionOptions;
|
|
33
|
+
readonly ton: TonFunctionOptions;
|
|
27
34
|
readonly notify: (message: string) => Promise<void>;
|
|
28
35
|
}
|
|
29
36
|
export interface AdapterExport {
|
|
@@ -13,8 +13,9 @@ export declare enum Chain {
|
|
|
13
13
|
AVALANCHE = "avalanche",
|
|
14
14
|
ARBITRUM = "arbitrum",
|
|
15
15
|
SCROLL = "scroll",
|
|
16
|
-
SOLANA = "solana"
|
|
16
|
+
SOLANA = "solana",
|
|
17
|
+
TON = "ton"
|
|
17
18
|
}
|
|
18
|
-
export type EvmChain = Exclude<Chain, Chain.SOLANA>;
|
|
19
|
+
export type EvmChain = Exclude<Chain, Chain.SOLANA | Chain.TON>;
|
|
19
20
|
export declare const allChains: Chain[];
|
|
20
21
|
export declare const allEvmChains: (Chain.ETHEREUM | Chain.OPTIMISM | Chain.BSC | Chain.GNOSIS | Chain.POLYGON | Chain.SONIC | Chain.ZKSYNC | Chain.METIS | Chain.KAVA_EVM | Chain.BASE | Chain.IOTA_EVM | Chain.AVALANCHE | Chain.ARBITRUM | Chain.SCROLL)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as types from './types';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SenderArguments } from '@ton/core';
|
|
2
|
+
import { TonApiClient } from '@ton-api/client';
|
|
3
|
+
import { ContractAdapter } from '@ton-api/ton-adapter';
|
|
4
|
+
import { Address } from '@ton/ton';
|
|
5
|
+
export interface TransactionReturnData {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly hash: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TransactionReturn {
|
|
10
|
+
readonly data: TransactionReturnData[];
|
|
11
|
+
}
|
|
12
|
+
export interface SendTransactionProps {
|
|
13
|
+
readonly account: Address;
|
|
14
|
+
readonly transactions: SenderArguments[];
|
|
15
|
+
}
|
|
16
|
+
export interface Client {
|
|
17
|
+
readonly api: TonApiClient;
|
|
18
|
+
readonly adapter: ContractAdapter;
|
|
19
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -122,10 +122,11 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
122
122
|
Chain2["ARBITRUM"] = "arbitrum";
|
|
123
123
|
Chain2["SCROLL"] = "scroll";
|
|
124
124
|
Chain2["SOLANA"] = "solana";
|
|
125
|
+
Chain2["TON"] = "ton";
|
|
125
126
|
return Chain2;
|
|
126
127
|
})(Chain || {});
|
|
127
128
|
var allChains = Object.values(Chain);
|
|
128
|
-
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */);
|
|
129
|
+
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */ && chain !== "ton" /* TON */);
|
|
129
130
|
var WETH9 = {
|
|
130
131
|
["ethereum" /* ETHEREUM */]: sdk.ethereumTokens.weth,
|
|
131
132
|
["optimism" /* OPTIMISM */]: sdk.optimismTokens.weth,
|
|
@@ -511,6 +512,15 @@ function toPublicKey(publicKey) {
|
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
514
|
|
|
515
|
+
// src/blockchain/ton/index.ts
|
|
516
|
+
var ton_exports = {};
|
|
517
|
+
__export(ton_exports, {
|
|
518
|
+
types: () => types_exports3
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
// src/blockchain/ton/types.ts
|
|
522
|
+
var types_exports3 = {};
|
|
523
|
+
|
|
514
524
|
// src/utils/retry.ts
|
|
515
525
|
function delay(ms) {
|
|
516
526
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -538,6 +548,7 @@ exports.AdapterTag = AdapterTag;
|
|
|
538
548
|
exports.Chain = Chain;
|
|
539
549
|
exports.EVM = evm_exports;
|
|
540
550
|
exports.Solana = solana_exports;
|
|
551
|
+
exports.TON = ton_exports;
|
|
541
552
|
exports.allChains = allChains;
|
|
542
553
|
exports.allEvmChains = allEvmChains;
|
|
543
554
|
exports.retry = retry;
|
package/dist/index.mjs
CHANGED
|
@@ -120,10 +120,11 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
120
120
|
Chain2["ARBITRUM"] = "arbitrum";
|
|
121
121
|
Chain2["SCROLL"] = "scroll";
|
|
122
122
|
Chain2["SOLANA"] = "solana";
|
|
123
|
+
Chain2["TON"] = "ton";
|
|
123
124
|
return Chain2;
|
|
124
125
|
})(Chain || {});
|
|
125
126
|
var allChains = Object.values(Chain);
|
|
126
|
-
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */);
|
|
127
|
+
var allEvmChains = Object.values(Chain).filter((chain) => chain !== "solana" /* SOLANA */ && chain !== "ton" /* TON */);
|
|
127
128
|
var WETH9 = {
|
|
128
129
|
["ethereum" /* ETHEREUM */]: ethereumTokens.weth,
|
|
129
130
|
["optimism" /* OPTIMISM */]: optimismTokens.weth,
|
|
@@ -509,6 +510,15 @@ function toPublicKey(publicKey) {
|
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
512
|
|
|
513
|
+
// src/blockchain/ton/index.ts
|
|
514
|
+
var ton_exports = {};
|
|
515
|
+
__export(ton_exports, {
|
|
516
|
+
types: () => types_exports3
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// src/blockchain/ton/types.ts
|
|
520
|
+
var types_exports3 = {};
|
|
521
|
+
|
|
512
522
|
// src/utils/retry.ts
|
|
513
523
|
function delay(ms) {
|
|
514
524
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -532,4 +542,4 @@ async function retry(fn, options) {
|
|
|
532
542
|
// src/utils/sleep.ts
|
|
533
543
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
534
544
|
|
|
535
|
-
export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, allChains, allEvmChains, retry, sleep, toResult };
|
|
545
|
+
export { AdapterTag, Chain, evm_exports as EVM, solana_exports as Solana, ton_exports as TON, allChains, allEvmChains, retry, sleep, toResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyanon/sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@real-wagmi/sdk": "^1.4.5",
|
|
45
45
|
"@solana/web3.js": "^1.98.0",
|
|
46
|
+
"@ton-api/client": "^0.3.1",
|
|
47
|
+
"@ton-api/ton-adapter": "0.3.0",
|
|
48
|
+
"@ton/core": "^0.60.0",
|
|
49
|
+
"@ton/ton": "^15.2.0",
|
|
46
50
|
"viem": "^2.22.7",
|
|
47
51
|
"vitest": "^2.1.8"
|
|
48
52
|
}
|