@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.
- package/README.md +76 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +128 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +41 -0
- package/dist/jubjub.d.ts +25 -0
- package/dist/jubjub.js +121 -0
- package/dist/mimc.d.ts +4 -0
- package/dist/mimc.js +21 -0
- package/dist/note.d.ts +38 -0
- package/dist/note.js +55 -0
- package/dist/prover.d.ts +79 -0
- package/dist/prover.js +144 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/keys.d.ts +23 -0
- package/dist/utils/keys.js +28 -0
- package/dist/utils/note.d.ts +30 -0
- package/dist/utils/note.js +27 -0
- package/dist/wrappers/Account.gen.d.ts +542 -0
- package/dist/wrappers/Account.gen.js +677 -0
- package/dist/wrappers/Factory.gen.d.ts +265 -0
- package/dist/wrappers/Factory.gen.js +401 -0
- package/dist/wrappers/JettonMinter.gen.d.ts +288 -0
- package/dist/wrappers/JettonMinter.gen.js +432 -0
- package/dist/wrappers/JettonWallet.gen.d.ts +308 -0
- package/dist/wrappers/JettonWallet.gen.js +429 -0
- package/dist/wrappers/Minter.gen.d.ts +511 -0
- package/dist/wrappers/Minter.gen.js +700 -0
- package/dist/wrappers/Wallet.gen.d.ts +588 -0
- package/dist/wrappers/Wallet.gen.js +720 -0
- package/dist/wrappers/index.d.ts +15 -0
- package/dist/wrappers/index.js +21 -0
- package/package.json +26 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as c from '@ton/core';
|
|
2
|
+
import { ContractProvider, Sender, SendMode } from '@ton/core';
|
|
3
|
+
export type CellRef<T> = {
|
|
4
|
+
ref: T;
|
|
5
|
+
};
|
|
6
|
+
type coins = bigint;
|
|
7
|
+
type uint32 = bigint;
|
|
8
|
+
type uint64 = bigint;
|
|
9
|
+
/**
|
|
10
|
+
> struct (0xd53276db) ExcessMessage {
|
|
11
|
+
> queryId: uint64
|
|
12
|
+
> }
|
|
13
|
+
*/
|
|
14
|
+
export interface ExcessMessage {
|
|
15
|
+
readonly $: 'ExcessMessage';
|
|
16
|
+
queryId: uint64;
|
|
17
|
+
}
|
|
18
|
+
export declare const ExcessMessage: {
|
|
19
|
+
PREFIX: number;
|
|
20
|
+
create(args: {
|
|
21
|
+
queryId: uint64;
|
|
22
|
+
}): ExcessMessage;
|
|
23
|
+
fromSlice(s: c.Slice): ExcessMessage;
|
|
24
|
+
store(self: ExcessMessage, b: c.Builder): void;
|
|
25
|
+
toCell(self: ExcessMessage): c.Cell;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
> struct FactoryRuntimeStorage {
|
|
29
|
+
> id: uint32
|
|
30
|
+
> owner: address
|
|
31
|
+
> minterCode: cell
|
|
32
|
+
> walletCode: cell
|
|
33
|
+
> }
|
|
34
|
+
*/
|
|
35
|
+
export interface FactoryRuntimeStorage {
|
|
36
|
+
readonly $: 'FactoryRuntimeStorage';
|
|
37
|
+
id: uint32;
|
|
38
|
+
owner: c.Address;
|
|
39
|
+
minterCode: c.Cell;
|
|
40
|
+
walletCode: c.Cell;
|
|
41
|
+
}
|
|
42
|
+
export declare const FactoryRuntimeStorage: {
|
|
43
|
+
create(args: {
|
|
44
|
+
id: uint32;
|
|
45
|
+
owner: c.Address;
|
|
46
|
+
minterCode: c.Cell;
|
|
47
|
+
walletCode: c.Cell;
|
|
48
|
+
}): FactoryRuntimeStorage;
|
|
49
|
+
fromSlice(s: c.Slice): FactoryRuntimeStorage;
|
|
50
|
+
store(self: FactoryRuntimeStorage, b: c.Builder): void;
|
|
51
|
+
toCell(self: FactoryRuntimeStorage): c.Cell;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
> struct FactoryStorage {
|
|
55
|
+
> id: uint32
|
|
56
|
+
> owner: address
|
|
57
|
+
> minterCode: cell
|
|
58
|
+
> walletCode: cell
|
|
59
|
+
> }
|
|
60
|
+
*/
|
|
61
|
+
export interface FactoryStorage {
|
|
62
|
+
readonly $: 'FactoryStorage';
|
|
63
|
+
id: uint32;
|
|
64
|
+
owner: c.Address;
|
|
65
|
+
minterCode: c.Cell;
|
|
66
|
+
walletCode: c.Cell;
|
|
67
|
+
}
|
|
68
|
+
export declare const FactoryStorage: {
|
|
69
|
+
create(args: {
|
|
70
|
+
id: uint32;
|
|
71
|
+
owner: c.Address;
|
|
72
|
+
minterCode: c.Cell;
|
|
73
|
+
walletCode: c.Cell;
|
|
74
|
+
}): FactoryStorage;
|
|
75
|
+
fromSlice(s: c.Slice): FactoryStorage;
|
|
76
|
+
store(self: FactoryStorage, b: c.Builder): void;
|
|
77
|
+
toCell(self: FactoryStorage): c.Cell;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
> struct (0xcb639242) InitMinter {
|
|
81
|
+
> queryId: uint64
|
|
82
|
+
> minterId: uint32
|
|
83
|
+
> jettonMinter: address
|
|
84
|
+
> jettonWallet: address
|
|
85
|
+
> }
|
|
86
|
+
*/
|
|
87
|
+
export interface InitMinter {
|
|
88
|
+
readonly $: 'InitMinter';
|
|
89
|
+
queryId: uint64;
|
|
90
|
+
minterId: uint32;
|
|
91
|
+
jettonMinter: c.Address;
|
|
92
|
+
jettonWallet: c.Address;
|
|
93
|
+
}
|
|
94
|
+
export declare const InitMinter: {
|
|
95
|
+
PREFIX: number;
|
|
96
|
+
create(args: {
|
|
97
|
+
queryId: uint64;
|
|
98
|
+
minterId: uint32;
|
|
99
|
+
jettonMinter: c.Address;
|
|
100
|
+
jettonWallet: c.Address;
|
|
101
|
+
}): InitMinter;
|
|
102
|
+
fromSlice(s: c.Slice): InitMinter;
|
|
103
|
+
store(self: InitMinter, b: c.Builder): void;
|
|
104
|
+
toCell(self: InitMinter): c.Cell;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
> struct (0x53a9192c) ResetGas {
|
|
108
|
+
> queryId: uint64
|
|
109
|
+
> excess: address
|
|
110
|
+
> }
|
|
111
|
+
*/
|
|
112
|
+
export interface ResetGas {
|
|
113
|
+
readonly $: 'ResetGas';
|
|
114
|
+
queryId: uint64;
|
|
115
|
+
excess: c.Address;
|
|
116
|
+
}
|
|
117
|
+
export declare const ResetGas: {
|
|
118
|
+
PREFIX: number;
|
|
119
|
+
create(args: {
|
|
120
|
+
queryId: uint64;
|
|
121
|
+
excess: c.Address;
|
|
122
|
+
}): ResetGas;
|
|
123
|
+
fromSlice(s: c.Slice): ResetGas;
|
|
124
|
+
store(self: ResetGas, b: c.Builder): void;
|
|
125
|
+
toCell(self: ResetGas): c.Cell;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
> struct (0x726f0586) ResetMinterGas {
|
|
129
|
+
> queryId: uint64
|
|
130
|
+
> minterId: uint32
|
|
131
|
+
> jettonMinter: address
|
|
132
|
+
> manager: address
|
|
133
|
+
> }
|
|
134
|
+
*/
|
|
135
|
+
export interface ResetMinterGas {
|
|
136
|
+
readonly $: 'ResetMinterGas';
|
|
137
|
+
queryId: uint64;
|
|
138
|
+
minterId: uint32;
|
|
139
|
+
jettonMinter: c.Address;
|
|
140
|
+
manager: c.Address;
|
|
141
|
+
}
|
|
142
|
+
export declare const ResetMinterGas: {
|
|
143
|
+
PREFIX: number;
|
|
144
|
+
create(args: {
|
|
145
|
+
queryId: uint64;
|
|
146
|
+
minterId: uint32;
|
|
147
|
+
jettonMinter: c.Address;
|
|
148
|
+
manager: c.Address;
|
|
149
|
+
}): ResetMinterGas;
|
|
150
|
+
fromSlice(s: c.Slice): ResetMinterGas;
|
|
151
|
+
store(self: ResetMinterGas, b: c.Builder): void;
|
|
152
|
+
toCell(self: ResetMinterGas): c.Cell;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
> struct (0x537e7304) InternalInitMinter {
|
|
156
|
+
> queryId: uint64
|
|
157
|
+
> jettonWallet: address
|
|
158
|
+
> excesses: address
|
|
159
|
+
> }
|
|
160
|
+
*/
|
|
161
|
+
export interface InternalInitMinter {
|
|
162
|
+
readonly $: 'InternalInitMinter';
|
|
163
|
+
queryId: uint64;
|
|
164
|
+
jettonWallet: c.Address;
|
|
165
|
+
excesses: c.Address;
|
|
166
|
+
}
|
|
167
|
+
export declare const InternalInitMinter: {
|
|
168
|
+
PREFIX: number;
|
|
169
|
+
create(args: {
|
|
170
|
+
queryId: uint64;
|
|
171
|
+
jettonWallet: c.Address;
|
|
172
|
+
excesses: c.Address;
|
|
173
|
+
}): InternalInitMinter;
|
|
174
|
+
fromSlice(s: c.Slice): InternalInitMinter;
|
|
175
|
+
store(self: InternalInitMinter, b: c.Builder): void;
|
|
176
|
+
toCell(self: InternalInitMinter): c.Cell;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
> struct (0x28c6c21a) InternalResetGas {
|
|
180
|
+
> queryId: uint64
|
|
181
|
+
> excess: address
|
|
182
|
+
> }
|
|
183
|
+
*/
|
|
184
|
+
export interface InternalResetGas {
|
|
185
|
+
readonly $: 'InternalResetGas';
|
|
186
|
+
queryId: uint64;
|
|
187
|
+
excess: c.Address;
|
|
188
|
+
}
|
|
189
|
+
export declare const InternalResetGas: {
|
|
190
|
+
PREFIX: number;
|
|
191
|
+
create(args: {
|
|
192
|
+
queryId: uint64;
|
|
193
|
+
excess: c.Address;
|
|
194
|
+
}): InternalResetGas;
|
|
195
|
+
fromSlice(s: c.Slice): InternalResetGas;
|
|
196
|
+
store(self: InternalResetGas, b: c.Builder): void;
|
|
197
|
+
toCell(self: InternalResetGas): c.Cell;
|
|
198
|
+
};
|
|
199
|
+
interface ExtraSendOptions {
|
|
200
|
+
bounce?: boolean;
|
|
201
|
+
sendMode?: SendMode;
|
|
202
|
+
extraCurrencies?: c.ExtraCurrency;
|
|
203
|
+
}
|
|
204
|
+
interface DeployedAddrOptions {
|
|
205
|
+
workchain?: number;
|
|
206
|
+
toShard?: {
|
|
207
|
+
fixedPrefixLength: number;
|
|
208
|
+
closeTo: c.Address;
|
|
209
|
+
};
|
|
210
|
+
overrideContractCode?: c.Cell;
|
|
211
|
+
}
|
|
212
|
+
export declare class Factory implements c.Contract {
|
|
213
|
+
static Errors: {
|
|
214
|
+
'Errors.NotEnoughGas': number;
|
|
215
|
+
'Errors.InvalidWorkchain': number;
|
|
216
|
+
'Errors.WrongSender': number;
|
|
217
|
+
'Errors.WrongOp': number;
|
|
218
|
+
};
|
|
219
|
+
readonly address: c.Address;
|
|
220
|
+
readonly init: {
|
|
221
|
+
code: c.Cell;
|
|
222
|
+
data: c.Cell;
|
|
223
|
+
} | undefined;
|
|
224
|
+
protected constructor(address: c.Address, init?: {
|
|
225
|
+
code: c.Cell;
|
|
226
|
+
data: c.Cell;
|
|
227
|
+
});
|
|
228
|
+
static fromAddress(address: c.Address): Factory;
|
|
229
|
+
static createCellOfInitMinter(body: {
|
|
230
|
+
queryId: uint64;
|
|
231
|
+
minterId: uint32;
|
|
232
|
+
jettonMinter: c.Address;
|
|
233
|
+
jettonWallet: c.Address;
|
|
234
|
+
}): c.Cell;
|
|
235
|
+
static createCellOfResetGas(body: {
|
|
236
|
+
queryId: uint64;
|
|
237
|
+
excess: c.Address;
|
|
238
|
+
}): c.Cell;
|
|
239
|
+
static createCellOfResetMinterGas(body: {
|
|
240
|
+
queryId: uint64;
|
|
241
|
+
minterId: uint32;
|
|
242
|
+
jettonMinter: c.Address;
|
|
243
|
+
manager: c.Address;
|
|
244
|
+
}): c.Cell;
|
|
245
|
+
sendDeploy(provider: ContractProvider, via: Sender, msgValue: coins, extraOptions?: ExtraSendOptions): Promise<void>;
|
|
246
|
+
sendInitMinter(provider: ContractProvider, via: Sender, msgValue: coins, body: {
|
|
247
|
+
queryId: uint64;
|
|
248
|
+
minterId: uint32;
|
|
249
|
+
jettonMinter: c.Address;
|
|
250
|
+
jettonWallet: c.Address;
|
|
251
|
+
}, extraOptions?: ExtraSendOptions): Promise<void>;
|
|
252
|
+
sendResetGas(provider: ContractProvider, via: Sender, msgValue: coins, body: {
|
|
253
|
+
queryId: uint64;
|
|
254
|
+
excess: c.Address;
|
|
255
|
+
}, extraOptions?: ExtraSendOptions): Promise<void>;
|
|
256
|
+
sendResetMinterGas(provider: ContractProvider, via: Sender, msgValue: coins, body: {
|
|
257
|
+
queryId: uint64;
|
|
258
|
+
minterId: uint32;
|
|
259
|
+
jettonMinter: c.Address;
|
|
260
|
+
manager: c.Address;
|
|
261
|
+
}, extraOptions?: ExtraSendOptions): Promise<void>;
|
|
262
|
+
getFactoryData(provider: ContractProvider): Promise<FactoryRuntimeStorage>;
|
|
263
|
+
getMinterAddress(provider: ContractProvider, id: bigint, jettonMinter: c.Address, manager: c.Address): Promise<c.Address>;
|
|
264
|
+
}
|
|
265
|
+
export {};
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AUTO-GENERATED, do not edit
|
|
3
|
+
// It's a TypeScript wrapper for a Factory contract in Tolk.
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Factory = exports.InternalResetGas = exports.InternalInitMinter = exports.ResetMinterGas = exports.ResetGas = exports.InitMinter = exports.FactoryStorage = exports.FactoryRuntimeStorage = exports.ExcessMessage = void 0;
|
|
40
|
+
const c = __importStar(require("@ton/core"));
|
|
41
|
+
const core_1 = require("@ton/core");
|
|
42
|
+
function makeCellFrom(self, storeFn_T) {
|
|
43
|
+
let b = (0, core_1.beginCell)();
|
|
44
|
+
storeFn_T(self, b);
|
|
45
|
+
return b.endCell();
|
|
46
|
+
}
|
|
47
|
+
function loadAndCheckPrefix32(s, expected, structName) {
|
|
48
|
+
let prefix = s.loadUint(32);
|
|
49
|
+
if (prefix !== expected) {
|
|
50
|
+
throw new Error(`Incorrect prefix for '${structName}': expected 0x${expected.toString(16).padStart(8, '0')}, got 0x${prefix.toString(16).padStart(8, '0')}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function lookupPrefix(s, expected, prefixLen) {
|
|
54
|
+
return s.remainingBits >= prefixLen && s.preloadUint(prefixLen) === expected;
|
|
55
|
+
}
|
|
56
|
+
function throwNonePrefixMatch(fieldPath) {
|
|
57
|
+
throw new Error(`Incorrect prefix for '${fieldPath}': none of variants matched`);
|
|
58
|
+
}
|
|
59
|
+
function storeCellRef(cell, b, storeFn_T) {
|
|
60
|
+
let b_ref = c.beginCell();
|
|
61
|
+
storeFn_T(cell.ref, b_ref);
|
|
62
|
+
b.storeRef(b_ref.endCell());
|
|
63
|
+
}
|
|
64
|
+
function loadCellRef(s, loadFn_T) {
|
|
65
|
+
let s_ref = s.loadRef().beginParse();
|
|
66
|
+
return { ref: loadFn_T(s_ref) };
|
|
67
|
+
}
|
|
68
|
+
function storeTolkNullable(v, b, storeFn_T) {
|
|
69
|
+
if (v === null) {
|
|
70
|
+
b.storeUint(0, 1);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
b.storeUint(1, 1);
|
|
74
|
+
storeFn_T(v, b);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// ————————————————————————————————————————————
|
|
78
|
+
// parse get methods result from a TVM stack
|
|
79
|
+
//
|
|
80
|
+
class StackReader {
|
|
81
|
+
constructor(tuple) {
|
|
82
|
+
this.tuple = tuple;
|
|
83
|
+
}
|
|
84
|
+
static fromGetMethod(expectedN, getMethodResult) {
|
|
85
|
+
let tuple = [];
|
|
86
|
+
while (getMethodResult.stack.remaining) {
|
|
87
|
+
tuple.push(getMethodResult.stack.pop());
|
|
88
|
+
}
|
|
89
|
+
if (tuple.length !== expectedN) {
|
|
90
|
+
throw new Error(`expected ${expectedN} stack width, got ${tuple.length}`);
|
|
91
|
+
}
|
|
92
|
+
return new StackReader(tuple);
|
|
93
|
+
}
|
|
94
|
+
popExpecting(itemType) {
|
|
95
|
+
const item = this.tuple.shift();
|
|
96
|
+
if (item?.type === itemType) {
|
|
97
|
+
return item;
|
|
98
|
+
}
|
|
99
|
+
throw new Error(`not '${itemType}' on a stack`);
|
|
100
|
+
}
|
|
101
|
+
popCellLike() {
|
|
102
|
+
const item = this.tuple.shift();
|
|
103
|
+
if (item && (item.type === 'cell' || item.type === 'slice' || item.type === 'builder')) {
|
|
104
|
+
return item.cell;
|
|
105
|
+
}
|
|
106
|
+
throw new Error(`not cell/slice on a stack`);
|
|
107
|
+
}
|
|
108
|
+
readBigInt() {
|
|
109
|
+
return this.popExpecting('int').value;
|
|
110
|
+
}
|
|
111
|
+
readBoolean() {
|
|
112
|
+
return this.popExpecting('int').value !== 0n;
|
|
113
|
+
}
|
|
114
|
+
readCell() {
|
|
115
|
+
return this.popCellLike();
|
|
116
|
+
}
|
|
117
|
+
readSlice() {
|
|
118
|
+
return this.popCellLike().beginParse();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.ExcessMessage = {
|
|
122
|
+
PREFIX: 0xd53276db,
|
|
123
|
+
create(args) {
|
|
124
|
+
return {
|
|
125
|
+
$: 'ExcessMessage',
|
|
126
|
+
...args
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
fromSlice(s) {
|
|
130
|
+
loadAndCheckPrefix32(s, 0xd53276db, 'ExcessMessage');
|
|
131
|
+
return {
|
|
132
|
+
$: 'ExcessMessage',
|
|
133
|
+
queryId: s.loadUintBig(64),
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
store(self, b) {
|
|
137
|
+
b.storeUint(0xd53276db, 32);
|
|
138
|
+
b.storeUint(self.queryId, 64);
|
|
139
|
+
},
|
|
140
|
+
toCell(self) {
|
|
141
|
+
return makeCellFrom(self, exports.ExcessMessage.store);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
exports.FactoryRuntimeStorage = {
|
|
145
|
+
create(args) {
|
|
146
|
+
return {
|
|
147
|
+
$: 'FactoryRuntimeStorage',
|
|
148
|
+
...args
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
fromSlice(s) {
|
|
152
|
+
return {
|
|
153
|
+
$: 'FactoryRuntimeStorage',
|
|
154
|
+
id: s.loadUintBig(32),
|
|
155
|
+
owner: s.loadAddress(),
|
|
156
|
+
minterCode: s.loadRef(),
|
|
157
|
+
walletCode: s.loadRef(),
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
store(self, b) {
|
|
161
|
+
b.storeUint(self.id, 32);
|
|
162
|
+
b.storeAddress(self.owner);
|
|
163
|
+
b.storeRef(self.minterCode);
|
|
164
|
+
b.storeRef(self.walletCode);
|
|
165
|
+
},
|
|
166
|
+
toCell(self) {
|
|
167
|
+
return makeCellFrom(self, exports.FactoryRuntimeStorage.store);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.FactoryStorage = {
|
|
171
|
+
create(args) {
|
|
172
|
+
return {
|
|
173
|
+
$: 'FactoryStorage',
|
|
174
|
+
...args
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
fromSlice(s) {
|
|
178
|
+
return {
|
|
179
|
+
$: 'FactoryStorage',
|
|
180
|
+
id: s.loadUintBig(32),
|
|
181
|
+
owner: s.loadAddress(),
|
|
182
|
+
minterCode: s.loadRef(),
|
|
183
|
+
walletCode: s.loadRef(),
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
store(self, b) {
|
|
187
|
+
b.storeUint(self.id, 32);
|
|
188
|
+
b.storeAddress(self.owner);
|
|
189
|
+
b.storeRef(self.minterCode);
|
|
190
|
+
b.storeRef(self.walletCode);
|
|
191
|
+
},
|
|
192
|
+
toCell(self) {
|
|
193
|
+
return makeCellFrom(self, exports.FactoryStorage.store);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
exports.InitMinter = {
|
|
197
|
+
PREFIX: 0xcb639242,
|
|
198
|
+
create(args) {
|
|
199
|
+
return {
|
|
200
|
+
$: 'InitMinter',
|
|
201
|
+
...args
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
fromSlice(s) {
|
|
205
|
+
loadAndCheckPrefix32(s, 0xcb639242, 'InitMinter');
|
|
206
|
+
return {
|
|
207
|
+
$: 'InitMinter',
|
|
208
|
+
queryId: s.loadUintBig(64),
|
|
209
|
+
minterId: s.loadUintBig(32),
|
|
210
|
+
jettonMinter: s.loadAddress(),
|
|
211
|
+
jettonWallet: s.loadAddress(),
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
store(self, b) {
|
|
215
|
+
b.storeUint(0xcb639242, 32);
|
|
216
|
+
b.storeUint(self.queryId, 64);
|
|
217
|
+
b.storeUint(self.minterId, 32);
|
|
218
|
+
b.storeAddress(self.jettonMinter);
|
|
219
|
+
b.storeAddress(self.jettonWallet);
|
|
220
|
+
},
|
|
221
|
+
toCell(self) {
|
|
222
|
+
return makeCellFrom(self, exports.InitMinter.store);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
exports.ResetGas = {
|
|
226
|
+
PREFIX: 0x53a9192c,
|
|
227
|
+
create(args) {
|
|
228
|
+
return {
|
|
229
|
+
$: 'ResetGas',
|
|
230
|
+
...args
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
fromSlice(s) {
|
|
234
|
+
loadAndCheckPrefix32(s, 0x53a9192c, 'ResetGas');
|
|
235
|
+
return {
|
|
236
|
+
$: 'ResetGas',
|
|
237
|
+
queryId: s.loadUintBig(64),
|
|
238
|
+
excess: s.loadAddress(),
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
store(self, b) {
|
|
242
|
+
b.storeUint(0x53a9192c, 32);
|
|
243
|
+
b.storeUint(self.queryId, 64);
|
|
244
|
+
b.storeAddress(self.excess);
|
|
245
|
+
},
|
|
246
|
+
toCell(self) {
|
|
247
|
+
return makeCellFrom(self, exports.ResetGas.store);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
exports.ResetMinterGas = {
|
|
251
|
+
PREFIX: 0x726f0586,
|
|
252
|
+
create(args) {
|
|
253
|
+
return {
|
|
254
|
+
$: 'ResetMinterGas',
|
|
255
|
+
...args
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
fromSlice(s) {
|
|
259
|
+
loadAndCheckPrefix32(s, 0x726f0586, 'ResetMinterGas');
|
|
260
|
+
return {
|
|
261
|
+
$: 'ResetMinterGas',
|
|
262
|
+
queryId: s.loadUintBig(64),
|
|
263
|
+
minterId: s.loadUintBig(32),
|
|
264
|
+
jettonMinter: s.loadAddress(),
|
|
265
|
+
manager: s.loadAddress(),
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
store(self, b) {
|
|
269
|
+
b.storeUint(0x726f0586, 32);
|
|
270
|
+
b.storeUint(self.queryId, 64);
|
|
271
|
+
b.storeUint(self.minterId, 32);
|
|
272
|
+
b.storeAddress(self.jettonMinter);
|
|
273
|
+
b.storeAddress(self.manager);
|
|
274
|
+
},
|
|
275
|
+
toCell(self) {
|
|
276
|
+
return makeCellFrom(self, exports.ResetMinterGas.store);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
exports.InternalInitMinter = {
|
|
280
|
+
PREFIX: 0x537e7304,
|
|
281
|
+
create(args) {
|
|
282
|
+
return {
|
|
283
|
+
$: 'InternalInitMinter',
|
|
284
|
+
...args
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
fromSlice(s) {
|
|
288
|
+
loadAndCheckPrefix32(s, 0x537e7304, 'InternalInitMinter');
|
|
289
|
+
return {
|
|
290
|
+
$: 'InternalInitMinter',
|
|
291
|
+
queryId: s.loadUintBig(64),
|
|
292
|
+
jettonWallet: s.loadAddress(),
|
|
293
|
+
excesses: s.loadAddress(),
|
|
294
|
+
};
|
|
295
|
+
},
|
|
296
|
+
store(self, b) {
|
|
297
|
+
b.storeUint(0x537e7304, 32);
|
|
298
|
+
b.storeUint(self.queryId, 64);
|
|
299
|
+
b.storeAddress(self.jettonWallet);
|
|
300
|
+
b.storeAddress(self.excesses);
|
|
301
|
+
},
|
|
302
|
+
toCell(self) {
|
|
303
|
+
return makeCellFrom(self, exports.InternalInitMinter.store);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
exports.InternalResetGas = {
|
|
307
|
+
PREFIX: 0x28c6c21a,
|
|
308
|
+
create(args) {
|
|
309
|
+
return {
|
|
310
|
+
$: 'InternalResetGas',
|
|
311
|
+
...args
|
|
312
|
+
};
|
|
313
|
+
},
|
|
314
|
+
fromSlice(s) {
|
|
315
|
+
loadAndCheckPrefix32(s, 0x28c6c21a, 'InternalResetGas');
|
|
316
|
+
return {
|
|
317
|
+
$: 'InternalResetGas',
|
|
318
|
+
queryId: s.loadUintBig(64),
|
|
319
|
+
excess: s.loadAddress(),
|
|
320
|
+
};
|
|
321
|
+
},
|
|
322
|
+
store(self, b) {
|
|
323
|
+
b.storeUint(0x28c6c21a, 32);
|
|
324
|
+
b.storeUint(self.queryId, 64);
|
|
325
|
+
b.storeAddress(self.excess);
|
|
326
|
+
},
|
|
327
|
+
toCell(self) {
|
|
328
|
+
return makeCellFrom(self, exports.InternalResetGas.store);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
class Factory {
|
|
332
|
+
constructor(address, init) {
|
|
333
|
+
this.address = address;
|
|
334
|
+
this.init = init;
|
|
335
|
+
}
|
|
336
|
+
static fromAddress(address) {
|
|
337
|
+
return new Factory(address);
|
|
338
|
+
}
|
|
339
|
+
static createCellOfInitMinter(body) {
|
|
340
|
+
return exports.InitMinter.toCell(exports.InitMinter.create(body));
|
|
341
|
+
}
|
|
342
|
+
static createCellOfResetGas(body) {
|
|
343
|
+
return exports.ResetGas.toCell(exports.ResetGas.create(body));
|
|
344
|
+
}
|
|
345
|
+
static createCellOfResetMinterGas(body) {
|
|
346
|
+
return exports.ResetMinterGas.toCell(exports.ResetMinterGas.create(body));
|
|
347
|
+
}
|
|
348
|
+
async sendDeploy(provider, via, msgValue, extraOptions) {
|
|
349
|
+
return provider.internal(via, {
|
|
350
|
+
value: msgValue,
|
|
351
|
+
body: c.Cell.EMPTY,
|
|
352
|
+
...extraOptions
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
async sendInitMinter(provider, via, msgValue, body, extraOptions) {
|
|
356
|
+
return provider.internal(via, {
|
|
357
|
+
value: msgValue,
|
|
358
|
+
body: exports.InitMinter.toCell(exports.InitMinter.create(body)),
|
|
359
|
+
...extraOptions
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
async sendResetGas(provider, via, msgValue, body, extraOptions) {
|
|
363
|
+
return provider.internal(via, {
|
|
364
|
+
value: msgValue,
|
|
365
|
+
body: exports.ResetGas.toCell(exports.ResetGas.create(body)),
|
|
366
|
+
...extraOptions
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
async sendResetMinterGas(provider, via, msgValue, body, extraOptions) {
|
|
370
|
+
return provider.internal(via, {
|
|
371
|
+
value: msgValue,
|
|
372
|
+
body: exports.ResetMinterGas.toCell(exports.ResetMinterGas.create(body)),
|
|
373
|
+
...extraOptions
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
async getFactoryData(provider) {
|
|
377
|
+
const r = StackReader.fromGetMethod(4, await provider.get('getFactoryData', []));
|
|
378
|
+
return ({
|
|
379
|
+
$: 'FactoryRuntimeStorage',
|
|
380
|
+
id: r.readBigInt(),
|
|
381
|
+
owner: r.readSlice().loadAddress(),
|
|
382
|
+
minterCode: r.readCell(),
|
|
383
|
+
walletCode: r.readCell(),
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
async getMinterAddress(provider, id, jettonMinter, manager) {
|
|
387
|
+
const r = StackReader.fromGetMethod(1, await provider.get('getMinterAddress', [
|
|
388
|
+
{ type: 'int', value: id },
|
|
389
|
+
{ type: 'slice', cell: makeCellFrom(jettonMinter, (v, b) => b.storeAddress(v)) },
|
|
390
|
+
{ type: 'slice', cell: makeCellFrom(manager, (v, b) => b.storeAddress(v)) },
|
|
391
|
+
]));
|
|
392
|
+
return r.readSlice().loadAddress();
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
exports.Factory = Factory;
|
|
396
|
+
Factory.Errors = {
|
|
397
|
+
'Errors.NotEnoughGas': 29432,
|
|
398
|
+
'Errors.InvalidWorkchain': 38296,
|
|
399
|
+
'Errors.WrongSender': 45881,
|
|
400
|
+
'Errors.WrongOp': 65535,
|
|
401
|
+
};
|