Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/tonweb.js

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions dist/types/contract/wallet/v5/wallet-v5-contract.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Cell } from '../../../boc/cell';
import { HttpProvider } from '../../../providers/http-provider';
import { WalletContract, WalletContractOptions, WalletContractMethods } from '../wallet-contract';

export interface WalletV5ContractMethods extends WalletContractMethods {
getWalletId: () => Promise<number>;
getSeqno: () => Promise<number>;
getIsSignatureAuthAllowed: () => Promise<number>;
getExtensions: () => Promise<Cell>;
getExtensionsList: () => Promise<string[]>;
}

export declare class WalletV5Contract extends WalletContract<WalletContractOptions, WalletV5ContractMethods> {
constructor(provider: HttpProvider, options: WalletContractOptions);
getName(): string;
getWalletId(): Promise<number>;
getSeqno(): Promise<number>;
getIsSignatureAuthAllowed(): Promise<number>;
getExtensions(): Promise<Cell>;
getExtensionsList(): Promise<string[]>;
}
7 changes: 5 additions & 2 deletions dist/types/contract/wallet/wallets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { WalletV4ContractR2 } from './v4/wallet-v4-contract-r2';
import { WalletV2ContractR1 } from './v2/wallet-v2-contract-r1';
import { WalletV2ContractR2 } from './v2/wallet-v2-contract-r2';
import { WalletV3ContractR1 } from './v3/wallet-v3-contract-r1';
import { WalletV3ContractR2 } from './v3/wallet-v3-contract-r2';
import { WalletV3ContractR1 } from './v3/wallet-v3-contract-r1';
import { WalletV5Contract } from './v5/wallet-v5-contract';
export declare class Wallets {
readonly provider: HttpProvider;
static all: {
Expand All @@ -20,6 +21,7 @@ export declare class Wallets {
v3R2: typeof WalletV3ContractR2;
v4R1: typeof WalletV4ContractR1;
v4R2: typeof WalletV4ContractR2;
v5R1: typeof WalletV5Contract;
};
static list: (typeof SimpleWalletContractR1 | typeof WalletV4ContractR1)[];
readonly all: {
Expand All @@ -32,9 +34,10 @@ export declare class Wallets {
v3R2: typeof WalletV3ContractR2;
v4R1: typeof WalletV4ContractR1;
v4R2: typeof WalletV4ContractR2;
v5R1: typeof WalletV5Contract;
};
readonly list: (typeof SimpleWalletContractR1 | typeof WalletV4ContractR1)[];
readonly defaultVersion = "v3R1";
readonly defaultVersion = "v3R2";
readonly default: typeof WalletV3ContractR1;
constructor(provider: HttpProvider);
create(options: any): WalletV3ContractR1;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tonweb",
"version": "0.0.66",
"version": "0.0.70",
"description": "TonWeb - JavaScript API for TON blockchain",
"main": "src/index.js",
"types": "dist/types/index.d.ts",
Expand Down Expand Up @@ -46,4 +46,4 @@
"browser": {
"node-fetch": false
}
}
}
42 changes: 21 additions & 21 deletions src/contract/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {Cell} = require("../boc");
const {Address, bytesToBase64, bytesToHex, BN} = require("../utils");
const { Cell } = require("../boc");
const { Address, bytesToBase64, bytesToHex, BN } = require("../utils");

class Contract {
/**
Expand Down Expand Up @@ -72,10 +72,10 @@ class Contract {
* @return {Cell}
*/
static createStateInit(code,
data,
library = null,
splitDepth = null,
ticktock = null) {
data,
library = null,
splitDepth = null,
ticktock = null) {
if (library)
throw "Library in state init is not implemented";
if (splitDepth)
Expand Down Expand Up @@ -119,16 +119,16 @@ class Contract {
* @return {Cell}
*/
static createInternalMessageHeader(dest,
gramValue = 0,
ihrDisabled = true,
bounce = null,
bounced = false,
src = null,
currencyCollection = null,
ihrFees = 0,
fwdFees = 0,
createdLt = 0,
createdAt = 0) {
gramValue = 0,
ihrDisabled = true,
bounce = null,
bounced = false,
src = null,
currencyCollection = null,
ihrFees = 0,
fwdFees = 0,
createdLt = 0,
createdAt = 0) {
const message = new Cell();
message.bits.writeBit(false);
message.bits.writeBit(ihrDisabled);
Expand Down Expand Up @@ -161,8 +161,8 @@ class Contract {
* @return {Cell}
*/
static createExternalMessageHeader(dest,
src = null,
importFee = 0) {
src = null,
importFee = 0) {
const message = new Cell();
message.bits.writeUint(2, 2);
message.bits.writeAddress(src ? new Address(src) : null);
Expand Down Expand Up @@ -206,7 +206,7 @@ class Contract {
* @param body? {Cell}
* @return {Cell}
*/
static createCommonMsgInfo(header, stateInit = null, body = null) {
static createCommonMsgInfo(header, stateInit = null, body = null, bodyIsRef = false) {
const commonMsgInfo = new Cell();
commonMsgInfo.writeCell(header);

Expand All @@ -227,7 +227,7 @@ class Contract {
}
// TODO we also should check for free refs here
if (body) {
if ((commonMsgInfo.bits.getFreeBits() >= body.bits.getUsedBits()) && (commonMsgInfo.refs.length + body.refs.length <= 4)) {
if (!bodyIsRef && (commonMsgInfo.bits.getFreeBits() >= body.bits.getUsedBits()) && (commonMsgInfo.refs.length + body.refs.length <= 4)) {
commonMsgInfo.bits.writeBit(false);
commonMsgInfo.writeCell(body);
} else {
Expand Down Expand Up @@ -279,4 +279,4 @@ class Contract {
}
}

module.exports = {Contract};
module.exports = { Contract };
Loading