-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Gh 3360/nonces
- Loading branch information
Showing
8 changed files
with
121 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Multisig/Data/Services/Safe Client Gateway Service/SafeNoncesRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// SafeNoncesRequest.swift | ||
// Multisig | ||
// | ||
// Created by Dmitrii Bespalov on 02.11.23. | ||
// Copyright © 2023 Gnosis Ltd. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct SafeNoncesRequest: JSONRequest { | ||
var safeAddress: String | ||
var chainId: String | ||
var httpMethod: String { "GET" } | ||
|
||
var urlPath: String { | ||
"/v1/chains/\(chainId)/safes/\(safeAddress)/nonces" | ||
} | ||
|
||
typealias ResponseType = SCGModels.Nonces | ||
|
||
} | ||
|
||
extension SafeClientGatewayService { | ||
func asyncSafeNonces( | ||
chainId: String, | ||
safeAddress: Address, | ||
completion: @escaping (Result<SCGModels.Nonces, Error>) -> Void | ||
) -> URLSessionTask? { | ||
asyncExecute( | ||
request: SafeNoncesRequest(safeAddress: safeAddress.checksummed, | ||
chainId: chainId), | ||
completion: completion | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters