Skip to content

Commit e0dd86c

Browse files
committed
add test button
1 parent d7cdf52 commit e0dd86c

File tree

1 file changed

+18
-0
lines changed
  • sample/modal/src/main/kotlin/com/reown/sample/modal/ui

1 file changed

+18
-0
lines changed

sample/modal/src/main/kotlin/com/reown/sample/modal/ui/LabScreen.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ fun LabScreen(
9494
item { BlueButton(text = "Personal sign", onClick = { sendPersonalSignRequest(account, {}, onError) }) }
9595
item { BlueButton(text = "Eth send transaction", onClick = { sendEthSendTransactionRequest(account, {}, onError) }) }
9696
item { BlueButton(text = "Eth sign typed data", onClick = { sendEthSignTypedDataRequest(account, {}, onError) }) }
97+
item { BlueButton(text = "Personal sign (ETH chainId)", onClick = { sendPersonalSignWithChainId(account, "eip155:1", {}, onError) }) }
9798
}
9899
}
99100
}
@@ -147,3 +148,20 @@ private fun sendEthSignTypedDataRequest(
147148
onError = onError,
148149
)
149150
}
151+
152+
private fun sendPersonalSignWithChainId(
153+
account: String,
154+
chainId: String,
155+
onSuccess: (SentRequestResult) -> Unit,
156+
onError: (Throwable) -> Unit
157+
) {
158+
AppKit.request(
159+
request = Request(
160+
method = "personal_sign",
161+
params = getPersonalSignBody(account),
162+
chainId = chainId
163+
),
164+
onSuccess = onSuccess,
165+
onError = onError,
166+
)
167+
}

0 commit comments

Comments
 (0)