Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for modern Xcode versions, support for secp256k1, RPC endpoint parity #3

Merged
merged 40 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
91567aa
temporarily disable tests
samingle Jan 14, 2022
6610ecd
pod updates to get example app building in latest Xcode
samingle Jan 14, 2022
ce8bdd2
Added macOS Finder metadata file to gitignore
samingle Jan 17, 2022
9268a8d
compiling with swift concurrency
samingle Jan 18, 2022
0c47ea1
update tableview async
samingle Jan 18, 2022
d062e50
Starting bringing tests back online
samingle Jan 20, 2022
a08b393
Get a few account tests working
kvnm Jan 22, 2022
4950154
Get account tests (mostly) working - no solution for Log checking fro…
kvnm Jan 24, 2022
24256f2
Match original test suite beforeSuite() and js test setup a little be…
kvnm Jan 25, 2022
306bb8a
restore SeriallizeSpec tests
samingle Jan 25, 2022
7f946b8
remove unused pods
samingle Jan 25, 2022
7f44252
restore keypairspec
samingle Jan 25, 2022
3eeb209
SignerSpec restored
samingle Jan 25, 2022
4f28ce3
Get AccessKeySpec tests working
kvnm Jan 26, 2022
fcbf977
KeyStore tests restored
samingle Jan 26, 2022
4f3d74d
WalletAccount tests restored
samingle Jan 26, 2022
ae082c7
Add updated wasm file and begin getting promises tests online
kvnm Jan 27, 2022
00d1cc1
rework `query` function to match current documentation, remove some s…
samingle Jan 27, 2022
fad152e
Update remainder of network data to match documentation param style
samingle Jan 27, 2022
989e9a5
Get Promises tests working again
kvnm Jan 27, 2022
943dd32
Get ProviderSpec tests working
miancadonc Jan 27, 2022
f2d6def
Secp256k1 signing working locally
samingle Jan 28, 2022
e09441a
Secp256k1 support working
samingle Feb 1, 2022
55ce59f
Add block changes and gas price RPC endpoints
kvnm Feb 2, 2022
8b69783
Fully support block info
kvnm Feb 7, 2022
492320e
Implement chunk details and tighten up block/chunk query params
kvnm Feb 7, 2022
1c4d9eb
Add EXPERIMENTAL_changes methods
kvnm Feb 9, 2022
4b1f65b
add EXPERIMENTAL_genesis_config and EXPERIMENTAL_protocol_config
miancadonc Feb 9, 2022
e84fd40
implement EXPERIMENTAL_genesis_cofig and EXPERIMENTAL_protocol_config
miancadonc Feb 9, 2022
1768f84
Add EXPERIMENTAL_tx_status and providers methods
kvnm Feb 9, 2022
0233af0
updated values on serialize test
samingle Feb 9, 2022
9c8ca67
add basic support for async transactions
samingle Feb 9, 2022
d5632dd
implement networkInfo endpoint
miancadonc Feb 9, 2022
d7556f8
renamed variables from snake_case to camelCase for more Swift native …
samingle Feb 14, 2022
ee88537
Bump podspec major due to backwards incompatible changes
samingle Feb 14, 2022
8c324f8
WIP: DefaultAuthService as a WBWebView
kvnm Feb 17, 2022
ce8c4da
moved auth service to correct spot
samingle Feb 17, 2022
a6b92cf
change contract_id to optional to match js api
samingle Feb 17, 2022
6972cab
Finish moving example app to DefaultAuthService
kvnm Feb 17, 2022
205abf9
some light cleanup before PR
samingle Feb 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## macOS
.DS_Store

## User settings
xcuserdata/

Expand Down
31 changes: 18 additions & 13 deletions Example/AccountViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import UIKit
import nearclientios
import PromiseKit
import AwaitKit

struct AccountStateField {
let title: String
Expand All @@ -27,8 +25,10 @@ class AccountViewController: UITableViewController {
super.viewDidLoad()
title = "Near account"
setupSignOutButton()
accountState = fetchAccountState()
setupData(with: accountState!)
Task {
accountState = await fetchAccountState()
await setupData(with: accountState!)
}
// Do any additional setup after loading the view, typically from a nib.
}

Expand All @@ -46,8 +46,10 @@ extension AccountViewController {
}

@objc private func back(sender: UIBarButtonItem) {
walletAccount?.signOut()
navigationController?.popViewController(animated: true)
Task {
await walletAccount?.signOut()
navigationController?.popViewController(animated: true)
}
}
}

Expand All @@ -57,16 +59,19 @@ extension AccountViewController {
walletAccount = wallet
}

