Skip to content

Conversation

@Alejandbel
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Nov 13, 2025

@Alejandbel is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

@riveign riveign requested review from ganchoradkov and tomiir and removed request for tomiir November 14, 2025 09:21
} catch (e) {
throw new TonValidationError('Amount is invalid.')
}
// TODO: should include validation for sufficient amount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ganchoradkov we should probably push this to the spec if required

@tomiir tomiir mentioned this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants