@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
34 lines • 1.14 kB
JavaScript
import { ChainType } from '@lifi/types';
import { isValidSuiAddress } from '@mysten/sui/utils';
import { getSuiBalance } from './getSuiBalance.js';
import { resolveSuiAddress } from './resolveSuiAddress.js';
import { SuiStepExecutor } from './SuiStepExecutor.js';
export function Sui(options) {
const _options = options ?? {};
return {
get type() {
return ChainType.MVM;
},
isAddress: isValidSuiAddress,
resolveAddress: resolveSuiAddress,
getBalance: getSuiBalance,
async getStepExecutor(options) {
if (!_options.getWallet) {
throw new Error('getWallet is not provided.');
}
const wallet = await _options.getWallet();
const executor = new SuiStepExecutor({
wallet,
routeId: options.routeId,
executionOptions: {
...options.executionOptions,
},
});
return executor;
},
setOptions(options) {
Object.assign(_options, options);
},
};
}
//# sourceMappingURL=Sui.js.map