OneKeyHQ / app-monorepo

Secure, open source and community driven crypto wallet runs on all platforms and trusted by millions.
https://onekey.so
Other
2.01k stars 384 forks source link

[Feature] Support Stacks Blockchain #3892

Open friedger opened 12 months ago

friedger commented 12 months ago

Is your feature request related to a problem? Please describe. As a Stx holder, I would like to send and receive stx. Ideally, I would be able to stack/stake my stx.

Describe the solution you'd like The app should show the stx balance and let me receive and send stx.

Support for sip9 tokens would be the next step.

Describe alternatives you've considered Use a different app 😭

Additional context I can help developing, but need some guidance about the process.

ByteZhang1024 commented 12 months ago

You can refer to it first. https://github.com/OneKeyHQ/app-monorepo/pull/3146

If there's anything you don't understand, or that method doesn't understand, I'll help you out.

friedger commented 11 months ago

@ByteZhang1024 What is the different between IEncodedTx and IDecodedTx? They are both structured objects.

ByteZhang1024 commented 11 months ago

IEncodedTx It is generally defined in terms of different chains, usually transaction formats. It is primarily an object of direct flow within our internal business. e.g Everyone is familiar with ETH.

export type IEncodedTxEvm = {
  from: string;
  to: string;
  value: string;
  data?: string;
  customData?: string;
  nonce?: number | string;

  gas?: string;
  gasLimit?: string;
  gasPrice?: string;
  maxFeePerGas?: string;
  maxPriorityFeePerGas?: string;
};

IDecodedTx Is a format we define for trading decode, which is used for various ui presentations. Transactions from any other chain can be converted into i decoded tx to display information on different business pages. It can be converted from IEncodedTx e.g https://github.com/OneKeyHQ/app-monorepo/blob/onekey/packages/engine/src/vaults/impl/evm/Vault.ts#L238

friedger commented 11 months ago

@ByteZhang1024 Thank you for the clarification.

How do you handle testnets? I see that create createClientFromURL does not take a testnet or chainid flag.

ByteZhang1024 commented 11 months ago

packages/shared/src/config/presetNetworks.ts Looking at the format here, just add a test chain.