Skip to content

Commit 2aa5e93

Browse files
authored
Merge pull request #1927 from MixinNetwork/feature/swap
Request swap with wallet id
2 parents cd2b5c6 + 28a2f8c commit 2aa5e93

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Mixin/Service/API/Model/SwapRequest.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import MixinServices
33

44
struct SwapRequest: Encodable {
55

6+
let walletId: String?
67
let payer: String
78
let inputMint: String
89
let inputAmount: String
@@ -14,6 +15,7 @@ struct SwapRequest: Encodable {
1415
let referral: String?
1516

1617
init(
18+
walletId: String?,
1719
sendToken: SwapToken,
1820
sendAmount: Decimal,
1921
receiveToken: SwapToken,
@@ -23,6 +25,7 @@ struct SwapRequest: Encodable {
2325
withdrawalDestination: String?,
2426
referral: String?,
2527
) {
28+
self.walletId = walletId
2629
self.payer = myUserId
2730
self.inputMint = sendToken.assetID
2831
self.inputAmount = TokenAmountFormatter.string(from: sendAmount)

Mixin/UserInterface/Controllers/Wallet/Swap/MixinSwapViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class MixinSwapViewController: SwapViewController {
103103
}
104104
sender.isBusy = true
105105
let request = SwapRequest(
106+
walletId: nil,
106107
sendToken: quote.sendToken,
107108
sendAmount: quote.sendAmount,
108109
receiveToken: quote.receiveToken,

Mixin/UserInterface/Controllers/Wallet/Swap/Web3SwapViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ final class Web3SwapViewController: SwapViewController {
120120
}
121121

122122
let request = SwapRequest(
123+
walletId: wallet.walletID,
123124
sendToken: quote.sendToken,
124125
sendAmount: quote.sendAmount,
125126
receiveToken: quote.receiveToken,

0 commit comments

Comments
 (0)