private func fetchAccountState() -> AccountState {
let account = try! await(near!.account(accountId: walletAccount!.getAccountId()))
return try! await(account.state())
private func fetchAccountState() async -> AccountState {
let account = try! await near!.account(accountId: walletAccount!.getAccountId())
return try! await account.state()
}

private func setupData(with accountState: AccountState) {
data.append(AccountStateField(title: "Account ID", value: walletAccount!.getAccountId()))
let balance = String(accountState.amount.prefix(accountState.amount.count - 24)) //24 near indivisible units
private func setupData(with accountState: AccountState) async {
data.append(AccountStateField(title: "Account ID", value: await walletAccount!.getAccountId()))
let balance = String( ) //24 near indivisible units
data.append(AccountStateField(title: "Balance", value: balance))
data.append(AccountStateField(title: "Storage (used/paid)", value: "\(accountState.storage_usage.toStorageUnit())/\(accountState.storage_paid_at.toStorageUnit())"))
data.append(AccountStateField(title: "Storage (used/paid)", value: "\(accountState.storageUsage.toStorageUnit())/\(accountState.storagePaidAt.toStorageUnit())"))
await MainActor.run {
tableView.reloadData()
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ target 'nearclientios_Example' do

target 'nearclientios_Tests' do
inherit! :search_paths
pod 'Quick'
pod 'Nimble'
end
end
62 changes: 21 additions & 41 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,63 +1,43 @@
PODS:
- AwaitKit (5.2.0):
- PromiseKit (~> 6)
- Base58Swift (2.1.7):
- BigInt (~> 3.1)
- BigInt (3.1.0):
- SipHash (~> 1.2)
- KeychainAccess (4.1.0)
- nearclientios (0.1.0):
- AwaitKit (~> 5.0)
- Base58Swift (~> 2.1.7)
- KeychainAccess (~> 4.1.0)
- AnyCodable-FlightSchool (0.6.2)
- Base58Swift (2.1.10):
- BigInt (~> 5.0.0)
- BigInt (5.0.0)
- KeychainAccess (4.2.2)
- nearclientios (1.0.0):
- AnyCodable-FlightSchool (~> 0.6.0)
- Base58Swift (~> 2.1.10)
- KeychainAccess (~> 4.2.2)
- secp256k1.swift
- TweetNacl (~> 1.0)
- Nimble (8.0.4)
- PromiseKit (6.11.0):
- PromiseKit/CorePromise (= 6.11.0)
- PromiseKit/Foundation (= 6.11.0)
- PromiseKit/UIKit (= 6.11.0)
- PromiseKit/CorePromise (6.11.0)
- PromiseKit/Foundation (6.11.0):
- PromiseKit/CorePromise
- PromiseKit/UIKit (6.11.0):
- PromiseKit/CorePromise
- Quick (2.2.0)
- SipHash (1.2.2)
- secp256k1.swift (0.1.4)
- TweetNacl (1.0.2)

DEPENDENCIES:
- nearclientios (from `../`)
- Nimble
- Quick

SPEC REPOS:
trunk:
- AwaitKit
- AnyCodable-FlightSchool
- Base58Swift
- BigInt
- KeychainAccess
- Nimble
- PromiseKit
- Quick
- SipHash
- secp256k1.swift
- TweetNacl

EXTERNAL SOURCES:
nearclientios:
:path: "../"

SPEC CHECKSUMS:
AwaitKit: 512626cd12c82b1fbffddc8f414d0364cb456004
Base58Swift: 149c9dd95d8712f00e4695b36baafb3031927256
BigInt: 76b5dfdfa3e2e478d4ffdf161aeede5502e2742f
KeychainAccess: 445e28864fe6d3458b41fa211bcdc39890e8bd5a
nearclientios: ea8e674ac9dde3cfd1e6f53f9dbb53f724bfd903
Nimble: 18d5360282923225d62b09d781f63abc1a0111fc
PromiseKit: e4863d06976e7dee5e41c04fc7371c16b3600292
Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e
SipHash: fad90a4683e420c52ef28063063dbbce248ea6d4
AnyCodable-FlightSchool: ac75ed9bae659e16a41ebfa6c71a663d6f2c111c
Base58Swift: 53d551f0b33d9478fa63b3445e453a772d6b31a7
BigInt: 74b4d88367b0e819d9f77393549226d36faeb0d8
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
nearclientios: 29ed49caa33e70c861dafea8c1a550e3fd802cce
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
TweetNacl: 3abf4d1d2082b0114e7a67410e300892448951e6

PODFILE CHECKSUM: 94032e5674b919cac77bff067f1a3ae57504b308
PODFILE CHECKSUM: bf2ede311928de0026e7155c3c779a7c3a7fed9d

COCOAPODS: 1.9.2
COCOAPODS: 1.11.2
Loading