@metoncash/sdk-v1 0.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.
@@ -0,0 +1,308 @@
1
+ import * as c from '@ton/core';
2
+ import { ContractProvider, Sender, SendMode } from '@ton/core';
3
+ type RemainingBitsAndRefs = c.Slice;
4
+ export type CellRef<T> = {
5
+ ref: T;
6
+ };
7
+ type coins = bigint;
8
+ type uint64 = bigint;
9
+ /**
10
+ > struct JettonWalletStorage {
11
+ > balance: coins
12
+ > owner: address
13
+ > master: address
14
+ > }
15
+ */
16
+ export interface JettonWalletStorage {
17
+ readonly $: 'JettonWalletStorage';
18
+ balance: coins;
19
+ owner: c.Address;
20
+ master: c.Address;
21
+ }
22
+ export declare const JettonWalletStorage: {
23
+ create(args: {
24
+ balance?: coins;
25
+ owner: c.Address;
26
+ master: c.Address;
27
+ }): JettonWalletStorage;
28
+ fromSlice(s: c.Slice): JettonWalletStorage;
29
+ store(self: JettonWalletStorage, b: c.Builder): void;
30
+ toCell(self: JettonWalletStorage): c.Cell;
31
+ };
32
+ /**
33
+ > struct JettonWalletStorageRuntime {
34
+ > balance: coins
35
+ > owner: address
36
+ > master: address
37
+ > }
38
+ */
39
+ export interface JettonWalletStorageRuntime {
40
+ readonly $: 'JettonWalletStorageRuntime';
41
+ balance: coins;
42
+ owner: c.Address;
43
+ master: c.Address;
44
+ }
45
+ export declare const JettonWalletStorageRuntime: {
46
+ create(args: {
47
+ balance: coins;
48
+ owner: c.Address;
49
+ master: c.Address;
50
+ }): JettonWalletStorageRuntime;
51
+ fromSlice(s: c.Slice): JettonWalletStorageRuntime;
52
+ store(self: JettonWalletStorageRuntime, b: c.Builder): void;
53
+ toCell(self: JettonWalletStorageRuntime): c.Cell;
54
+ };
55
+ /**
56
+ > struct (0x0f8a7ea5) JettonTransfer {
57
+ > queryId: uint64
58
+ > jettonAmount: coins
59
+ > transferRecipient: address
60
+ > sendExcessesTo: address?
61
+ > customPayload: cell?
62
+ > forwardTonAmount: coins
63
+ > forwardPayload: RemainingBitsAndRefs
64
+ > }
65
+ */
66
+ export interface JettonTransfer {
67
+ readonly $: 'JettonTransfer';
68
+ queryId: uint64;
69
+ jettonAmount: coins;
70
+ transferRecipient: c.Address;
71
+ sendExcessesTo: c.Address | null;
72
+ customPayload: c.Cell | null;
73
+ forwardTonAmount: coins;
74
+ forwardPayload: RemainingBitsAndRefs;
75
+ }
76
+ export declare const JettonTransfer: {
77
+ PREFIX: number;
78
+ create(args: {
79
+ queryId: uint64;
80
+ jettonAmount: coins;
81
+ transferRecipient: c.Address;
82
+ sendExcessesTo: c.Address | null;
83
+ customPayload: c.Cell | null;
84
+ forwardTonAmount: coins;
85
+ forwardPayload: RemainingBitsAndRefs;
86
+ }): JettonTransfer;
87
+ fromSlice(s: c.Slice): JettonTransfer;
88
+ store(self: JettonTransfer, b: c.Builder): void;
89
+ toCell(self: JettonTransfer): c.Cell;
90
+ };
91
+ /**
92
+ > struct (0x7362d09c) JettonTransferNotification {
93
+ > queryId: uint64
94
+ > jettonAmount: coins
95
+ > from: address
96
+ > forwardPayload: RemainingBitsAndRefs
97
+ > }
98
+ */
99
+ export interface JettonTransferNotification {
100
+ readonly $: 'JettonTransferNotification';
101
+ queryId: uint64;
102
+ jettonAmount: coins;
103
+ from: c.Address;
104
+ forwardPayload: RemainingBitsAndRefs;
105
+ }
106
+ export declare const JettonTransferNotification: {
107
+ PREFIX: number;
108
+ create(args: {
109
+ queryId: uint64;
110
+ jettonAmount: coins;
111
+ from: c.Address;
112
+ forwardPayload: RemainingBitsAndRefs;
113
+ }): JettonTransferNotification;
114
+ fromSlice(s: c.Slice): JettonTransferNotification;
115
+ store(self: JettonTransferNotification, b: c.Builder): void;
116
+ toCell(self: JettonTransferNotification): c.Cell;
117
+ };
118
+ /**
119
+ > struct (0x178d4519) JettonInternalTransfer {
120
+ > queryId: uint64
121
+ > jettonAmount: coins
122
+ > transferInitiator: address
123
+ > sendExcessesTo: address?
124
+ > forwardTonAmount: coins
125
+ > forwardPayload: RemainingBitsAndRefs
126
+ > }
127
+ */
128
+ export interface JettonInternalTransfer {
129
+ readonly $: 'JettonInternalTransfer';
130
+ queryId: uint64;
131
+ jettonAmount: coins;
132
+ transferInitiator: c.Address;
133
+ sendExcessesTo: c.Address | null;
134
+ forwardTonAmount: coins;
135
+ forwardPayload: RemainingBitsAndRefs;
136
+ }
137
+ export declare const JettonInternalTransfer: {
138
+ PREFIX: number;
139
+ create(args: {
140
+ queryId: uint64;
141
+ jettonAmount: coins;
142
+ transferInitiator: c.Address;
143
+ sendExcessesTo: c.Address | null;
144
+ forwardTonAmount: coins;
145
+ forwardPayload: RemainingBitsAndRefs;
146
+ }): JettonInternalTransfer;
147
+ fromSlice(s: c.Slice): JettonInternalTransfer;
148
+ store(self: JettonInternalTransfer, b: c.Builder): void;
149
+ toCell(self: JettonInternalTransfer): c.Cell;
150
+ };
151
+ /**
152
+ > struct (0xd53276db) JettonExcesses {
153
+ > queryId: uint64
154
+ > }
155
+ */
156
+ export interface JettonExcesses {
157
+ readonly $: 'JettonExcesses';
158
+ queryId: uint64;
159
+ }
160
+ export declare const JettonExcesses: {
161
+ PREFIX: number;
162
+ create(args: {
163
+ queryId: uint64;
164
+ }): JettonExcesses;
165
+ fromSlice(s: c.Slice): JettonExcesses;
166
+ store(self: JettonExcesses, b: c.Builder): void;
167
+ toCell(self: JettonExcesses): c.Cell;
168
+ };
169
+ /**
170
+ > struct (0x595f07bc) JettonBurn {
171
+ > queryId: uint64
172
+ > jettonAmount: coins
173
+ > sendExcessesTo: address?
174
+ > customPayload: cell?
175
+ > }
176
+ */
177
+ export interface JettonBurn {
178
+ readonly $: 'JettonBurn';
179
+ queryId: uint64;
180
+ jettonAmount: coins;
181
+ sendExcessesTo: c.Address | null;
182
+ customPayload: c.Cell | null;
183
+ }
184
+ export declare const JettonBurn: {
185
+ PREFIX: number;
186
+ create(args: {
187
+ queryId: uint64;
188
+ jettonAmount: coins;
189
+ sendExcessesTo: c.Address | null;
190
+ customPayload: c.Cell | null;
191
+ }): JettonBurn;
192
+ fromSlice(s: c.Slice): JettonBurn;
193
+ store(self: JettonBurn, b: c.Builder): void;
194
+ toCell(self: JettonBurn): c.Cell;
195
+ };
196
+ /**
197
+ > struct (0x7bdd97de) JettonBurnNotification {
198
+ > queryId: uint64
199
+ > jettonAmount: coins
200
+ > burnInitiator: address
201
+ > sendExcessesTo: address?
202
+ > }
203
+ */
204
+ export interface JettonBurnNotification {
205
+ readonly $: 'JettonBurnNotification';
206
+ queryId: uint64;
207
+ jettonAmount: coins;
208
+ burnInitiator: c.Address;
209
+ sendExcessesTo: c.Address | null;
210
+ }
211
+ export declare const JettonBurnNotification: {
212
+ PREFIX: number;
213
+ create(args: {
214
+ queryId: uint64;
215
+ jettonAmount: coins;
216
+ burnInitiator: c.Address;
217
+ sendExcessesTo: c.Address | null;
218
+ }): JettonBurnNotification;
219
+ fromSlice(s: c.Slice): JettonBurnNotification;
220
+ store(self: JettonBurnNotification, b: c.Builder): void;
221
+ toCell(self: JettonBurnNotification): c.Cell;
222
+ };
223
+ interface ExtraSendOptions {
224
+ bounce?: boolean;
225
+ sendMode?: SendMode;
226
+ extraCurrencies?: c.ExtraCurrency;
227
+ }
228
+ interface DeployedAddrOptions {
229
+ workchain?: number;
230
+ toShard?: {
231
+ fixedPrefixLength: number;
232
+ closeTo: c.Address;
233
+ };
234
+ overrideContractCode?: c.Cell;
235
+ }
236
+ export declare class JettonWallet implements c.Contract {
237
+ static Errors: {
238
+ ERR_INSUFFICIENT_BALANCE: number;
239
+ ERR_NOT_OWNER: number;
240
+ ERR_NOT_VALID_SOURCE: number;
241
+ 'Errors.InvalidWorkchain': number;
242
+ };
243
+ readonly address: c.Address;
244
+ readonly init: {
245
+ code: c.Cell;
246
+ data: c.Cell;
247
+ } | undefined;
248
+ protected constructor(address: c.Address, init?: {
249
+ code: c.Cell;
250
+ data: c.Cell;
251
+ });
252
+ static fromAddress(address: c.Address): JettonWallet;
253
+ static createCellOfJettonTransfer(body: {
254
+ queryId: uint64;
255
+ jettonAmount: coins;
256
+ transferRecipient: c.Address;
257
+ sendExcessesTo: c.Address | null;
258
+ customPayload: c.Cell | null;
259
+ forwardTonAmount: coins;
260
+ forwardPayload: RemainingBitsAndRefs;
261
+ }): c.Cell;
262
+ static createCellOfJettonInternalTransfer(body: {
263
+ queryId: uint64;
264
+ jettonAmount: coins;
265
+ transferInitiator: c.Address;
266
+ sendExcessesTo: c.Address | null;
267
+ forwardTonAmount: coins;
268
+ forwardPayload: RemainingBitsAndRefs;
269
+ }): c.Cell;
270
+ static createCellOfJettonBurn(body: {
271
+ queryId: uint64;
272
+ jettonAmount: coins;
273
+ sendExcessesTo: c.Address | null;
274
+ customPayload: c.Cell | null;
275
+ }): c.Cell;
276
+ sendDeploy(provider: ContractProvider, via: Sender, msgValue: coins, extraOptions?: ExtraSendOptions): Promise<void>;
277
+ sendJettonTransfer(provider: ContractProvider, via: Sender, msgValue: coins, body: {
278
+ queryId: uint64;
279
+ jettonAmount: coins;
280
+ transferRecipient: c.Address;
281
+ sendExcessesTo: c.Address | null;
282
+ customPayload: c.Cell | null;
283
+ forwardTonAmount: coins;
284
+ forwardPayload: RemainingBitsAndRefs;
285
+ }, extraOptions?: ExtraSendOptions): Promise<void>;
286
+ sendJettonInternalTransfer(provider: ContractProvider, via: Sender, msgValue: coins, body: {
287
+ queryId: uint64;
288
+ jettonAmount: coins;
289
+ transferInitiator: c.Address;
290
+ sendExcessesTo: c.Address | null;
291
+ forwardTonAmount: coins;
292
+ forwardPayload: RemainingBitsAndRefs;
293
+ }, extraOptions?: ExtraSendOptions): Promise<void>;
294
+ sendJettonBurn(provider: ContractProvider, via: Sender, msgValue: coins, body: {
295
+ queryId: uint64;
296
+ jettonAmount: coins;
297
+ sendExcessesTo: c.Address | null;
298
+ customPayload: c.Cell | null;
299
+ }, extraOptions?: ExtraSendOptions): Promise<void>;
300
+ getWalletStorage(provider: ContractProvider): Promise<JettonWalletStorageRuntime>;
301
+ getWalletData(provider: ContractProvider): Promise<[
302
+ coins,
303
+ c.Address,
304
+ c.Address,
305
+ c.Cell
306
+ ]>;
307
+ }
308
+ export {};