-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/Sui coin module #7
base: develop
Are you sure you want to change the base?
Conversation
b781bb6
to
2d53bc7
Compare
2d53bc7
to
96a36cb
Compare
@@ -105,6 +105,7 @@ setSupportedCurrencies([ | |||
"zksync_sepolia", | |||
"mantra", | |||
"xion", | |||
"sui", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add sui_testnet
here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question actually i didn't figured out why some coins needs this _testnet version. Possible because some coins haas different configs for mainnet and testnet tokens. I didn't spot any difference for now for sui so it looks like we don't need it and is better to remove sui_testnet from everewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, to be honest. Let's add testnet everywhere for consistency.
@@ -182,6 +182,9 @@ const modes: Readonly<Record<DerivationMode, ModeSpec>> = Object.freeze({ | |||
ton: { | |||
overridesDerivation: "44'/607'/0'/0'/<account>'/0'", | |||
}, | |||
sui: { | |||
overridesDerivation: "44'/784'/0'/0'/0'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should put <account>
placeholder somewhere. Probably at the last position.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible. According to documentation https://docs.sui.io/concepts/cryptography/transaction-auth/keys-addresses it should be 44'/784'/<account>'/0'/0'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed. It's the proper way and Sui Wallet uses it
import { getEnv } from "@ledgerhq/live-env"; | ||
import { ChainAPI } from "./chain"; | ||
|
||
export function traced(api: ChainAPI): ChainAPI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we use this? Is it required for anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we don't use it. It will be required when we will implement some request to indexer or any other sui related backend services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is anything else use that approach besides Solana?
|
||
function formatMsg({ reqId, msg, duration }: { reqId: number; msg?: string; duration?: number }) { | ||
const parts = [ | ||
`solana req id: ${reqId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sui
I guess if it's needed
default: "OUT", | ||
}; | ||
|
||
const MODE_TO_PALLET_METHOD: Record<SuiOperationMode | "sendMax", PalletMethod> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume those are not relevant. I understand that it was inherited from polkadot. Let's revisit it later once more functions are added and refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question for some reason solana and polkadot for example distinguishes regular transfer and transfer of all tokens from account. For now i can't answer why we need this i just followed common pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason for it is that in case of "transfer all" for native tokens we need to consider fees that are paid in native coins. On solana, there's also a special case that we should keep some SOL as an account rent fee.
* fix: history icon and label (sent/received) * cleanup
Fix/acc sync
feature: added paginated history for sui
β Checklist
npx changeset
was attached.π Description
Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing.
For libraries, you can add a code sample of how to use it.
For bug fixes, you can explain the previous behaviour and how it was fixed.
In case of visual features, please attach screenshots or video recordings to demonstrate the changes.
β Context
π§ Checklist for the PR Reviewers