Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
db62a43
feat(onekey): support Sui, Stellar, TON, TRON, Cardano and NEAR
hippocampusSK Oct 28, 2026
65fad9e
refactor(wallet-extensions): share the TON Connect flow between OKX a…
hippocampusSK Oct 29, 2026
c1f469f
Merge remote-tracking branch 'origin/develop' into feature/onekey-mul…
hippocampusSK Nov 3, 2026
64941e0
fix(onekey): connect one network at a time and stop when the user can…
hippocampusSK Nov 3, 2026
5de1d66
test(onekey): reset the TON Connect manifest after the manifest error…
hippocampusSK Nov 3, 2026
3aa83bd
fix(onekey): read the TRON address from OneKey instead of its injecte…
hippocampusSK Nov 3, 2026
aabb2f0
refactor(onekey): move Sui support to its own pull request
hippocampusSK Nov 3, 2026
f210ab9
refactor(onekey): move Cardano support to its own pull request
hippocampusSK Nov 3, 2026
d2817af
feat(onekey): support Cardano
hippocampusSK Nov 3, 2026
160f5ea
fix(onekey): stop the connection on EVM cancels and only on real reje…
hippocampusSK Nov 3, 2026
e2e0e0a
Merge branch 'feature/onekey-multichain-support' into feature/onekey-…
hippocampusSK Nov 3, 2026
3e95b22
fix(onekey): connect TRON after OneKey's first approval and sign with…
hippocampusSK Nov 3, 2026
1099467
Merge branch 'feature/onekey-multichain-support' into feature/onekey-…
hippocampusSK Nov 3, 2026
24d1522
fix(onekey): keep TRON's signature check on the transaction that was …
hippocampusSK Nov 3, 2026
1508a7a
Merge branch 'feature/onekey-multichain-support' into feature/onekey-…
hippocampusSK Nov 3, 2026
5aa894c
Merge remote-tracking branch 'origin/develop' into feature/onekey-mul…
hippocampusSK Nov 3, 2026
b628f3d
Merge branch 'feature/onekey-multichain-support' into feature/onekey-…
hippocampusSK Nov 3, 2026
65a5d0e
Merge branch 'develop' into feature/onekey-cardano-support
hippocampusSK Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/onekey-cardano-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/wallet-extensions": minor
---

OneKey now connects Cardano on mainnet.
26 changes: 26 additions & 0 deletions packages/wallet-extensions/src/onekey/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,30 @@ async function getTronWalletMethods() {
return { ...getTronToolbox({ signer }), address };
}

async function getCardanoWalletMethods() {
const api = await getProvider("cardano", Chain.Cardano).enable();
if ((await api.getNetworkId()) !== 1) throw mainnetOnlyError(Chain.Cardano);

const { addCardanoVkeyWitnesses, decodeCardanoWitnessSet, getCardanoAddressFromBytes, getCardanoToolbox } =
await import("@swapkit/toolboxes/cardano");

const changeAddress = await api.getChangeAddress();
const address = changeAddress.startsWith("addr")
? changeAddress
: await getCardanoAddressFromBytes(hex.decode(changeAddress));

const signer = {
address,
connect: () => Promise.resolve({ address }),
disconnect: () => Promise.resolve(),
getAddress: () => Promise.resolve(address),
signTransaction: async (transaction: string) =>
addCardanoVkeyWitnesses(transaction, await decodeCardanoWitnessSet(await api.signTx(transaction))),
};

return { ...getCardanoToolbox({ signer }), address };
}

async function getStellarWalletMethods() {
const provider = getProvider("stellar", Chain.Stellar);
const { address } = await provider.getAddress();
Expand Down Expand Up @@ -211,6 +235,8 @@ export function getWalletMethods(chain: Chain): Promise<WalletMethodsWithAddress
switch (chain) {
case Chain.Bitcoin:
return getBitcoinWalletMethods();
case Chain.Cardano:
return getCardanoWalletMethods();
case Chain.Near:
return getNearWalletMethods();
case Chain.Solana:
Expand Down
2 changes: 2 additions & 0 deletions packages/wallet-extensions/src/onekey/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const onekeyWallet: ExtensionWallet<"connectOnekeyWallet"> = createWallet
[Chain.Base]: { direct: true, typedData: true },
[Chain.BinanceSmartChain]: { direct: true, typedData: true },
[Chain.Bitcoin]: { direct: true },
[Chain.Cardano]: { direct: true },
[Chain.Ethereum]: { direct: true, typedData: true },
[Chain.Gnosis]: { direct: true, typedData: true },
[Chain.Near]: { direct: true },
Expand All @@ -59,6 +60,7 @@ export const onekeyWallet: ExtensionWallet<"connectOnekeyWallet"> = createWallet
Chain.Base,
Chain.BinanceSmartChain,
Chain.Bitcoin,
Chain.Cardano,
Chain.Ethereum,
Chain.Gnosis,
Chain.Near,
Expand Down
7 changes: 7 additions & 0 deletions packages/wallet-extensions/src/onekey/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export type OneKeyTronProvider = {
};
};

export type OneKeyCardanoApi = {
getChangeAddress: () => Promise<string>;
getNetworkId: () => Promise<number>;
signTx: (transaction: string, partialSign?: boolean) => Promise<string>;
};

export type OneKeyStellarProvider = {
getAddress: () => Promise<{ address: string }>;
getNetwork: () => Promise<{ network: string; networkPassphrase: string }>;
Expand All @@ -35,6 +41,7 @@ export type OneKeyStellarProvider = {

export type OneKeyProviders = {
btc?: OneKeyBtcProvider;
cardano?: { enable: () => Promise<OneKeyCardanoApi> };
ethereum?: Eip1193Provider;
jsBridge?: OneKeyJsBridge;
solana?: SolanaProvider;
Expand Down
Loading