Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jvonasek committed Dec 4, 2024
1 parent f368a59 commit c63f557
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/sections/web3-connect/signer/PolkadotSigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,24 @@ export class PolkadotSigner implements Signer {
const chain = genesisHashToChain(payload.genesisHash as `0x${string}`)
const chainId = POLKADOT_CAIP_ID_MAP[chain?.network]

let request = {
topic: this.session.topic,
chainId,
request: {
id: 1,
jsonrpc: "2.0",
method: "polkadot_signTransaction",
params: { address: payload.address, transactionPayload: payload },
},
try {
let request = {
topic: this.session.topic,
chainId,
request: {
id: 1,
jsonrpc: "2.0",
method: "polkadot_signTransaction",
params: { address: payload.address, transactionPayload: payload },
},
}
let { signature } = await this.client.request<Signature>(request)
return { id: ++this.id, signature }
} catch (err) {
throw new Error(
`Failed to sign transaction (${payload.genesisHash} ${chain?.network}): ${err}`,
)
}
let { signature } = await this.client.request<Signature>(request)
return { id: ++this.id, signature }
}

// this method is set this way to be bound to this class.
Expand Down

0 comments on commit c63f557

Please sign in to comment.