@storm-trade/wallet-core 1.0.0 → 1.0.1

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,3 +1,6 @@
1
+ import { Address } from '@ton/ton';
2
+ import { TonClient } from '@ton/ton';
3
+
1
4
  export declare type ActiveSessionsResponse = {
2
5
  addresses: string[];
3
6
  };
@@ -6,12 +9,26 @@ export declare type ConnectResponse = {
6
9
  publicKey: Uint8Array;
7
10
  };
8
11
 
12
+ export declare type CreateTransferRequest = {
13
+ validUntil: number;
14
+ queryId?: number;
15
+ messages: {
16
+ address: string;
17
+ amount: string;
18
+ stateInit?: string;
19
+ payload?: string;
20
+ }[];
21
+ };
22
+
23
+ export declare type CreateTransferResponse = {
24
+ message: Uint8Array;
25
+ hash: Uint8Array;
26
+ signature: Uint8Array;
27
+ };
28
+
9
29
  export declare class IframeAdapter {
10
30
  private readonly host;
11
- private readonly initTimeout;
12
- private readonly connectTimeout;
13
- private readonly signTimeout;
14
- private readonly activeSessionTimeout;
31
+ private readonly timeouts;
15
32
  private readonly waitingForResponse;
16
33
  private iframe?;
17
34
  private state;
@@ -24,16 +41,14 @@ export declare class IframeAdapter {
24
41
  destroy(): void;
25
42
  connect(masterAddress: string): Promise<ConnectResponse>;
26
43
  signMessage(masterAddress: string, message: SignRequest): Promise<SignResponse>;
44
+ createTransfer(masterAddress: string, message: CreateTransferRequest): Promise<CreateTransferResponse>;
27
45
  getActiveSessions(): Promise<ActiveSessionsResponse>;
28
46
  disconnect(masterAddress: string): Promise<void>;
29
47
  }
30
48
 
31
49
  export declare type IframeAdapterProps = {
32
50
  host: string;
33
- initTimeout?: number;
34
- connectTimeout?: number;
35
- signTimeout?: number;
36
- activeSessionTimeout?: number;
51
+ timeouts?: Timeouts;
37
52
  };
38
53
 
39
54
  export declare type PingResponse = {};
@@ -47,4 +62,43 @@ export declare type SignResponse = {
47
62
  signature: Uint8Array;
48
63
  };
49
64
 
65
+ export declare class StormWallet {
66
+ private readonly tonClient;
67
+ private readonly config;
68
+ constructor(tonClient: TonClient, config: StormWalletConfig);
69
+ getSmartAccountAddress(walletAddress: string): Promise<Address>;
70
+ getSmartAccountData(smartAccountAddress: string): Promise<{
71
+ index: bigint;
72
+ collectionAddress: Address;
73
+ masterWalletAddress: Address;
74
+ publicKeys: Buffer<ArrayBufferLike>[];
75
+ adminAddress: Address;
76
+ backendPublicKeys: Buffer<ArrayBufferLike>[];
77
+ seqno: number;
78
+ } | null>;
79
+ createDeploySmartAccountTx(publicKey: Buffer, transferAmount: bigint): {
80
+ address: string;
81
+ payload: string;
82
+ amount: bigint;
83
+ };
84
+ createAddPublicKeyTx(smartAccountAddress: string, publicKey: Buffer): {
85
+ address: string;
86
+ payload: string;
87
+ amount: bigint;
88
+ };
89
+ }
90
+
91
+ declare type StormWalletConfig = {
92
+ smartAccountMasterAddress: string;
93
+ };
94
+
95
+ declare type Timeouts = {
96
+ init?: number;
97
+ connect?: number;
98
+ sign?: number;
99
+ activeSessions?: number;
100
+ createTransfer?: number;
101
+ disconnect?: number;
102
+ };
103
+
50
104
  export { }