zerion-sdk
Version:
A Typed Interface for ZerionAPI
32 lines (31 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildQueryString = buildQueryString;
exports.polygonNativeAssetImplementation = polygonNativeAssetImplementation;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function buildQueryString(params) {
const query = {};
for (const [key, value] of Object.entries(params)) {
if (value === undefined || value === null)
continue; // Skip undefined or null values
if (Array.isArray(value)) {
query[key] = value.join(","); // Join arrays with commas
}
else {
query[key] = value.toString();
}
}
return new URLSearchParams(query).toString();
}
function polygonNativeAssetImplementation() {
// Skip Recognition of MRC20 Token Contract:
// https://polygonscan.com/address/0x0000000000000000000000000000000000001010
// This token has a payable transfer function and messes shit up.
return [
{
chain_id: "polygon",
address: null,
decimals: 18,
},
];
}