You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
i want to implement one-Click Auth in my iOS app, i am following this documentation https://docs.walletconnect.com/walletkit/ios/one-click-auth
i have also checked the example app and followed that too, in all the cases i found 'signatureVerificationFailed' as a response
this is the code i'm using
let walletAccount = Account(
chainIdentifier: "eip155:1",
address: "0x724d0D2DaD3fbB0C168f947B87Fa5DBe36F1A8bf"
)!
let prvKey = Data(hex: "462c1dad6832d7d96ccf87bd6a686a4110e114aaaebd5512e552c0e3a87b480f")
public func acceptOneAuthRequestNew() {
guard let request = oneAuthRequest else {
return
}
let requestedChains = Set(request.payload.chains.compactMap { Blockchain($0) })
let supportedChainsArray = [Blockchain("eip155:1")!,
Blockchain("eip155:11155111")!,
Blockchain("eip155:137")!,
Blockchain("eip155:80001")!,
Blockchain("eip155:43114")!,
Blockchain("eip155:43113")!,
Blockchain("eip155:56")!]
let supportedChains = Set(supportedChainsArray)
let commonChains = requestedChains.intersection(supportedChains)
let supportedMethods = ["personal_sign", "eth_sendTransaction"]
Task(priority: .high) {
var authObjects = [AuthObject]()
for chain in commonChains {
let accountForChain = Account(blockchain: chain, address: walletAccount.address)!
let supportedAuthPayload = try Web3Wallet.instance.buildAuthPayload(
payload: request.payload,
supportedEVMChains: Array(commonChains),
supportedMethods: supportedMethods
)
let formattedMessage = try Web3Wallet.instance.formatAuthMessage(
payload: supportedAuthPayload,
account: walletAccount
)
let signerFactory = DefaultSignerFactory()
let signer = MessageSignerFactory(signerFactory: signerFactory).create()
let signature = try signer.sign(
message: formattedMessage,
privateKey: prvKey,
type: .eip191
)
let authObject = try Web3Wallet.instance.buildSignedAuthObject(
authPayload: supportedAuthPayload,
signature: signature,
account: walletAccount
)
authObjects.append(authObject)
}
do {
let sessions = try await Web3Wallet.instance.approveSessionAuthenticate(
requestId: request.id,
auths: authObjects
)
print("sessions:", sessions)
} catch {
print("oneAuth:failed: \(error)")
}
}
}
The text was updated successfully, but these errors were encountered:
Describe the bug
i want to implement one-Click Auth in my iOS app, i am following this documentation
https://docs.walletconnect.com/walletkit/ios/one-click-auth
i have also checked the example app and followed that too, in all the cases i found 'signatureVerificationFailed' as a response
this is the code i'm using
let walletAccount = Account(
chainIdentifier: "eip155:1",
address: "0x724d0D2DaD3fbB0C168f947B87Fa5DBe36F1A8bf"
)!
let prvKey = Data(hex: "462c1dad6832d7d96ccf87bd6a686a4110e114aaaebd5512e552c0e3a87b480f")
public func acceptOneAuthRequestNew() {
guard let request = oneAuthRequest else {
return
}
let requestedChains = Set(request.payload.chains.compactMap { Blockchain($0) })
let supportedChainsArray = [Blockchain("eip155:1")!,
Blockchain("eip155:11155111")!,
Blockchain("eip155:137")!,
Blockchain("eip155:80001")!,
Blockchain("eip155:43114")!,
Blockchain("eip155:43113")!,
Blockchain("eip155:56")!]
}
The text was updated successfully, but these errors were encountered: