Skip to content

Commit a12ba07

Browse files
authored
chore: send transaction updates (#180)
* chore: send transaction updates * bump build number
1 parent 28cb29a commit a12ba07

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Example/Tests/EthereumConvenienceMethodsTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class EthereumConvenienceMethodsTests: XCTestCase {
176176

177177
let expectation = self.expectation(description: "Request should return transaction hash result")
178178
performSuccessfulTask({
179-
await self.ethereum.sendTransaction(from: "0x1234", to: "0x5678", amount: "0x10")
179+
await self.ethereum.sendTransaction(from: "0x1234", to: "0x5678", value: "0x10")
180180
}, expectedValue: transactionHash, expectation: expectation)
181181
sendResultAndAwait(transactionHash, method: .ethSendTransaction)
182182
await fulfillment(of: [expectation], timeout: 2.0)

Example/metamask-ios-sdk/TransactionView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import metamask_ios_sdk
1111
struct TransactionView: View {
1212
@EnvironmentObject var metamaskSDK: MetaMaskSDK
1313

14-
@State private var amount = "0x000000000000000001"
14+
@State private var value = "0x8ac7230489e80000"
1515
@State var result: String = ""
1616
@State private var errorMessage = ""
1717
@State private var showError = false
@@ -43,9 +43,9 @@ struct TransactionView: View {
4343
}
4444

4545
Section {
46-
Text("Amount")
46+
Text("Value")
4747
.modifier(TextCallout())
48-
TextField("Amount", text: $amount)
48+
TextField("Value", text: $amount)
4949
.modifier(TextCaption())
5050
.frame(minHeight: 32)
5151
.modifier(TextCurvature())
@@ -108,7 +108,7 @@ struct TransactionView: View {
108108

109109
let transactionResult = isConnectWith
110110
? await metamaskSDK.connectWith(transactionRequest)
111-
: await metamaskSDK.sendTransaction(from: metamaskSDK.account, to: to, amount: amount)
111+
: await metamaskSDK.sendTransaction(from: metamaskSDK.account, to: to, value: value)
112112

113113
showProgressView = false
114114

Sources/metamask-ios-sdk/Classes/Ethereum/Ethereum.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,12 @@ public class Ethereum {
343343
await ethereumRequest(method: .ethSignTypedDataV4, params: [address, typedData])
344344
}
345345

346-
func sendTransaction(from: String, to: String, amount: String) async -> Result<String, RequestError> {
346+
func sendTransaction(from: String, to: String, value: String) async -> Result<String, RequestError> {
347347
await ethereumRequest(method: .ethSendTransaction, params: [
348348
[
349349
"from": from,
350350
"to": to,
351-
"amount": amount
351+
"value": value
352352
]
353353
])
354354
}

Sources/metamask-ios-sdk/Classes/SDK/MetaMaskSDK.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ public extension MetaMaskSDK {
170170
await ethereum.signTypedDataV4(typedData: typedData, address: address)
171171
}
172172

173-
func sendTransaction(from: String, to: String, amount: String) async -> Result<String, RequestError> {
174-
await ethereum.sendTransaction(from: from, to: to, amount: amount)
173+
func sendTransaction(from: String, to: String, value: String) async -> Result<String, RequestError> {
174+
await ethereum.sendTransaction(from: from, to: to, value: value)
175175
}
176176

177177
func sendRawTransaction(signedTransaction: String) async -> Result<String, RequestError> {

metamask-ios-sdk.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'metamask-ios-sdk'
3-
s.version = '0.8.2'
3+
s.version = '0.8.3'
44
s.summary = 'Enable users to easily connect with their MetaMask Mobile wallet.'
55
s.swift_version = '5.5'
66

0 commit comments

Comments
 (0)