Skip to content

Commit

Permalink
0.0.54 - dont throw on jettons with onchain metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tolya-yanot committed Aug 5, 2022
1 parent e228a98 commit 01a05d7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/tonweb.js

Large diffs are not rendered by default.

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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tonweb",
"version": "0.0.53",
"version": "0.0.54",
"description": "TonWeb - JavaScript API for TON blockchain",
"main": "src/index.js",
"types": "dist/types/index.d.ts",
Expand Down
11 changes: 8 additions & 3 deletions src/contract/token/ft/JettonMinter.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class JettonMinter extends Contract {
}

/**
* @return {Promise<{ totalSupply: BN, isMutable: boolean, adminAddress: Address|null, jettonContentUri: string, jettonWalletCode: Cell }>}
* @return {Promise<{ totalSupply: BN, isMutable: boolean, adminAddress: Address|null, jettonContentCell: Cell, jettonContentUri: string|null, jettonWalletCode: Cell }>}
*/
async getJettonData() {
const myAddress = await this.getAddress();
Expand All @@ -89,10 +89,15 @@ class JettonMinter extends Contract {
const totalSupply = result[0];
const isMutable = result[1].toNumber() === -1;
const adminAddress = parseAddress(result[2]);
const jettonContentUri = parseOffchainUriCell(result[3]);
const jettonContentCell = result[3];
let jettonContentUri = null;
try {
jettonContentUri = parseOffchainUriCell(jettonContentCell);
} catch (e) {
}
const jettonWalletCode = result[4];

return {totalSupply, isMutable, adminAddress, jettonContentUri, jettonWalletCode};
return {totalSupply, isMutable, adminAddress, jettonContentCell, jettonContentUri, jettonWalletCode};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TransportWebUSB = require("@ledgerhq/hw-transport-webusb").default;
const TransportWebHID = require("@ledgerhq/hw-transport-webhid").default;
const BluetoothTransport = require("@ledgerhq/hw-transport-web-ble").default;
const {Dns, DnsCollection, DnsItem} = require("./contract/dns").default;
const version = '0.0.53';
const version = '0.0.54';

class TonWeb {
constructor(provider) {
Expand Down

0 comments on commit 01a05d7

Please sign in to comment.