mirror of
https://github.com/luxfi/safe-ios.git
synced 2026-10-30 15:19:20 +00:00
33 lines
821 B
Swift
33 lines
821 B
Swift
//
|
|
// AllocationsRequest.swift
|
|
// Multisig
|
|
//
|
|
// Created by Dmitry Bespalov on 23.08.22.
|
|
// Copyright © 2022 Gnosis Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct AllocationsRequest: JSONRequest {
|
|
var account: Address
|
|
var chainId: String
|
|
|
|
var httpMethod: String { "GET" }
|
|
|
|
var urlPath: String {
|
|
"/allocations/\(chainId)/\(account.checksummed).json"
|
|
}
|
|
|
|
typealias ResponseType = [Allocation]
|
|
|
|
func encode(to encoder: Encoder) throws {
|
|
// empty
|
|
}
|
|
}
|
|
|
|
extension SafeClaimingService {
|
|
func asyncAllocations(account: Address, chainId: String, completion: @escaping (Result<AllocationsRequest.ResponseType, Error>) -> Void) -> URLSessionTask? {
|
|
asyncExecute(request: AllocationsRequest(account: account, chainId: chainId), completion: completion)
|
|
}
|
|
}
|