UNPKG

@stable-io/cctp-sdk-definitions

Version:

Definitions for the CCTP SDK

20 lines 962 B
// Copyright (c) 2025 Stable Technologies Inc // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. export const apiUrl = { Mainnet: "https://iris-api.circle.com", Testnet: "https://iris-api-sandbox.circle.com", }; export const apiEndpoint = (network) => (version, ...params) => `${apiUrl[network]}/v${version}/${params.join("/")}`; export const apiEndpointWithQuery = (network) => (version, query, ...params) => { const pairs = Object.entries(query).map(([key, value]) => `${key}=${value}`); const endpoint = apiEndpoint(network)(version, ...params); return `${endpoint}?${pairs.join("&")}`; }; export const init = (network) => ({ apiUrl: apiUrl[network], apiEndpoint: apiEndpoint(network), apiEndpointWithQuery: apiEndpointWithQuery(network), }); //# sourceMappingURL=apis.js.map