feat: refine TON ton_proof and sign data#943
Open
Alejandbel wants to merge 8 commits intoreown-com:mainfrom
Open
feat: refine TON ton_proof and sign data#943Alejandbel wants to merge 8 commits intoreown-com:mainfrom
Alejandbel wants to merge 8 commits intoreown-com:mainfrom
Conversation
|
@Alejandbel is attempting to deploy a commit to the Reown Team on Vercel. A member of the Team first needs to authorize it. |
tomiir
reviewed
Nov 21, 2025
| } catch (e) { | ||
| throw new TonValidationError('Amount is invalid.') | ||
| } | ||
| // TODO: should include validation for sufficient amount |
Contributor
There was a problem hiding this comment.
Can we remove this? would we need to implement somehting else?
Comment on lines
+209
to
+218
| this.validateSendMessage(params) | ||
|
|
||
| const messages = (params.messages || []).map(m => { | ||
| const amountBigInt = typeof m.amount === 'string' ? BigInt(m.amount) : BigInt(m.amount) | ||
| return internal({ | ||
| to: Address.parse(m.address), | ||
| bounce: Address.parseFriendly(m.address).isBounceable, | ||
| value: amountBigInt, | ||
| body: m.payload ?? 'Test transfer from ton WalletConnect' | ||
| body: m.payload ? Cell.fromBase64(m.payload) : 'Test transfer from ton WalletConnect', | ||
| init: m.stateInit ? loadStateInit(Cell.fromBase64(m.stateInit).beginParse()) : undefined |
Contributor
There was a problem hiding this comment.
Do you think we could do something like
const messages = parseTonMessages(params)
messages.map(.....)
Basically make the validation function return a validated, typed, version of the message so we avoid all of the duplicate parsing.
Wyt?
| }) | ||
|
|
||
| await walletContract.send(transfer) | ||
| await retry(() => walletContract.send(transfer)) |
Contributor
There was a problem hiding this comment.
Why do we need to enforce retries?
Comment on lines
+270
to
+279
| const wc = Buffer.alloc(4) | ||
| wc.writeUInt32BE(message.address.workChain) | ||
|
|
||
| const ts = Buffer.alloc(8) | ||
| ts.writeBigUInt64LE(BigInt(message.timestamp)) | ||
|
|
||
| const dl = Buffer.alloc(4) | ||
| dl.writeUInt32LE(message.domain.lengthBytes) | ||
|
|
||
| const m = Buffer.concat([ |
Contributor
There was a problem hiding this comment.
nit: could we include a comment ref to here these fields are defined?
Comment on lines
+439
to
+440
| sessionProperties.ton_getPublicKey = tonWallet.getPublicKey(); | ||
| sessionProperties.ton_getStateInit = tonWallet.getStateInit(); |
Contributor
There was a problem hiding this comment.
@ganchoradkov we should probably push this to the spec if required
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.