{"version":3,"file":"wallet-standard-tx-DBliTUWH.mjs","sources":["../.rollup-tmp/auth/providers/wallet-standard-tx.js"],"sourcesContent":["// wallet-standard-tx.ts - web3.js-dependent (de)serialization for the Wallet\n// Standard `solana:signTransaction` / `solana:signAndSendTransaction` features,\n// which exchange raw transaction BYTES. Split into its own module so\n// wallet-standard-discovery.ts can lazy-import it only when a transaction is\n// actually signed, keeping wallet listing + SIWS message login off the heavy\n// @solana/web3.js chunk. Mirrors the wire helpers in\n// @solana-mobile/mobile-wallet-adapter-protocol-web3js.\nimport { Transaction, VersionedTransaction, VersionedMessage, } from \"@solana/web3.js\";\nconst ED25519_SIGNATURE_LENGTH = 64;\n/** Serialize an unsigned Transaction/VersionedTransaction to the wire bytes the\n *  wallet-standard sign features expect (legacy skips signature verification). */\nexport function serializeUnsignedTx(tx) {\n    if (\"version\" in tx)\n        return tx.serialize();\n    return tx.serialize({ requireAllSignatures: false, verifySignatures: false });\n}\n/** Deserialize the signed bytes a wallet returns, round-tripping legacy or\n *  versioned transactions correctly. */\nexport function deserializeSignedTx(bytes) {\n    const messageOffset = bytes[0] * ED25519_SIGNATURE_LENGTH + 1;\n    const version = VersionedMessage.deserializeMessageVersion(bytes.slice(messageOffset, bytes.length));\n    return version === \"legacy\" ? Transaction.from(bytes) : VersionedTransaction.deserialize(bytes);\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,wBAAwB,GAAG,EAAE;AACnC;AACA;AACO,SAAS,mBAAmB,CAAC,EAAE,EAAE;AACxC,IAAI,IAAI,SAAS,IAAI,EAAE;AACvB,QAAQ,OAAO,EAAE,CAAC,SAAS,EAAE;AAC7B,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;AACjF;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,KAAK,EAAE;AAC3C,IAAI,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,wBAAwB,GAAG,CAAC;AACjE,IAAI,MAAM,OAAO,GAAG,gBAAgB,CAAC,yBAAyB,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AACxG,IAAI,OAAO,OAAO,KAAK,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,oBAAoB,CAAC,WAAW,CAAC,KAAK,CAAC;AACnG;;;;"}