@ton/ton 13.11.0 → 13.11.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.
@@ -9,7 +9,7 @@
9
9
  import { HttpApi } from "./api/HttpApi";
10
10
  import { AxiosAdapter } from 'axios';
11
11
  import { Address, Cell, Contract, ContractProvider, Message, Transaction, TupleItem, TupleReader, StateInit, OpenedContract } from '@ton/core';
12
- export declare type TonClientParameters = {
12
+ export type TonClientParameters = {
13
13
  /**
14
14
  * API Endpoint
15
15
  */
@@ -94,6 +94,7 @@ export declare class TonClient {
94
94
  hash?: string;
95
95
  to_lt?: string;
96
96
  inclusive?: boolean;
97
+ archival?: boolean;
97
98
  }): Promise<Transaction[]>;
98
99
  /**
99
100
  * Get transaction by it's id
@@ -9,7 +9,7 @@
9
9
  import { AxiosAdapter } from "axios";
10
10
  import { Address, Contract, ContractProvider, OpenedContract, StateInit, Transaction, TupleItem, TupleReader } from "@ton/core";
11
11
  import { z } from 'zod';
12
- export declare type TonClient4Parameters = {
12
+ export type TonClient4Parameters = {
13
13
  /**
14
14
  * API endpoint
15
15
  */
@@ -1118,8 +1118,8 @@ declare const parsedTransactionCodec: z.ZodObject<{
1118
1118
  } | undefined;
1119
1119
  };
1120
1120
  }>;
1121
- export declare type ParsedTransaction = z.infer<typeof parsedTransactionCodec>;
1122
- export declare type ParsedTransactions = {
1121
+ export type ParsedTransaction = z.infer<typeof parsedTransactionCodec>;
1122
+ export type ParsedTransactions = {
1123
1123
  blocks: z.infer<typeof blocksCodec>;
1124
1124
  transactions: ParsedTransaction[];
1125
1125
  };
@@ -412,8 +412,8 @@ declare const getTransactions: z.ZodArray<z.ZodObject<{
412
412
  };
413
413
  } | undefined;
414
414
  }>, "many">;
