@wormhole-foundation/sdk-connect
Version:
The core package for the Connect SDK, used in conjunction with 1 or more of the chain packages
51 lines • 1.55 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFinalizable = exports.FinalizableRoute = exports.isManual = exports.ManualRoute = exports.isAutomatic = exports.AutomaticRoute = exports.Route = void 0;
class Route {
wh;
constructor(wh) {
this.wh = wh;
}
// Get the url to view the transfer on the explorer for the route provider
transferUrl(txid) {
return `https://wormholescan.io/#/tx/${txid}?network=${this.wh.network}`;
}
}
exports.Route = Route;
/**
* AutomaticRoute is used whenever a relayer is delivering the
* Attestation to the destination chain
*/
class AutomaticRoute extends Route {
static IS_AUTOMATIC = true;
}
exports.AutomaticRoute = AutomaticRoute;
function isAutomatic(route) {
return !!route.constructor.IS_AUTOMATIC;
}
exports.isAutomatic = isAutomatic;
/**
* Manual route is used whenever a manual delivery of the Attestation
* is necessary
*/
class ManualRoute extends Route {
static NATIVE_GAS_DROPOFF_SUPPORTED = false;
static IS_AUTOMATIC = false;
}
exports.ManualRoute = ManualRoute;
function isManual(route) {
return route.complete !== undefined;
}
exports.isManual = isManual;
/**
* FinalizableRoute is used whenever the route has a step after
* completion that needs to be done
*/
class FinalizableRoute extends Route {
}
exports.FinalizableRoute = FinalizableRoute;
function isFinalizable(route) {
return route.finalize !== undefined;
}
exports.isFinalizable = isFinalizable;
//# sourceMappingURL=route.js.map
;