import { k as o, aq as c, G as d, I as g } from "./unsignedTransaction-DCDxTFq8.mjs";
import { E as h } from "./keypair-CP7syX9B.mjs";
import { ci as u } from "./platform-Cil_UtAQ.mjs";
async function l(t, i) {
  const [, s] = await o.chainFromRpc(t);
  return new m(s, t, h.deriveKeypair(i, "m/44'/784'/0'/0'/0'"));
}
class m {
  _chain;
  _client;
  _signer;
  _debug;
  constructor(i, s, r, n) {
    this._chain = i, this._client = s, this._signer = r, this._debug = n;
  }
  chain() {
    return this._chain;
  }
  address() {
    return this._signer.toSuiAddress();
  }
  async signAndSend(i) {
    const s = [];
    for (const r of i) {
      const { description: n, transaction: a } = r;
      this._debug && console.log(`Signing ${n} for ${this.address()}`);
      try {
        const e = await this._client.signAndExecuteTransaction({
          transaction: a,
          signer: this._signer
        });
        s.push(e.digest);
      } catch (e) {
        throw e;
      }
    }
    return s;
  }
}
const S = {
  Address: d,
  Platform: o,
  getSigner: l,
  protocols: {
    WormholeCore: () => import("./index-zIzzPp6D.mjs"),
    TokenBridge: () => import("./index-D1odbjeH.mjs"),
    CircleBridge: () => import("./index-C61IKE_V.mjs")
  },
  getChain: (t, i, s) => new c(i, new o(t, u(t, g, { [i]: s })))
};
export {
  S as default
};
