Skip to content

Commit

Permalink
wallet ts debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrajovic committed Jun 20, 2024
1 parent e61b69b commit 25c402f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,33 @@ export class MsgBroadcaster {
JSON.stringify(eip712TypedData),
tx.ethereumAddress,
)

console.log(JSON.stringify(eip712TypedData))

const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
pubKey: baseAccount.pubKey?.key,
eip712TypedData,
signature,
})

/** Preparing the transaction for client broadcasting */
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})


const { txRaw } = createTransaction({
message: msgs,
memo: tx.memo,
Expand All @@ -324,6 +344,8 @@ export class MsgBroadcaster {
/** Append Signatures */
txRawEip712.signatures = [hexToBuff(signature)]

console.log("signature:", hexToBuff(signature))

return walletStrategy.sendTransaction(txRawEip712, {
chainId,
endpoints,
Expand Down Expand Up @@ -408,13 +430,32 @@ export class MsgBroadcaster {
JSON.stringify(eip712TypedData),
tx.ethereumAddress,
)

console.log(JSON.stringify(eip712TypedData))

const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
pubKey: baseAccount.pubKey?.key,
eip712TypedData,
signature,
})

/** Preparing the transaction for client broadcasting */
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})

const { txRaw } = createTransaction({
message: msgs,
memo: tx.memo,
Expand All @@ -435,6 +476,8 @@ export class MsgBroadcaster {
/** Append Signatures */
txRawEip712.signatures = [hexToBuff(signature)]

console.log("signature:", hexToBuff(signature))

return walletStrategy.sendTransaction(txRawEip712, {
chainId,
endpoints,
Expand Down

0 comments on commit 25c402f

Please sign in to comment.