415
- export declare type HTTPTransaction = z.TypeOf<typeof getTransactions>[number];
416
- export declare type HTTPMessage = z.TypeOf<typeof message>;
415
+ export type HTTPTransaction = z.TypeOf<typeof getTransactions>[number];
416
+ export type HTTPMessage = z.TypeOf<typeof message>;
417
417
  export interface HttpApiParameters {
418
418
  /**
419
419
  * HTTP request timeout in milliseconds.
@@ -463,6 +463,7 @@ export declare class HttpApi {
463
463
  hash?: string;
464
464
  to_lt?: string;
465
465
  inclusive?: boolean;
466
+ archival?: boolean;
466
467
  }): Promise<{
467
468
  data: string;
468
469
  storage_fee: string;
@@ -58,7 +58,7 @@ export declare function configParse17(slice: Slice | null | undefined): {
58
58
  minTotalStake: bigint;
59
59
  maxStakeFactor: number;
60
60
  };
61
- export declare type StoragePrices = {
61
+ export type StoragePrices = {
62
62
  utime_since: number;
63
63
  bit_price_ps: bigint;
64
64
  cell_price_ps: bigint;
@@ -84,7 +84,7 @@ export declare function configParse40(slice: Slice | null | undefined): {
84
84
  mediumProportionalMult: number;
85
85
  } | null;
86
86
  export declare function configParseWorkchainDescriptor(slice: Slice): WorkchainDescriptor;
87
- export declare type WorkchainDescriptor = {
87
+ export type WorkchainDescriptor = {
88
88
  enabledSince: number;
89
89
  actialMinSplit: number;
90
90
  min_split: number;
@@ -131,7 +131,7 @@ export declare function configParseBridge(slice: Slice | null | undefined): {
131
131
  oracles: Map<string, Buffer>;
132
132
  externalChainAddress: Buffer;
133
133
  } | null;
134
- export declare type GasLimitsPrices = ReturnType<typeof configParseGasLimitsPrices>;
134
+ export type GasLimitsPrices = ReturnType<typeof configParseGasLimitsPrices>;
135
135
  export declare function configParseGasLimitsPrices(slice: Slice | null | undefined): {
136
136
  flatLimit: bigint;
137
137
  flatGasPrice: bigint;
@@ -153,7 +153,7 @@ export declare function configParseGasLimitsPrices(slice: Slice | null | undefin
153
153
  specialGasLimit?: undefined;
154
154
  };
155
155
  };
156
- export declare type MsgPrices = ReturnType<typeof configParseMsgPrices>;
156
+ export type MsgPrices = ReturnType<typeof configParseMsgPrices>;
157
157
  export declare function configParseMsgPrices(slice: Slice | null | undefined): {
158
158
  lumpPrice: bigint;
159
159
  bitPrice: bigint;
@@ -27,14 +27,14 @@ const EntitiesDictValue = {
27
27
  }
28
28
  };
29
29
  class ElectorContract {
30
- constructor() {
31
- // Please note that we are NOT loading address from config to avoid mistake and send validator money to a wrong contract
32
- this.address = core_1.Address.parseRaw('-1:3333333333333333333333333333333333333333333333333333333333333333');
33
- }
34
30
  //readonly source: ContractSource = new UnknownContractSource('org.ton.elector', -1, 'Elector Contract');
35
31
  static create() {
36
32
  return new ElectorContract();
37
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
38
  async getReturnedStake(provider, address) {
39
39
  if (address.workChain !== -1) {
40
40
  throw Error('Only masterchain addresses could have stake');
package/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  export * from '@ton/core';
9
- export { HttpApi } from './client/api/HttpApi';
10
- export { TonClient } from './client/TonClient';
9
+ export { HttpApi, HttpApiParameters } from './client/api/HttpApi';
10
+ export { TonClient, TonClientParameters } from './client/TonClient';
11
11
  export { TonClient4, TonClient4Parameters } from './client/TonClient4';
12
12
  export { WalletContractV1R1 } from './wallets/WalletContractV1R1';
13
13
  export { WalletContractV1R2 } from './wallets/WalletContractV1R2';
package/dist/index.js CHANGED
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -10,12 +10,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.JettonMaster = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  class JettonMaster {
13
- constructor(address) {
14
- this.address = address;
15
- }
16
13
  static create(address) {
17
14
  return new JettonMaster(address);
18
15
  }
16
+ constructor(address) {
17
+ this.address = address;
18
+ }
19
19
  async getWalletAddress(provider, owner) {
20
20
  let res = await provider.get('get_wallet_address', [{ type: 'slice', cell: (0, core_1.beginCell)().storeAddress(owner).endCell() }]);
21
21
  return res.stack.readAddress();
@@ -9,12 +9,12 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.JettonWallet = void 0;
11
11
  class JettonWallet {
12
- constructor(address) {
13
- this.address = address;
14
- }
15
12
  static create(address) {
16
13
  return new JettonWallet(address);
17
14
  }
15
+ constructor(address) {
16
+ this.address = address;
17
+ }
18
18
  async getBalance(provider) {
19
19
  let state = await provider.getState();
20
20
  if (state.state.type !== 'active') {
@@ -5,4 +5,4 @@
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- export declare type Maybe<T> = T | null | undefined;
8
+ export type Maybe<T> = T | null | undefined;
@@ -11,6 +11,9 @@ exports.WalletContractV1R1 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV1R1 {
14
+ static create(args) {
15
+ return new WalletContractV1R1(args.workchain, args.publicKey);
16
+ }
14
17
  constructor(workchain, publicKey) {
15
18
  this.workchain = workchain;
16
19
  this.publicKey = publicKey;
@@ -23,9 +26,6 @@ class WalletContractV1R1 {
23
26
  this.init = { code, data };
24
27
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
25
28
  }
26
- static create(args) {
27
- return new WalletContractV1R1(args.workchain, args.publicKey);
28
- }
29
29
  /**
30
30
  * Get Wallet Balance
31
31
  */
@@ -11,6 +11,9 @@ exports.WalletContractV1R2 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV1R2 {
14
+ static create(args) {
15
+ return new WalletContractV1R2(args.workchain, args.publicKey);
16
+ }
14
17
  constructor(workchain, publicKey) {
15
18
  this.workchain = workchain;
16
19
  this.publicKey = publicKey;
@@ -23,9 +26,6 @@ class WalletContractV1R2 {
23
26
  this.init = { code, data };
24
27
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
25
28
  }
26
- static create(args) {
27
- return new WalletContractV1R2(args.workchain, args.publicKey);
28
- }
29
29
  /**
30
30
  * Get Wallet Balance
31
31
  */
@@ -11,6 +11,9 @@ exports.WalletContractV1R3 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV1R3 {
14
+ static create(args) {
15
+ return new WalletContractV1R3(args.workchain, args.publicKey);
16
+ }
14
17
  constructor(workchain, publicKey) {
15
18
  this.workchain = workchain;
16
19
  this.publicKey = publicKey;
@@ -23,9 +26,6 @@ class WalletContractV1R3 {
23
26
  this.init = { code, data };
24
27
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
25
28
  }
26
- static create(args) {
27
- return new WalletContractV1R3(args.workchain, args.publicKey);
28
- }
29
29
  /**
30
30
  * Get Wallet Balance
31
31
  */
@@ -11,6 +11,9 @@ exports.WalletContractV2R1 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV2R1 {
14
+ static create(args) {
15
+ return new WalletContractV2R1(args.workchain, args.publicKey);
16
+ }
14
17
  constructor(workchain, publicKey) {
15
18
  this.workchain = workchain;
16
19
  this.publicKey = publicKey;
@@ -23,9 +26,6 @@ class WalletContractV2R1 {
23
26
  this.init = { code, data };
24
27
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
25
28
  }
26
- static create(args) {
27
- return new WalletContractV2R1(args.workchain, args.publicKey);
28
- }
29
29
  /**
30
30
  * Get Wallet Balance
31
31
  */
@@ -11,6 +11,9 @@ exports.WalletContractV2R2 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV2R2 {
14
+ static create(args) {
15
+ return new WalletContractV2R2(args.workchain, args.publicKey);
16
+ }
14
17
  constructor(workchain, publicKey) {
15
18
  this.workchain = workchain;
16
19
  this.publicKey = publicKey;
@@ -23,9 +26,6 @@ class WalletContractV2R2 {
23
26
  this.init = { code, data };
24
27
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
25
28
  }
26
- static create(args) {
27
- return new WalletContractV2R2(args.workchain, args.publicKey);
28
- }
29
29
  /**
30
30
  * Get Wallet Balance
31
31
  */
@@ -11,6 +11,9 @@ exports.WalletContractV3R1 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV3R1 {
14
+ static create(args) {
15
+ return new WalletContractV3R1(args.workchain, args.publicKey, args.walletId);
16
+ }
14
17
  constructor(workchain, publicKey, walletId) {
15
18
  // Resolve parameters
16
19
  this.workchain = workchain;
@@ -31,9 +34,6 @@ class WalletContractV3R1 {
31
34
  this.init = { code, data };
32
35
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
33
36
  }
34
- static create(args) {
35
- return new WalletContractV3R1(args.workchain, args.publicKey, args.walletId);
36
- }
37
37
  /**
38
38
  * Get wallet balance
39
39
  */
@@ -11,6 +11,9 @@ exports.WalletContractV3R2 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV3R2 {
14
+ static create(args) {
15
+ return new WalletContractV3R2(args.workchain, args.publicKey, args.walletId);
16
+ }
14
17
  constructor(workchain, publicKey, walletId) {
15
18
  // Resolve parameters
16
19
  this.workchain = workchain;
@@ -31,9 +34,6 @@ class WalletContractV3R2 {
31
34
  this.init = { code, data };
32
35
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
33
36
  }
34
- static create(args) {
35
- return new WalletContractV3R2(args.workchain, args.publicKey, args.walletId);
36
- }
37
37
  /**
38
38
  * Get wallet balance
39
39
  */
@@ -11,6 +11,9 @@ exports.WalletContractV4 = void 0;
11
11
  const core_1 = require("@ton/core");
12
12
  const createWalletTransfer_1 = require("./signing/createWalletTransfer");
13
13
  class WalletContractV4 {
14
+ static create(args) {
15
+ return new WalletContractV4(args.workchain, args.publicKey, args.walletId);
16
+ }
14
17
  constructor(workchain, publicKey, walletId) {
15
18
  // Resolve parameters
16
19
  this.workchain = workchain;
@@ -32,9 +35,6 @@ class WalletContractV4 {
32
35
  this.init = { code, data };
33
36
  this.address = (0, core_1.contractAddress)(workchain, { code, data });
34
37
  }
35
- static create(args) {
36
- return new WalletContractV4(args.workchain, args.publicKey, args.walletId);
37
- }
38
38
  /**
39
39
  * Get Wallet Balance
40
40
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/ton",
3
- "version": "13.11.0",
3
+ "version": "13.11.1",
4
4
  "repository": "https://github.com/ton-org/ton.git",
5
5
  "author": "Whales Corp. <developers@whalescorp.com>",
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "release": "yarn build && yarn release-it --npm.yarn1"
16
16
  },
17
17
  "devDependencies": {
18
- "@release-it/keep-a-changelog": "^3.1.0",
18
+ "@release-it/keep-a-changelog": "^5.0.0",
19
19
  "@ton/core": "^0.56.0",
20
20
  "@ton/crypto": "3.2.0",
21
21
  "@ton/emulator": "^2.1.1",
@@ -31,7 +31,7 @@
31
31
  "karma-typescript": "^5.5.2",
32
32
  "karma-webpack": "^5.0.0",
33
33
  "prando": "^6.0.1",
34
- "release-it": "^15.5.1",
34
+ "release-it": "^17.1.1",
35
35
  "ts-jest": "^27.0.5",
36
36
  "ts-loader": "^9.2.5",
37
37
  "ts-node": "^10.7.0",
@@ -40,7 +40,7 @@
40
40
  "webpack": "^5.51.2"
41
41
  },
42
42
  "dependencies": {
43
- "axios": "^0.25.0",
43
+ "axios": "^1.6.7",
44
44
  "dataloader": "^2.0.0",
45
45
  "symbol.inspect": "1.0.1",
46
46
  "teslabot": "^1.3.0",