@helium/spl-utils
Advanced tools
Comparing version 0.6.32 to 0.6.33-next.4
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.searchAssets = exports.getAssetsByOwner = exports.getAssetProofBatch = exports.getAssetProof = exports.getAssets = exports.getAssetBatch = exports.getAsset = void 0; | ||
exports.searchAssetsWithPageInfo = exports.searchAssets = exports.getAssetsByOwner = exports.getAssetProofBatch = exports.getAssetProof = exports.getAssets = exports.getAssetBatch = exports.getAsset = void 0; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
@@ -227,3 +227,9 @@ const axios_1 = __importDefault(require("axios")); | ||
exports.getAssetsByOwner = getAssetsByOwner; | ||
function searchAssets(url, _a) { | ||
function searchAssets(url, opts) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield searchAssetsWithPageInfo(url, opts)).items; | ||
}); | ||
} | ||
exports.searchAssets = searchAssets; | ||
function searchAssetsWithPageInfo(url, _a) { | ||
var _b; | ||
@@ -248,3 +254,9 @@ var { creatorVerified = true, sortBy = { sortBy: "created", sortDirection: "asc" }, page = 1, limit = 1000, collection, tokenType } = _a, rest = __rest(_a, ["creatorVerified", "sortBy", "page", "limit", "collection", "tokenType"]); | ||
}); | ||
return (_b = response.data.result) === null || _b === void 0 ? void 0 : _b.items.map(toAsset); | ||
const ret = response.data.result; | ||
return { | ||
items: (_b = ret.items) === null || _b === void 0 ? void 0 : _b.map(toAsset), | ||
limit: ret.limit, | ||
total: ret.total, | ||
page: ret.page, | ||
}; | ||
} | ||
@@ -257,3 +269,3 @@ catch (error) { | ||
} | ||
exports.searchAssets = searchAssets; | ||
exports.searchAssetsWithPageInfo = searchAssetsWithPageInfo; | ||
//# sourceMappingURL=mplAssetAPI.js.map |
@@ -202,3 +202,6 @@ import { PublicKey } from "@solana/web3.js"; | ||
} | ||
export async function searchAssets(url, { creatorVerified = true, sortBy = { sortBy: "created", sortDirection: "asc" }, page = 1, limit = 1000, collection, tokenType, ...rest }) { | ||
export async function searchAssets(url, opts) { | ||
return (await searchAssetsWithPageInfo(url, opts)).items; | ||
} | ||
export async function searchAssetsWithPageInfo(url, { creatorVerified = true, sortBy = { sortBy: "created", sortDirection: "asc" }, page = 1, limit = 1000, collection, tokenType, ...rest }) { | ||
const params = { | ||
@@ -227,3 +230,9 @@ page, | ||
}); | ||
return response.data.result?.items.map(toAsset); | ||
const ret = response.data.result; | ||
return { | ||
items: ret.items?.map(toAsset), | ||
limit: ret.limit, | ||
total: ret.total, | ||
page: ret.page, | ||
}; | ||
} | ||
@@ -230,0 +239,0 @@ catch (error) { |
@@ -73,3 +73,9 @@ /// <reference types="node" /> | ||
}; | ||
export declare function searchAssets(url: string, { creatorVerified, sortBy, page, limit, collection, tokenType, ...rest }: SearchAssetsOpts): Promise<Asset[]>; | ||
export declare function searchAssets(url: string, opts: SearchAssetsOpts): Promise<Asset[]>; | ||
export declare function searchAssetsWithPageInfo(url: string, { creatorVerified, sortBy, page, limit, collection, tokenType, ...rest }: SearchAssetsOpts): Promise<{ | ||
page: number; | ||
total: number; | ||
limit: number; | ||
items: Asset[]; | ||
}>; | ||
//# sourceMappingURL=mplAssetAPI.d.ts.map |
{ | ||
"name": "@helium/spl-utils", | ||
"version": "0.6.32", | ||
"version": "0.6.33-next.4+2bce0317", | ||
"description": "Utils shared across spl suite", | ||
@@ -35,5 +35,5 @@ "publishConfig": { | ||
"@coral-xyz/anchor": "^0.28.0", | ||
"@helium/account-fetch-cache": "^0.6.32", | ||
"@helium/account-fetch-cache": "^0.6.33-next.4+2bce0317", | ||
"@helium/address": "^4.10.2", | ||
"@helium/anchor-resolvers": "^0.6.32", | ||
"@helium/anchor-resolvers": "^0.6.33-next.4+2bce0317", | ||
"@metaplex-foundation/mpl-token-metadata": "^2.10.0", | ||
@@ -53,3 +53,3 @@ "@solana/spl-account-compression": "^0.1.7", | ||
}, | ||
"gitHead": "ea36e3346eb0cbe8395279f88b065feee7195a0d" | ||
"gitHead": "2bce03176a8c71ba09bcb2a3f00242524c335fde" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
408380
3762
1