@wormhole-foundation/sdk-connect
Version:
The core package for the Connect SDK, used in conjunction with 1 or more of the chain packages
41 lines • 1.11 kB
JavaScript
export 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}`;
}
}
/**
* AutomaticRoute is used whenever a relayer is delivering the
* Attestation to the destination chain
*/
export class AutomaticRoute extends Route {
static IS_AUTOMATIC = true;
}
export function isAutomatic(route) {
return !!route.constructor.IS_AUTOMATIC;
}
/**
* Manual route is used whenever a manual delivery of the Attestation
* is necessary
*/
export class ManualRoute extends Route {
static NATIVE_GAS_DROPOFF_SUPPORTED = false;
static IS_AUTOMATIC = false;
}
export function isManual(route) {
return route.complete !== undefined;
}
/**
* FinalizableRoute is used whenever the route has a step after
* completion that needs to be done
*/
export class FinalizableRoute extends Route {
}
export function isFinalizable(route) {
return route.finalize !== undefined;
}
//# sourceMappingURL=route.js.map