import { a } from "../../../index-DEq3oXQF.js";
import { utils as l } from "@defuse-protocol/internal-utils";
import i from "bs58";
function o(n) {
  return `ed25519:${i.encode(a.from(n, "base64"))}`;
}
class u {
  constructor(e, t, s) {
    this.account = e, this.stellarWallet = t, this.plugin = s;
  }
  async signIntent(e) {
    const t = JSON.stringify({
      verifying_contract: e.verifying_contract,
      deadline: e.deadline,
      nonce: e.nonce,
      intents: e.intents,
      signer_id: e.signer_id ?? l.authHandleToIntentsUserId({
        identifier: this.account.walletAddress,
        method: "stellar"
      })
    }), { signedMessage: s } = await this.stellarWallet.signMessage(t), r = this.plugin.decodePublicKey(this.stellarWallet);
    return {
      payload: t,
      public_key: `ed25519:${i.encode(r)}`,
      standard: "sep53",
      signature: o(s)
    };
  }
}
export {
  u as IntentSignerStellar
};
//# sourceMappingURL=stellar.js.map
