Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
IOS- Sui: code rename Sui -> SUIUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
siblockchaina committed Sep 18, 2024
1 parent e893cc6 commit cc979b0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions BlockchainSdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@
F991B1C42C98463D00E3D0EC /* SuiNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B42C98463D00E3D0EC /* SuiNetworkService.swift */; };
F991B1C52C98463D00E3D0EC /* SuiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B52C98463D00E3D0EC /* SuiResponse.swift */; };
F991B1C62C98463D00E3D0EC /* SuiTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B62C98463D00E3D0EC /* SuiTarget.swift */; };
F991B1C72C98463D00E3D0EC /* Sui.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B82C98463D00E3D0EC /* Sui.swift */; };
F991B1C72C98463D00E3D0EC /* SUIUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B82C98463D00E3D0EC /* SUIUtils.swift */; };
F991B1C82C98463D00E3D0EC /* SuiAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1B92C98463D00E3D0EC /* SuiAddress.swift */; };
F991B1C92C98463D00E3D0EC /* SuiAddressService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1BA2C98463D00E3D0EC /* SuiAddressService.swift */; };
F991B1CA2C98463D00E3D0EC /* SuiError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F991B1BB2C98463D00E3D0EC /* SuiError.swift */; };
Expand Down Expand Up @@ -1868,7 +1868,7 @@
F991B1B42C98463D00E3D0EC /* SuiNetworkService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiNetworkService.swift; sourceTree = "<group>"; };
F991B1B52C98463D00E3D0EC /* SuiResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiResponse.swift; sourceTree = "<group>"; };
F991B1B62C98463D00E3D0EC /* SuiTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiTarget.swift; sourceTree = "<group>"; };
F991B1B82C98463D00E3D0EC /* Sui.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sui.swift; sourceTree = "<group>"; };
F991B1B82C98463D00E3D0EC /* SUIUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUIUtils.swift; sourceTree = "<group>"; };
F991B1B92C98463D00E3D0EC /* SuiAddress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiAddress.swift; sourceTree = "<group>"; };
F991B1BA2C98463D00E3D0EC /* SuiAddressService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiAddressService.swift; sourceTree = "<group>"; };
F991B1BB2C98463D00E3D0EC /* SuiError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuiError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4394,7 +4394,7 @@
isa = PBXGroup;
children = (
F991B1B72C98463D00E3D0EC /* Network */,
F991B1B82C98463D00E3D0EC /* Sui.swift */,
F991B1B82C98463D00E3D0EC /* SUIUtils.swift */,
F991B1B92C98463D00E3D0EC /* SuiAddress.swift */,
F991B1BA2C98463D00E3D0EC /* SuiAddressService.swift */,
F991B1BB2C98463D00E3D0EC /* SuiError.swift */,
Expand Down Expand Up @@ -5290,7 +5290,7 @@
DC5E650B2B1650F400E81AA5 /* OP_BIN2NUM.swift in Sources */,
B64A680B2BCE9E78009ED960 /* EthereumOptimisticRollupWalletManager.swift in Sources */,
DC5E64E42B1650F400E81AA5 /* OP_AND.swift in Sources */,
F991B1C72C98463D00E3D0EC /* Sui.swift in Sources */,
F991B1C72C98463D00E3D0EC /* SUIUtils.swift in Sources */,
DA52CBBB2C321026008ECB71 /* KoinosResourceLimitData.swift in Sources */,
0A54FF452BB475B9000D293D /* TangemNetworkLoggerPlugin.swift in Sources */,
EF54FC292A8A8A0E00968C52 /* CardanoUtil.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class SuiNetworkService: MultiNetworkProvider {
self.currentProviderIndex = 0
}

public func getBalance(address: String, coin: Sui.CoinType, cursor: String?) -> AnyPublisher<[SuiGetCoins.Coin], Error> {
public func getBalance(address: String, coin: SUIUtils.CoinType, cursor: String?) -> AnyPublisher<[SuiGetCoins.Coin], Error> {
balanceFetcher
.requestPublisher(with: { [weak self] nextAddress, nextCoin, nextCursor in
guard let self else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Sui.swift
// SUIUtils.swift
// BlockchainSdk
//
// Created by Sergei Iakovlev on 28.08.2024
Expand All @@ -8,7 +8,7 @@

import Foundation

struct Sui {
struct SUIUtils {
public static var SuiGasBudgetScaleUpConstant = Decimal(1000000)

public enum EllipticCurveID: UInt8 {
Expand Down
6 changes: 3 additions & 3 deletions BlockchainSdk/Blockchains/Sui/SuiAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import Foundation

struct SuiAddress {
public let formattedString: String
public let curveID: Sui.EllipticCurveID
public let curveID: SUIUtils.EllipticCurveID

public init(pubKey data: Data, curveID: Sui.EllipticCurveID = .ed25519) throws {
public init(pubKey data: Data, curveID: SUIUtils.EllipticCurveID = .ed25519) throws {
let payload = curveID.uint8.data + data

guard let hashed = payload.hashBlake2b(outputLength: 32) else {
Expand All @@ -25,7 +25,7 @@ struct SuiAddress {
self.curveID = curveID
}

public init(hex string: String, curveID: Sui.EllipticCurveID) throws {
public init(hex string: String, curveID: SUIUtils.EllipticCurveID) throws {
self.formattedString = string.hasHexPrefix() ? string : string.addHexPrefix()
self.curveID = curveID
}
Expand Down
2 changes: 1 addition & 1 deletion BlockchainSdk/Blockchains/Sui/SuiWalletManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ extension SuiWalletManager: TransactionFeeProvider {
throw WalletError.failedToParseNetworkResponse()
}

let budget = ((computationCost + storageCost + nonRefundableStorageFee) / Sui.SuiGasBudgetScaleUpConstant).rounded(scale: 1, roundingMode: .up) * Sui.SuiGasBudgetScaleUpConstant
let budget = ((computationCost + storageCost + nonRefundableStorageFee) / SUIUtils.SuiGasBudgetScaleUpConstant).rounded(scale: 1, roundingMode: .up) * SUIUtils.SuiGasBudgetScaleUpConstant

let feeAmount = Amount(with: manager.wallet.blockchain, value: budget / manager.wallet.blockchain.decimalValue)

Expand Down

0 comments on commit cc979b0

Please sign in to comment.