{"version":3,"sources":["jsdelivr-header.js","/npm/@mysten/wallet-standard@0.21.9/src/wallet.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignMessage.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignTransactionBlock.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignTransaction.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignAndExecuteTransactionBlock.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignAndExecuteTransaction.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiSignPersonalMessage.ts","/npm/@mysten/wallet-standard@0.21.9/src/features/suiGetCapabilities.ts","/npm/@mysten/wallet-standard@0.21.9/src/detect.ts","/npm/@mysten/wallet-standard@0.21.9/src/chains.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,4VCyBA,eAAsB,EACrB,EACA,EACC,CACD,GAAI,EAAO,SAAS,+BAAA,EACnB,OAAO,EAAO,SAAS,+BAAA,EAAiC,0BAA0B,CAAA,EAGnF,GAAI,CAAC,EAAO,SAAS,oCAAA,EACpB,MAAM,IAAI,MACT,oBAAoB,EAAO,IAAA,2DAAK,EAIlC,KAAM,CAAE,+BAAA,CAAA,EAAmC,EAAO,SAAS,oCAAA,EAErD,EAAmB,EAAY,KAAK,MAAM,EAAM,YAAY,OAAA,CAAQ,EACpE,CAAE,OAAA,EAAQ,WAAA,EAAY,eAAA,CAAA,EAAmB,MAAM,EAA+B,CACnF,QAAS,EAAM,QACf,MAAO,EAAM,MACb,iBAAA,EACA,QAAS,CACR,eAAgB,GAChB,aAAc,EACd,EACD,EAEK,CACL,CACC,aAAc,CAAC,CAAA,EACf,cAAe,CAAE,MAAO,CAAA,CAAA,CAAA,EAEtB,EAAI,iBAAiB,MAAM,EAAW,CAAA,CAAgB,EAI1D,MAAO,CACN,OAAA,EACA,UAAA,EACA,MALa,EAAI,gBAAgB,UAAU,CAAA,EAAgB,SAAA,EAM3D,QAAS,EAAS,IAAI,WAAW,CAAA,CAAY,CAC7C,EAGF,eAAsB,EACrB,EACA,EACC,CACD,GAAI,EAAO,SAAS,qBAAA,EACnB,OAAO,EAAO,SAAS,qBAAA,EAAuB,gBAAgB,CAAA,EAG/D,GAAI,CAAC,EAAO,SAAS,0BAAA,EACpB,MAAM,IAAI,MACT,oBAAoB,EAAO,IAAA,iDAAK,EAIlC,KAAM,CAAE,qBAAA,CAAA,EAAyB,EAAO,SAAS,0BAAA,EAG3C,CAAE,sBAAA,EAAuB,UAAA,CAAA,EAAc,MAAM,EAAqB,CACvE,iBAFmB,EAAY,KAAK,MAAM,EAAM,YAAY,OAAA,CAAQ,EAGpE,QAAS,EAAM,QACf,MAAO,EAAM,MACb,EAED,MAAO,CAAE,MAAO,EAAuB,UAAA,CAAW,ECzFnD,MAAa,EAAiB,kBCFjB,EAA0B,2BCD1B,EAAqB,sBCMrB,EAAoC,qCCNpC,EAA+B,gCCA/B,EAAyB,0BCHzB,EAAqB,sBCO5B,EAAyD,CAAC,EAAiB,CAAA,EAEjF,SAAgB,EACf,EACA,EAAmD,CAAA,EAC4B,CAC/E,MAAO,CAAC,GAAG,EAAmB,GAAG,CAAA,EAAoB,MACnD,GAAY,KAAW,EAAO,QAAA,ECXjC,MAAa,EAAmB,aAGnB,EAAoB,cAGpB,EAAqB,eAGrB,EAAoB,cAEpB,EAAa,CACzB,EACA,EACA,EACA,CACA,EAQD,SAAgB,EAAW,EAA4C,CACtE,OAAO,EAAW,SAAS,CAAA","file":"/npm/@mysten/wallet-standard@0.21.9/dist/index.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/@mysten/wallet-standard@0.21.9/dist/index.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/sui/bcs';\nimport { Transaction } from '@mysten/sui/transactions';\nimport { fromBase64, toBase64 } from '@mysten/sui/utils';\nimport type { WalletWithFeatures } from '@wallet-standard/core';\n\nimport type {\n\tSuiSignAndExecuteTransactionInput,\n\tSuiSignTransactionInput,\n\tSuiWalletFeatures,\n} from './features/index.js';\n\ndeclare module '@wallet-standard/core' {\n\texport interface Wallet {\n\t\t/**\n\t\t * Unique identifier of the Wallet.\n\t\t *\n\t\t * If not provided, the wallet name will be used as the identifier.\n\t\t */\n\t\treadonly id?: string;\n\t}\n\n\texport interface StandardConnectOutput {\n\t\tsupportedIntents?: string[];\n\t}\n}\n\nexport type { Wallet } from '@wallet-standard/core';\n\nexport async function signAndExecuteTransaction(\n\twallet: WalletWithFeatures<Partial<SuiWalletFeatures>>,\n\tinput: SuiSignAndExecuteTransactionInput,\n) {\n\tif (wallet.features['sui:signAndExecuteTransaction']) {\n\t\treturn wallet.features['sui:signAndExecuteTransaction'].signAndExecuteTransaction(input);\n\t}\n\n\tif (!wallet.features['sui:signAndExecuteTransactionBlock']) {\n\t\tthrow new Error(\n\t\t\t`Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`,\n\t\t);\n\t}\n\n\tconst { signAndExecuteTransactionBlock } = wallet.features['sui:signAndExecuteTransactionBlock'];\n\n\tconst transactionBlock = Transaction.from(await input.transaction.toJSON());\n\tconst { digest, rawEffects, rawTransaction } = await signAndExecuteTransactionBlock({\n\t\taccount: input.account,\n\t\tchain: input.chain,\n\t\ttransactionBlock,\n\t\toptions: {\n\t\t\tshowRawEffects: true,\n\t\t\tshowRawInput: true,\n\t\t},\n\t});\n\n\tconst [\n\t\t{\n\t\t\ttxSignatures: [signature],\n\t\t\tintentMessage: { value: bcsTransaction },\n\t\t},\n\t] = bcs.SenderSignedData.parse(fromBase64(rawTransaction!));\n\n\tconst bytes = bcs.TransactionData.serialize(bcsTransaction).toBase64();\n\n\treturn {\n\t\tdigest,\n\t\tsignature,\n\t\tbytes,\n\t\teffects: toBase64(new Uint8Array(rawEffects!)),\n\t};\n}\n\nexport async function signTransaction(\n\twallet: WalletWithFeatures<Partial<SuiWalletFeatures>>,\n\tinput: SuiSignTransactionInput,\n) {\n\tif (wallet.features['sui:signTransaction']) {\n\t\treturn wallet.features['sui:signTransaction'].signTransaction(input);\n\t}\n\n\tif (!wallet.features['sui:signTransactionBlock']) {\n\t\tthrow new Error(\n\t\t\t`Provided wallet (${wallet.name}) does not support the signTransaction feature.`,\n\t\t);\n\t}\n\n\tconst { signTransactionBlock } = wallet.features['sui:signTransactionBlock'];\n\n\tconst transaction = Transaction.from(await input.transaction.toJSON());\n\tconst { transactionBlockBytes, signature } = await signTransactionBlock({\n\t\ttransactionBlock: transaction,\n\t\taccount: input.account,\n\t\tchain: input.chain,\n\t});\n\n\treturn { bytes: transactionBlockBytes, signature };\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { WalletAccount } from '@wallet-standard/core';\n\n/**\n * Name of the feature.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n **/\nexport const SuiSignMessage = 'sui:signMessage';\n\n/**\n * The latest API version of the signMessage API.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport type SuiSignMessageVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for signing a personal message, and returning the\n * message bytes that were signed, and message signature.\n *\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport type SuiSignMessageFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignMessage]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignMessageVersion;\n\t\tsignMessage: SuiSignMessageMethod;\n\t};\n};\n\n/** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature */\nexport type SuiSignMessageMethod = (input: SuiSignMessageInput) => Promise<SuiSignMessageOutput>;\n\n/**\n * Input for signing messages.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport interface SuiSignMessageInput {\n\tmessage: Uint8Array;\n\taccount: WalletAccount;\n}\n\n/**\n * Output of signing messages.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport interface SuiSignMessageOutput {\n\t/** Base64 message bytes. */\n\tmessageBytes: string;\n\t/** Base64 encoded signature */\n\tsignature: string;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Transaction } from '@mysten/sui/transactions';\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** Name of the feature. */\nexport const SuiSignTransactionBlock = 'sui:signTransactionBlock';\n\n/** The latest API version of the signTransactionBlock API. */\nexport type SuiSignTransactionBlockVersion = '1.0.0';\n\n/**\n * @deprecated Use `sui:signTransaction` instead.\n *\n * A Wallet Standard feature for signing a transaction, and returning the\n * serialized transaction and transaction signature.\n */\nexport type SuiSignTransactionBlockFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignTransactionBlock]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignTransactionBlockVersion;\n\t\t/** @deprecated Use `sui:signTransaction` instead. */\n\t\tsignTransactionBlock: SuiSignTransactionBlockMethod;\n\t};\n};\n\n/** @deprecated Use `sui:signTransaction` instead. */\nexport type SuiSignTransactionBlockMethod = (\n\tinput: SuiSignTransactionBlockInput,\n) => Promise<SuiSignTransactionBlockOutput>;\n\n/** Input for signing transactions. */\nexport interface SuiSignTransactionBlockInput {\n\ttransactionBlock: Transaction;\n\taccount: WalletAccount;\n\tchain: IdentifierString;\n}\n\n/** Output of signing transactions. */\nexport interface SuiSignTransactionBlockOutput extends SignedTransactionBlock {}\n\nexport interface SignedTransactionBlock {\n\t/** Transaction as base64 encoded bcs. */\n\ttransactionBlockBytes: string;\n\t/** Base64 encoded signature */\n\tsignature: string;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** Name of the feature. */\nexport const SuiSignTransaction = 'sui:signTransaction';\n\n/** The latest API version of the signTransaction API. */\nexport type SuiSignTransactionVersion = '2.0.0';\n\n/**\n * A Wallet Standard feature for signing a transaction, and returning the\n * serialized transaction and transaction signature.\n */\nexport type SuiSignTransactionFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignTransaction]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignTransactionVersion;\n\t\tsignTransaction: SuiSignTransactionMethod;\n\t};\n};\n\nexport type SuiSignTransactionMethod = (\n\tinput: SuiSignTransactionInput,\n) => Promise<SignedTransaction>;\n\n/** Input for signing transactions. */\nexport interface SuiSignTransactionInput {\n\ttransaction: { toJSON: () => Promise<string> };\n\taccount: WalletAccount;\n\tchain: IdentifierString;\n\tsignal?: AbortSignal;\n}\n\n/** Output of signing transactions. */\n\nexport interface SignedTransaction {\n\t/** Transaction as base64 encoded bcs. */\n\tbytes: string;\n\t/** Base64 encoded signature */\n\tsignature: string;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tExecuteTransactionRequestType,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseOptions,\n} from '@mysten/sui/jsonRpc';\n\nimport type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock.js';\n\n/** Name of the feature. */\nexport const SuiSignAndExecuteTransactionBlock = 'sui:signAndExecuteTransactionBlock';\n\n/** The latest API version of the signAndExecuteTransactionBlock API. */\nexport type SuiSignAndExecuteTransactionBlockVersion = '1.0.0';\n\n/**\n * @deprecated Use `sui:signAndExecuteTransaction` instead.\n *\n * A Wallet Standard feature for signing a transaction, and submitting it to the\n * network. The wallet is expected to submit the transaction to the network via RPC,\n * and return the transaction response.\n */\nexport type SuiSignAndExecuteTransactionBlockFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignAndExecuteTransactionBlock]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignAndExecuteTransactionBlockVersion;\n\t\t/** @deprecated Use `sui:signAndExecuteTransaction` instead. */\n\t\tsignAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod;\n\t};\n};\n\n/** @deprecated Use `sui:signAndExecuteTransaction` instead. */\nexport type SuiSignAndExecuteTransactionBlockMethod = (\n\tinput: SuiSignAndExecuteTransactionBlockInput,\n) => Promise<SuiSignAndExecuteTransactionBlockOutput>;\n\n/** Input for signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionBlockInput extends SuiSignTransactionBlockInput {\n\t/**\n\t * @deprecated requestType will be ignored by JSON RPC in the future\n\t */\n\trequestType?: ExecuteTransactionRequestType;\n\t/** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */\n\toptions?: SuiTransactionBlockResponseOptions;\n}\n\n/** Output of signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionBlockOutput extends SuiTransactionBlockResponse {}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { SignedTransaction, SuiSignTransactionInput } from './suiSignTransaction.js';\n\n/** Name of the feature. */\nexport const SuiSignAndExecuteTransaction = 'sui:signAndExecuteTransaction';\n\n/** The latest API version of the signAndExecuteTransactionBlock API. */\nexport type SuiSignAndExecuteTransactionVersion = '2.0.0';\n\n/**\n * A Wallet Standard feature for signing a transaction, and submitting it to the\n * network. The wallet is expected to submit the transaction to the network via RPC,\n * and return the transaction response.\n */\nexport type SuiSignAndExecuteTransactionFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignAndExecuteTransaction]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignAndExecuteTransactionVersion;\n\t\tsignAndExecuteTransaction: SuiSignAndExecuteTransactionMethod;\n\t};\n};\n\nexport type SuiSignAndExecuteTransactionMethod = (\n\tinput: SuiSignAndExecuteTransactionInput,\n) => Promise<SuiSignAndExecuteTransactionOutput>;\n\n/** Input for signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionInput extends SuiSignTransactionInput {}\n\n/** Output of signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionOutput extends SignedTransaction {\n\tdigest: string;\n\t/** Transaction effects as base64 encoded bcs. */\n\teffects: string;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** Name of the feature. */\nexport const SuiSignPersonalMessage = 'sui:signPersonalMessage';\n\n/** The latest API version of the signPersonalMessage API. */\nexport type SuiSignPersonalMessageVersion = '1.1.0';\n\n/**\n * A Wallet Standard feature for signing a personal message, and returning the\n * message bytes that were signed, and message signature.\n */\nexport type SuiSignPersonalMessageFeature = {\n\t/** Namespace for the feature. */\n\t[SuiSignPersonalMessage]: {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignPersonalMessageVersion;\n\t\tsignPersonalMessage: SuiSignPersonalMessageMethod;\n\t};\n};\n\nexport type SuiSignPersonalMessageMethod = (\n\tinput: SuiSignPersonalMessageInput,\n) => Promise<SuiSignPersonalMessageOutput>;\n\n/** Input for signing personal messages. */\nexport interface SuiSignPersonalMessageInput {\n\tmessage: Uint8Array;\n\taccount: WalletAccount;\n\tchain?: IdentifierString;\n}\n\n/** Output of signing personal messages. */\nexport interface SuiSignPersonalMessageOutput extends SignedPersonalMessage {}\n\nexport interface SignedPersonalMessage {\n\t/** Base64 encoded message bytes */\n\tbytes: string;\n\t/** Base64 encoded signature */\n\tsignature: string;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport const SuiGetCapabilities = 'sui:getCapabilities';\n\n/** The latest API version of the getCapabilities API. */\nexport type SuiGetCapabilitiesVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for reporting intents supported by the wallet.\n */\nexport type SuiGetCapabilitiesFeature = {\n\t[SuiGetCapabilities]: {\n\t\tversion: SuiGetCapabilitiesVersion;\n\t\tgetCapabilities: SuiGetCapabilitiesMethod;\n\t};\n};\n\nexport type SuiGetCapabilitiesMethod = () => Promise<{\n\tsupportedIntents?: string[];\n}>;\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { StandardConnect, StandardEvents } from '@wallet-standard/core';\nimport type { Wallet, WalletWithFeatures } from '@wallet-standard/core';\n\nimport type { MinimallyRequiredFeatures } from './features/index.js';\n\n// These features are absolutely required for wallets to function in the Sui ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [StandardConnect, StandardEvents];\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n\twallet: Wallet,\n\tadditionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n\treturn [...REQUIRED_FEATURES, ...additionalFeatures].every(\n\t\t(feature) => feature in wallet.features,\n\t);\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { IdentifierString } from '@wallet-standard/core';\n\n/** Sui Devnet */\nexport const SUI_DEVNET_CHAIN = 'sui:devnet';\n\n/** Sui Testnet */\nexport const SUI_TESTNET_CHAIN = 'sui:testnet';\n\n/** Sui Localnet */\nexport const SUI_LOCALNET_CHAIN = 'sui:localnet';\n\n/** Sui Mainnet */\nexport const SUI_MAINNET_CHAIN = 'sui:mainnet';\n\nexport const SUI_CHAINS = [\n\tSUI_DEVNET_CHAIN,\n\tSUI_TESTNET_CHAIN,\n\tSUI_LOCALNET_CHAIN,\n\tSUI_MAINNET_CHAIN,\n] as const;\n\nexport type SuiChain = (typeof SUI_CHAINS)[number];\n\n/**\n * Utility that returns whether or not a chain identifier is a valid Sui chain.\n * @param chain a chain identifier in the form of `${string}:{$string}`\n */\nexport function isSuiChain(chain: IdentifierString): chain is SuiChain {\n\treturn SUI_CHAINS.includes(chain as SuiChain);\n}\n"]}