This repository was archived by the owner on Oct 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Sources/MagicSDK/Modules/Web3 Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,22 @@ public extension Web3.Eth {
6464 )
6565 properties. provider. send ( request: req, response: response)
6666 }
67+
68+ func signTypedDataV4(
69+ account: EthereumAddress ,
70+ data: EIP712TypedData ,
71+ response: @escaping Web3ResponseCompletion < EthereumData >
72+ ) {
73+ let req = RPCRequest < SignTypedDataCallParams > (
74+ id: properties. rpcId,
75+ jsonrpc: Web3 . jsonrpc,
76+ method: " eth_signTypedData_v4 " ,
77+ params: SignTypedDataCallParams (
78+ account: account, data: data
79+ )
80+ )
81+ properties. provider. send ( request: req, response: response)
82+ }
6783}
6884
6985// MARK: - web3 extension Promises
@@ -95,6 +111,13 @@ public extension Web3.Eth {
95111 signTypedDataV3 ( account: account, data: data, response: promiseResolver ( resolver) )
96112 }
97113 }
114+
115+ func signTypedDataV4(
116+ account: EthereumAddress , data: EIP712TypedData ) -> Promise < EthereumData > {
117+ return Promise { resolver in
118+ signTypedDataV4 ( account: account, data: data, response: promiseResolver ( resolver) )
119+ }
120+ }
98121}
99122
100123public extension RPCRequest {
You can’t perform that action at this time.
0 commit comments