@helium/spl-utils
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -43,3 +43,3 @@ "use strict"; | ||
var _a, _b, _c, _d, _e; | ||
return Object.assign(Object.assign({}, result), { id: new web3_js_1.PublicKey(result.id), compression: Object.assign(Object.assign({}, result.compression), { dataHash: (_a = result.compression.data_hash) !== null && _a !== void 0 ? _a : bs58_1.default.decode(result.compression.data_hash), creatorHash: (_b = result.compression.creator_hash) !== null && _b !== void 0 ? _b : bs58_1.default.decode(result.compression.creator_hash), assetHash: (_c = result.compression.asset_hash) !== null && _c !== void 0 ? _c : bs58_1.default.decode(result.compression.asset_hash), tree: (_d = result.compression.tree) !== null && _d !== void 0 ? _d : bs58_1.default.decode(result.compression.tree) }), ownership: Object.assign(Object.assign({}, result.ownership), { owner: (_e = result.ownership.owner) !== null && _e !== void 0 ? _e : new web3_js_1.PublicKey(result.ownership.owner) }) }); | ||
return Object.assign(Object.assign({}, result), { id: new web3_js_1.PublicKey(result.id), grouping: result.grouping && new web3_js_1.PublicKey(result.grouping), compression: Object.assign(Object.assign({}, result.compression), { dataHash: (_a = result.compression.data_hash) !== null && _a !== void 0 ? _a : bs58_1.default.decode(result.compression.data_hash), creatorHash: (_b = result.compression.creator_hash) !== null && _b !== void 0 ? _b : bs58_1.default.decode(result.compression.creator_hash), assetHash: (_c = result.compression.asset_hash) !== null && _c !== void 0 ? _c : bs58_1.default.decode(result.compression.asset_hash), tree: (_d = result.compression.tree) !== null && _d !== void 0 ? _d : bs58_1.default.decode(result.compression.tree) }), ownership: Object.assign(Object.assign({}, result.ownership), { owner: (_e = result.ownership.owner) !== null && _e !== void 0 ? _e : new web3_js_1.PublicKey(result.ownership.owner) }) }); | ||
} | ||
@@ -46,0 +46,0 @@ function getAssetProof(url, assetId) { |
@@ -58,6 +58,6 @@ "use strict"; | ||
exports.humanReadableBigint = humanReadableBigint; | ||
function humanReadable(bn, mint) { | ||
return numberWithCommas(roundToDecimals(toNumber(bn, mint), mint.decimals)); | ||
function humanReadable(bn, decimalsOrMint) { | ||
return numberWithCommas(roundToDecimals(toNumber(bn, decimalsOrMint), typeof decimalsOrMint == "number" ? decimalsOrMint : decimalsOrMint.decimals)); | ||
} | ||
exports.humanReadable = humanReadable; | ||
//# sourceMappingURL=utils.js.map |
@@ -27,2 +27,3 @@ import { PublicKey } from "@solana/web3.js"; | ||
id: new PublicKey(result.id), | ||
grouping: result.grouping && new PublicKey(result.grouping), | ||
compression: { | ||
@@ -29,0 +30,0 @@ ...result.compression, |
@@ -44,5 +44,5 @@ import BN from "bn.js"; | ||
} | ||
export function humanReadable(bn, mint) { | ||
return numberWithCommas(roundToDecimals(toNumber(bn, mint), mint.decimals)); | ||
export function humanReadable(bn, decimalsOrMint) { | ||
return numberWithCommas(roundToDecimals(toNumber(bn, decimalsOrMint), typeof decimalsOrMint == "number" ? decimalsOrMint : decimalsOrMint.decimals)); | ||
} | ||
//# sourceMappingURL=utils.js.map |
/// <reference types="node" /> | ||
import { Creator, Uses } from "@metaplex-foundation/mpl-bubblegum"; | ||
import { PublicKey } from "@solana/web3.js"; | ||
@@ -25,2 +26,13 @@ export type AssetProof = { | ||
}; | ||
royalty: { | ||
basis_points: number; | ||
primary_sale_happened: boolean; | ||
}; | ||
mutable: boolean; | ||
supply: { | ||
edition_nonce: number | null; | ||
}; | ||
grouping?: PublicKey; | ||
uses?: Uses; | ||
creators: Creator[]; | ||
}; | ||
@@ -27,0 +39,0 @@ export declare function getAsset(url: string, assetId: PublicKey): Promise<Asset | undefined>; |
@@ -12,3 +12,3 @@ import BN from "bn.js"; | ||
export declare function humanReadableBigint(bigint: bigint, decimals: number, round?: number): string; | ||
export declare function humanReadable(bn: BN, mint: Mint): string; | ||
export declare function humanReadable(bn: BN, decimalsOrMint: Mint | number): string; | ||
//# sourceMappingURL=utils.d.ts.map |
{ | ||
"name": "@helium/spl-utils", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Utils shared across spl suite", | ||
@@ -44,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "39fda136a8598f087f02e8a1e1b9713eba803a73" | ||
"gitHead": "1a676daee7cccec6f8ec53018fed959f90ea7a73" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
406465
3776