UNPKG

@sky-mavis/tanto-connect

Version:
15 lines 800 B
import {WaypointProvider}from'@sky-mavis/waypoint';import {ChainIds}from'../common/chain.mjs';import {ConnectorError,ConnectorErrorType}from'../types/connector-error.mjs';import {getVersionInfo}from'../utils/index.mjs';const requestWaypointProvider = (configs) => { const { chainId, clientId, waypointOrigin, scopes, popupCloseDelay, source } = configs || {}; const waypointProvider = WaypointProvider.create({ clientId: clientId, chainId: chainId || ChainIds.RoninMainnet, waypointOrigin, scopes, popupCloseDelay, source: source ?? getVersionInfo(), }); if (!waypointProvider) { throw new ConnectorError(ConnectorErrorType.PROVIDER_NOT_FOUND); } return waypointProvider; };export{requestWaypointProvider};