Code Monkey home page Code Monkey logo

xpringkit's Introduction

This library is deprecated

In mobile apps (e.g. iOS and Android), you can integrate with the XRP Ledger using JavaScript libraries (example: XUMM).

*DEPRECATED* XpringKit

DEPRECATION NOTICE: This library is no longer actively maintained.

XpringKit is the Swift client side library of the Xpring SDK.

Features

XpringKit provides the following features:

  • Wallet generation and derivation (Seed or HD Wallet based)
  • Address validation
  • Account balance retrieval
  • Sending XRP payments
  • Retrieval of payment transactions and account payment history
  • Enabling of Deposit Authorization for an XRPL account

Installation

Client Side Library

Carthage

XpringKit is available via Carthage. Simply add the following to your Cartfile:

github "xpring-eng/XpringKit"

CocoaPods

XpringKit is available via CocoaPods. Simply add the following to your Podfile:

pod 'XpringKit'

rippled Node

Xpring SDK needs to communicate with a rippled node which has gRPC enabled. Consult the rippled documentation for details on how to build your own node.

To get developers started right away, Xpring currently provides nodes:

# Testnet
test.xrp.xpring.io:50051

# Mainnet
main.xrp.xpring.io:50051

Hermes Node

Xpring SDK's IlpClient needs to communicate with Xpring's ILP infrastructure through an instance of Hermes.

In order to connect to the Hermes instance that Xpring currently operates, you will need to create an ILP wallet here

Once your wallet has been created, you can use the gRPC URL specified in your wallet, as well as your access token to check your balance and send payments over ILP.

Usage: XRP

Note: Xpring SDK only works with the X-Address format. For more information about this format, see the Utilities section and http://xrpaddress.info.

Wallets

A wallet is a fundamental model object in XpringKit which provides key management, address derivation, and signing functionality. Wallets can be derived from either a seed or a mnemonic and derivation path. You can also choose to generate a new random HD wallet.

Wallet Derivation

XpringKit can derive a wallet from a seed or it can derive a hierarchical deterministic wallet (HDWallet) from a mnemonic and derivation path.

Hierarchical Deterministic Wallets

A hierarchical deterministic wallet is created using a mnemonic and a derivation path. Simply pass the mnemonic and derivation path to the wallet generation function. Note that you can omit the derivation path and have a default path be used instead.

import XpringKit

let mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"

let hdWallet1 = Wallet.generateWalletFromMnemonic(mnemonic: mnemonic)! // Has default derivation path
let hdWallet2 = Wallet(mnemonic: mnemonic, derivationPath: Wallet.defaultDerivationPath)! // Same as hdWallet1

let hdWallet = Wallet(mnemonic: mnemonic, derivationPath: "m/44'/144'/0'/0/1"); // Wallet with custom derivation path.
Seed Based Wallets

You can construct a seed based wallet by passing a base58check encoded seed string.

import XpringKit

let seedWallet = Wallet(seed: "snRiAJGeKCkPVddbjB3zRwiYDBm1M")!

Wallet Generation

XpringKit can generate a new and random HD Wallet. The result of a wallet generation call is a tuple which contains the following:

  • A randomly generated mnemonic
  • The derivation path used, which is the default path
  • A reference to the new wallet
import XpringKit

// Generate a random wallet.
let generationResult = Wallet.generateRandomWallet()!
let newWallet = generationResult.wallet

// Wallet can be recreated with the artifacts of the initial generation.
let copyOfNewWallet = Wallet(mnemonic: generationResult.mnemonic, derivationPath: generationResult.derivationPath)

Wallet Properties

A generated wallet can provide its public key, private key, and address on the XRP ledger.

import XpringKit

let mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";

let wallet = Wallet(mnemonic: mnemonic)!

print(wallet.address) // XVMFQQBMhdouRqhPMuawgBMN1AVFTofPAdRsXG5RkPtUPNQ
print(wallet.publicKey) // 031D68BC1A142E6766B2BDFB006CCFE135EF2E0E2E94ABB5CF5C9AB6104776FBAE
print(wallet.privateKey) // 0090802A50AA84EFB6CDB225F17C27616EA94048C179142FECF03F4712A07EA7A4

Signing / Verifying

A wallet can also sign and verify arbitrary hex messages. Generally, users should use the functions on XRPClient to perform cryptographic functions rather than using these low level APIs.

import XpringKit

let mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
let message = "deadbeef";

let wallet = Wallet(mnemonic: mnemonic)!

let signature = wallet.sign(message)
wallet.verify(message, signature); // true

XRPClient

XRPClient is a gateway into the XRP Ledger. XRPClient is initialized with a single parameter, which is the URL of the remote adapter (see: ‘Server Side Component’ section above).

import XpringKit

let remoteURL = "test.xrp.xpring.io:50051"; // Testnet URL, use main.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

Retrieving a Balance

An XRPClient can check the balance of an account on the XRP Ledger.

import XpringKit

let remoteURL = "test.xrp.xpring.io:50051"; // Testnet URL, use main.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

let address = "XVMFQQBMhdouRqhPMuawgBMN1AVFTofPAdRsXG5RkPtUPNQ"

let balance = try! xrpClient.getBalance(for: address)
print(balance) // Logs a balance in drops of XRP

Checking Payment Status

An XRPClient can check the status of a payment on the XRP Ledger.

This method can only determine the status of payment transactions which do not have the partial payment flag (tfPartialPayment) set.

XpringKit returns the following transaction states:

  • succeeded: The transaction was successfully validated and applied to the XRP Ledger.
  • failed: The transaction was successfully validated but not applied to the XRP Ledger. Or the operation will never be validated.
  • pending: The transaction has not yet been validated, but may be validated in the future.
  • unknown: The transaction status could not be determined, the hash represented a non-payment type transaction, or the hash represented a transaction with the tfPartialPayment flag set.

Note: For more information, see Reliable Transaction Submission and Transaction Results.

These states are determined by the TransactionStatus enum.

import XpringKit

let remoteURL = "test.xrp.xpring.io:50051"; // Testnet URL, use main.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

let transactionHash = "9FC7D277C1C8ED9CE133CC17AEA9978E71FC644CE6F5F0C8E26F1C635D97AF4A"

let transactionStatus = xrpClient.paymentStatus(for: transactionHash) // TransactionStatus.succeeded

Note: The example transactionHash may lead to a "Transaction not found." error because the TestNet is regularly reset, or the accessed node may only maintain one month of history. Recent transaction hashes can be found in the XRP Ledger Explorer .

Retrieve specific payment

An XRPClient can retrieve a specific payment transaction by hash.

import XpringKit

let remoteURL = "alpha.test.xrp.xpring.io:50051"; // TestNet URL, use alpha.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

let transactionHash = "9FC7D277C1C8ED9CE133CC17AEA9978E71FC644CE6F5F0C8E26F1C635D97AF4A"
let payment = try! xrpClient.getPayment(for: transactionHash)

Note: The example transactionHash may lead to a "Transaction not found." error because the TestNet is regularly reset, or the accessed node may only maintain one month of history. Recent transaction hashes can be found in the XRP Ledger Explorer .

Retrieve speciic payment

An XRPClient can retrieve a specific payment transaction by hash.

import xpringkit

let remoteURL = "alpha.test.xrp.xpring.io:50051"; // TestNet URL, use alpha.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, useNewProtocolBuffers: true)

let transactionHash = "9FC7D277C1C8ED9CE133CC17AEA9978E71FC644CE6F5F0C8E26F1C635D97AF4A"
let payment = try! xrpClient.getPayment(for: transactionHash)

Note: The example transactionHash may lead to a "Transaction not found." error because the TestNet is regularly reset, or the accessed node may only maintain one month of history. Recent transaction hashes can be found in the XRP Ledger Explorer .

Payment history

An XRPClient can return payments to and from an account.

import XpringKit

let remoteURL = "alpha.test.xrp.xpring.io:50051"; // TestNet URL, use alpha.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

let address = "XVMFQQBMhdouRqhPMuawgBMN1AVFTofPAdRsXG5RkPtUPNQ"

let transactions = try! xrpClient.paymentHistory(for: address)

Sending XRP

An XRPClient can send XRP to other accounts on the XRP Ledger.

Note: The payment operation will block the calling thread until the operation reaches a definitive and irreversible success or failure state.

import XpringKit

let remoteURL = "test.xrp.xpring.io:50051"; // TestNet URL, use main.xrp.xpring.io:50051 for Mainnet
let xrpClient = XRPClient(grpcURL: remoteURL, network: XRPLNetwork.test)

// Wallet which will send XRP
let generationResult = Wallet.generateRandomWallet()!
let senderWallet = generationResult.wallet

// Destination address.
let address = "X7u4MQVhU2YxS4P9fWzQjnNuDRUkP3GM6kiVjTjcQgUU3Jr"

// Amount of XRP to send, in drops.
let amount: UInt64 = 10

let transactionHash = try! xrpClient.send(amount, to: destinationAddress, from: senderWallet)

Note: The above example will yield an "Account not found." error because the randomly generated wallet contains no XRP.

Enabling Deposit Authorization

let remoteURL = "test.xrp.xpring.io:50051" // TestNet URL, use main.xrp.xpring.io:50051 for Mainnet
let xrpClient = new XRPClient(remoteURL, XRPLNetwork.test)

// Wallet for which to enable Deposit Authorization
let seedWallet = Wallet("snRiAJGeKCkPVddbjB3zRwwoiYDBm1M")

let transactionResult: TransactionResult = xrpClient.enableDepositAuth(seedWallet)
let transactionHash: String = transactionResult.hash
let transactionStatus: TransactionStatus = transactionResult.status
let validated: Bool = transactionResult.validated

Utilities

Address validation

The Utils object provides an easy way to validate addresses.

import XpringKit

let rippleClassicAddress = "rnysDDrRXxz9z66DmCmfWpq4Z5s4TyUP3G"
let rippleXAddress = "X7jjQ4d6bz1qmjwxYUsw6gtxSyjYv5iWPqPEjGqqhn9Woti"
let bitcoinAddress = "1DiqLtKZZviDxccRpowkhVowsbLSNQWBE8"

Utils.isValid(address: rippleAddress); // returns true
Utils.isValid(address: bitcoinAddress); // returns false

You can also validate if an address is an X-Address or a classic address.

import XpringKit

let rippleClassicAddress = "rnysDDrRXxz9z66DmCmfWpq4Z5s4TyUP3G"
let rippleXAddress = "X7jjQ4d6bz1qmjwxYUsw6gtxSyjYv5iWPqPEjGqqhn9Woti"
let bitcoinAddress = "1DiqLtKZZviDxccRpowkhVowsbLSNQWBE8"

Utils.isValidXAddress(address: rippleClassicAddress); // returns false
Utils.isValidXAddress(address: rippleXAddress); // returns true
Utils.isValidXAddress(address: bitcoinAddress); // returns false

Utils.isValidClassicAddress(address: rippleClassicAddress); // returns true
Utils.isValidClassicAddress(address: rippleXAddress); // returns false
Utils.isValidClassicAddress(address: bitcoinAddress); // returns false

X-Address Encoding

You can encode and decode X-Addresses with the SDK.

import XpringKit

let rippleClassicAddress = "rnysDDrRXxz9z66DmCmfWpq4Z5s4TyUP3G"
let tag: UInt32 = 12345;

// Encode an X-Address.
let xAddress = Utils.encode(classicAddress: address, tag: tag) // X7jjQ4d6bz1qmjwxYUsw6gtxSyjYv5xRB7JM3ht8XC4P45P

// Decode an X-Address.
let classicAddressTuple = Utils.decode(xAddress: address)!
print(classicAddressTuple.classicAddress); // rnysDDrRXxz9z66DmCmfWpq4Z5s4TyUP3G
print(classicAddressTuple.tag); // 12345

Usage: PayID

Two classes are used to work with PayID: PayIDClient and XRPPayIDClient.

PayIDClient

Single Address Resolution

PayIDClient can resolve addresses on arbitrary cryptocurrency networks.

import XpringKit

// Resolve on Bitcoin Mainnet.
let network = "btc-mainnet"
let payIDClient = PayIDClient()
let payID = "georgewashington$xpring.money"

let result = payIDClient.cryptoAddress(for: payID, on: network)
switch result {
case .success(let btcAddressComponents)
  print("Resolved to \(btcAddressComponents.address)")
case .failure(let error):
  fatalError("Unknown error resolving address: \(error)")
}

#### Single Address Resolution

`PayIdClient` can retrieve all available addresses.

```swift
import XpringKit

let payID = "georgewashington$xpring.money"
let payIDClient = new PayIDClient()

let allAddresses = payIDClient.allAddresses(for: payID)
case .success(let addresses)
  print("All addresses: \(allAddresses)")
case .failure(let error):
  fatalError("Unknown error retrieving all addresses: \(error)")
}

Asynchronous APIs are also provided.

XRPPayIDClient

XRPPayIDClient can resolve addresses on the XRP Ledger network. The class always coerces returned addresses into an X-Address. (See https://xrpaddress.info/)

import XpringKit

// Use XrplNetwork.main for Mainnet.
let xrpPayIDClient = XRPPayIDClient(xrplNetwork: .main)

let payID = 'georgewashington$xpring.money'
let result = xrpPayIDClient.xrpAddress(for: payID)
switch result {
case .success(let xrpAddress):
  print("Resolved to \(xrpAddress)")
case .failure(let error):
  fatalError("Unknown error resolving address: \(error)")
}

Asynchronous APIs are also provided.

Usage: ILP

ILPClient

ILPClient is the main interface into the ILP network. ILPClient must be initialized with the URL of a Hermes instance. This can be found in your wallet.

All calls to ILPClient must pass an access token, which can be generated in your wallet.

import XpringKit

let grpcUrl = "hermes-grpc-test.xpring.dev" // TestNet Hermes URL
let ilpClient = ILPClient(grpcURL: grpcUrl)

Retrieving a Balance

An ILPClient can check the balance of an account on a connector.

import XpringKit

let grpcUrl = "hermes-grpc-test.xpring.dev" // TestNet Hermes URL
let ilpClient = ILPClient(grpcURL: grpcUrl)

let getBalance = try ilpClient.getBalance(for: "demo_user", withAuthorization: "2S1PZh3fEKnKg") // Just a demo user on Testnet
print("Net balance was \(getBalance.netBalance) with asset scale \(getBalance.assetScale)")

Sending a Payment

An ILPClient can send an ILP payment to another ILP address by supplying a Payment Pointer and a sender's account ID.

import XpringKit

let grpcUrl = "hermes-grpc-test.xpring.dev" // TestNet Hermes URL
let ilpClient = ILPClient(grpcURL: grpcUrl)

let paymentRequest = PaymentRequest(
    100,
    to: "$xpring.money/demo_receiver",
    from: "demo_user"
)
let payment = try ilpClient.sendPayment(
    paymentRequest,
    withAuthorization: "2S1PZh3fEKnKg"
)

Usage: Xpring

Xpring components compose PayID and XRP components to make complex interactions easy.

import XpringKit

let network = XRPLNetwork.test

// Build an XRPClient
let rippledUrl = "test.xrp.xpring.io:50051"
let xrpClient = XRPClient(rippledUrl, network)

// Build a PayIDClient
let payIDClient = XRPPayIDClient(network)

// XpringClient combines functionality from XRP and PayID
let xpringClient = XpringClient(payIdClient, xrpClient)

// A wallet with some balance on TestNet.
let wallet = Wallet(seed: "snYP7oArxKepd3GPDcrjMsJYiJeJB")!

// A PayID which will receive the payment.
let payId = "georgewashington$xpring.money"

// Send XRP to the given PayID.
let result = xpringClient.send(dropsToSend, to: payID, from: wallet)
switch result {
case .success(let hash):
  print("Hash for transaction:\n\(hash)\n")
case .failure:
  fatalError("Unable to send transaction.")
}

Asynchronous APIs are also provided.

xpringkit's People

Contributors

intelliot avatar keefertaylor avatar loisrp avatar mvadari avatar nkramer44 avatar stormtv avatar theotherian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xpringkit's Issues

Utils.encode - Unable to call the encode function

I keep getting the error " Value of type 'Utils' has no member 'encode' " and cannot call the "encode" function. Any help on being able to encode a classic address into an Xaddress would be awesome!
I am using the code below within a function (per the documentation):

let xAddress = Utils.encode(classicAddress: address, tag: tag)

Error Cloning SDK

I got the following error when cloning and trying to run the clone?

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'XpringKit_iOS' from project 'XpringKit')
    cd /Users/denisangell/projects/tabs/mobile/XpringKit
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name XpringKit -Onone -enable-batch-mode -enforce-exclusivity=checked @/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/Objects-normal/x86_64/XpringKit.SwiftFileList -DDEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -target x86_64-apple-ios13.2-simulator -g -module-cache-path /Users/denisangell/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -profile-coverage-mapping -profile-generate -enable-testing -index-store-path /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Index/DataStore -swift-version 5 -I /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Products/Debug-iphonesimulator -F /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Products/Debug-iphonesimulator -F /Users/denisangell/projects/tabs/mobile/XpringKit/Carthage/Build/iOS -c -j4 -output-file-map /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/Objects-normal/x86_64/XpringKit_iOS-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/Objects-normal/x86_64/XpringKit.swiftmodule -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/XpringKit-generated-files.hmap -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/XpringKit-own-target-headers.hmap -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/XpringKit-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/XpringKit-project-headers.hmap -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/DerivedSources-normal/x86_64 -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/DerivedSources/x86_64 -Xcc -I/Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/denisangell/Library/Developer/Xcode/DerivedData/XpringKit-dlemcvtgcliwlsdkmabtfvxshnfn/Build/Intermediates.noindex/XpringKit.build/Debug-iphonesimulator/XpringKit_iOS.build/Objects-normal/x86_64/XpringKit-Swift.h -working-directory /Users/denisangell/projects/tabs/mobile/XpringKit

error: Build input files cannot be found: '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/get_account_info_request.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/fiat_amount.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/account_info.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/submit_signed_transaction_request.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/payment.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/ledger_sequence.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/get_transaction_status_request.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/fee.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/signed_transaction.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/xrp_ledger.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/submit_signed_transaction_response.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/transaction_status.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/get_latest_validated_ledger_sequence_request.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/get_fee_request.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/transaction.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/xrp_amount.pb.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/xrp_ledger.grpc.swift', '/Users/denisangell/projects/tabs/mobile/XpringKit/XpringKit/generated/currency.pb.swift' (in target 'XpringKit_iOS' from project 'XpringKit')

CocoaPods could not find compatible versions for pod "gRPC-Core":

I'm working on my fork and I use swift 5 with Google Firestore Dependencies. I'm now running into the issue using pod install with the following errors:

[!] CocoaPods could not find compatible versions for pod "gRPC-Core":
  In snapshot (Podfile.lock):
    gRPC-Core (= 1.21.0)

  In Podfile:
    Firebase/Firestore was resolved to 6.14.0, which depends on
      FirebaseFirestore (~> 1.8.2) was resolved to 1.8.3, which depends on
        gRPC-C++ (= 0.0.9) was resolved to 0.0.9, which depends on
          gRPC-C++/Implementation (= 0.0.9) was resolved to 0.0.9, which depends on
            gRPC-Core (= 1.21.0)

    XpringKit (from `/Users/denisangell/projects/xrp/xpringKit/XpringKit.podspec`) was resolved to 1.2.1, which depends on
      SwiftGRPC was resolved to 0.4.3, which depends on
        gRPC-Core (~> 1.11.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `gRPC-Core` inside your development pod `XpringKit`.
   You should run `pod update gRPC-Core` to apply changes you've made.

I believe this is a dependency issue... So I went https://github.com/grpc/grpc-swift and found a depreciation issue?

‼️ Please use the nio branch ‼️
gRPC Swift versions v0.x based on gRPC-Core will soon be replaced with a re-implementation based on SwiftNIO.

We strongly suggest that new projects use the re-implementation from the nio branch which we consider to be production ready.

Please see DEPRECATION.md for more information.

My goal is to get all of this up to swift 5.

Happy Hollidays!!

Failing to install XpringKit with Cocoapods

I'm a bit lost as to why this is failing as nothing is obvious to me as to what is the issue. Any help appreciated.

Thanks. Logs below after I run pod update

Mac:XRPL donie$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing BigInt (5.0.0)
Installing BoringSSL-GRPC (0.0.3)
Installing SwiftGRPC (0.10.0)
Installing SwiftProtobuf (1.7.0)
Installing XpringKit (1.2.0)
Enter passphrase for key '/Users/donie/.ssh/id_rsa': 
Enter passphrase for key '/Users/donie/.ssh/id_rsa': 

[!] /bin/bash -c 
set -e
git submodule update --init --recursive && ./scripts/bundle_js.sh && ./scripts/regenerate_protos.sh

Submodule path 'xpring-common-js': checked out '4ce627e8ed33f44e9870fd84695a7d7c18f80884'
Submodule path 'xpring-common-js/xpring-common-protocol-buffers': checked out '3603db829677c41a7789746b858feb19a6e77845'
Submodule path 'xpring-common-protocol-buffers': checked out '41d8d7c316d11b79ab495110da24b9fb0f2c691b'
Bundling JS
>> Installing Node Dependencies

> [email protected] install /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/fsevents
> node install

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/fsevents/lib/binding/Release/node-v79-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

> [email protected] install /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/tiny-secp256k1
> npm run build || echo "secp256k1 bindings compilation fail. Pure JS implementation will be used."


> [email protected] build /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/tiny-secp256k1
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/native/addon.o
secp256k1 bindings compilation fail. Pure JS implementation will be used.

> [email protected] install /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node" is installed via remote

> [email protected] postinstall /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/ripple-binary-codec/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 962 packages from 1268 contributors and audited 7903 packages in 27.513s

1 package is looking for funding
  run `npm fund` for details

found 12 vulnerabilities (3 moderate, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details
>> Done Installing Node Dependencies
>> Running Webpack.

> [email protected] webpack /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js
> npm run clean && ./scripts/regenerate_protos.sh && tsc && npx webpack


> [email protected] clean /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js
> rm -rf ./generated ./dist ./build

Regenerating Protocol Buffers
Submodule 'xpring-common-js' ([email protected]:xpring-eng/xpring-common-js) registered for path 'xpring-common-js'
Submodule 'xpring-common-protocol-buffers' ([email protected]:xpring-eng/xpring-common-protocol-buffers) registered for path 'xpring-common-protocol-buffers'
Cloning into '/Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js'...
Cloning into '/Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-protocol-buffers'...
Submodule 'xpring-common-protocol-buffers' (http://github.com/xpring-eng/xpring-common-protocol-buffers) registered for path 'xpring-common-js/xpring-common-protocol-buffers'
Cloning into '/Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/xpring-common-protocol-buffers'...
warning: redirecting to https://github.com/xpring-eng/xpring-common-protocol-buffers/
node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.9/fse-v1.2.9-node-v79-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v79 ABI, unknown) (falling back to source compile with node-gyp) 
../native/addon.cpp:240:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
        secp256k1_ec_privkey_negate(context, tweak_negated); // returns 1 always
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:320:34: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                strict = info[3]->BooleanValue(Nan::GetCurrentContext()).FromJust();
                                               ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/donie/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:142:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<2, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested here
        const auto flags = assumeCompression<2>(info, pA);
                           ^
/Users/donie/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:174:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested here
        const auto flags = assumeCompression<1>(info, p);
                           ^
/Users/donie/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:89:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:189:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value> >' requested here
        const auto flags = assumeCompression<1>(info);
                           ^
/Users/donie/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:87:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return SECP256K1_EC_COMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
4 warnings and 4 errors generated.
make: *** [Release/obj.target/secp256k1/native/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:219:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/13.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/donie/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.2.0-83e16/xpring-common-js/node_modules/tiny-secp256k1
gyp ERR! node -v v13.3.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/donie/.npm/_logs/2019-12-12T21_18_00_480Z-debug.log
node-pre-gyp WARN Using needle for node-pre-gyp https download 
./scripts/regenerate_protos.sh: line 16: grpc_tools_node_protoc: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] webpack: `npm run clean && ./scripts/regenerate_protos.sh && tsc && npx webpack`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/donie/.npm/_logs/2019-12-12T21_18_14_506Z-debug.log


[!] Automatically assigning platform `iOS` with version `13.2` on target `XRPL` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Mac:XRPL donie$ 

Error Installing Cocoa Pods

Error installing cocoa pods on swift 5

[!] /bin/bash -c 
set -e
git submodule update --init --recursive && ./scripts/bundle_js.sh && ./scripts/regenerate_protos.sh

Submodule 'xpring-common-js' ([email protected]:xpring-eng/xpring-common-js) registered for path 'xpring-common-js'
Submodule 'xpring-common-protocol-buffers' ([email protected]:xpring-eng/xpring-common-protocol-buffers) registered for path 'xpring-common-protocol-buffers'
Cloning into '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:xpring-eng/xpring-common-js' into submodule path '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js' failed
Failed to clone 'xpring-common-js'. Retry scheduled
Cloning into '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-protocol-buffers'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:xpring-eng/xpring-common-protocol-buffers' into submodule path '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-protocol-buffers' failed
Failed to clone 'xpring-common-protocol-buffers'. Retry scheduled
Cloning into '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:xpring-eng/xpring-common-js' into submodule path '/Users/denisangell/Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js' failed
Failed to clone 'xpring-common-js' a second time, aborting

Web Socket for account balance?

I'm not familiar with your repo or grpc but I wanted to know how to call the subscribe command on the web socket? I want to call it for both account and transactions. Similar to how ethereum does it..

Is this implemented in your library? If not, how am I supposed to update the balance when a balance is updated on the chain? Just call the function again? Seems like alot of work went into the proto's and grpc but the functionality that developers need to execute a proper application on the blockchain is missing? Or am I missing something?

PayID & ILP

Hey guys,

I wanted to get some additional. Are payment pointers and PayID the same? Can payID be used for ILP or is the PayID, just a record of the users accounts?

Also, for something like a ethereum smart contract, how would I use the ILP to interact with this smart contract? Also, on the ILP it looks like there is a way to "handshake" much similar to that of a payment channel. Is the "Payment Channel" possible to be used by the ILP?

Thank You!!

Greetings!

Hello engineering team working on the Xpring suite of mobile SDKs,

My name is Alex Smith and I'm interested in working with your SDKs on a current project of mine. I've been following the progress being made here in the XpringKit SDK for iOS since that's ecosystem I'm most familiar working in.

I come from a background of working with financial institutions with my previous company Flybits in which I was an employee. My days were spent managing a suite of 7 SDKs not too dissimilar from what you have with your own. Distribution was a pain since ABI stability hadn't really been introduced yet (as you probably know, customers at financial institutions are slow moving and must allot proper funding to make any updates). So, the latest version of Swift we could support was Swift 4.2 but we supported multiple versions of Swift simultaneously for our suite of SDKs.

In short, Flybits' SDKs provide a mechanism for personalizing user experiences using contextual elements from the array of sensors in the device and creating rules to determine what content a user should be presented with.

That's some background of the kind of work that I've done recently. On the side, I'm playing around with some NLP and the new things introduced at WWDC this year, mostly to do with SwiftUI.

In the near future, I plan to share what it is that I'm building but in the meantime I'm interested in seeing this project succeed both internally to the company and externally in terms of adoption with developers like me!

I've read your guide on contributing but I realized that I'm unable to create PRs since I'm not a white-listed team member/contributor.

How might I become a contributor to this project? Also, if I have questions more broadly speaking about the SDKs and their direction, what might you suggest as the appropriate avenue? Create an Issue here like I am now, post something to the Xpring forums, email, or something else?

By the way, you may have seen me making comments on some PRs already; however, until now I hadn't introduced myself.

Thanks for your time learning about me and your consideration to add me as a contributor!

Dependency Issue Firebase & XpringKit

I'm getting the following error when I try to install XpringKit after upgrading the firebase pod

[!] CocoaPods could not find compatible versions for pod "BigInt":
  In snapshot (Podfile.lock):
    BigInt (= 4.0.0, ~> 4.0)

  In Podfile:
    XpringKit was resolved to 5.1.1, which depends on
      BigInt (~> 5.0.0)

    web3.swift.pod was resolved to 2.2.1, which depends on
      BigInt (~> 4.0)

CocoaPods could not find compatible versions for pod "gRPC-Core":
  In snapshot (Podfile.lock):
    gRPC-Core (= 1.28.2)

  In Podfile:
    Firebase/Firestore was resolved to 6.33.0, which depends on
      FirebaseFirestore (~> 1.18.0) was resolved to 1.18.0, which depends on
        gRPC-C++ (~> 1.28.0) was resolved to 1.28.2, which depends on
          gRPC-C++/Implementation (= 1.28.2) was resolved to 1.28.2, which depends on
            gRPC-Core (= 1.28.2)

    XpringKit was resolved to 2.0.0, which depends on
      SwiftGRPC was resolved to 0.4.3, which depends on
        gRPC-Core (~> 1.11.0)

Any help would be appreciated...

XRPClient "Send" functionality clarification

Sorry to bother but I had a question concerning the XRPClient.send function. I am a little confused on the "From" parameter because it is asking for a "Wallet" and not an Address. The only way to create a wallet variable is by using Wallet(seed: "seedID"). How would I create a "wallet" variable if I have the senders wallet address as a string? Do i need to get a seed value from the senders address? Not sure if I am missing something... sorry, still somewhat new to this..

This is an error I am getting:
"Cannot convert value of type 'Address?' (aka 'Optional') to expected argument type 'Wallet' "

How do I run the GRPC Server?

This sdk is confusing to say the least...

As a developer I would expect the same access to the ledger that is given over the api through web sockets or rpc. I'm under the impression this is not the case with grpc and I need to run my own adaptor over my local server to interact. Is that correct?

grpc-swift is no longer maintained

The library for SwiftGRPC is no longer maintained and they use a completely different library. I was having trouble integrating XpringKit into google products.

I had to Podfile install SwiftGRPC with a gRPC-Core version of 1.28.0 to get my pods to install correctly.

I was wondering if you are going to upgrade XpringKit to the new NIO protocol and the new grpc-Swift library?

pod XpringKit

Please make sure you have the correct access rights and the repository exists.

Get Transaction Data??

Is there any way to get the transaction data from the send call? It's recommended by ripple that the transaction data be persisted in the database.

Change sendPayment parameter in IlpClient

This is a small nit, but the IlpClient.sendPayment API takes a String as its second parameter for paymentPointer. Although at the call site this label will be to: , we should align the parameter name with Xpring4j and set it to destinationPaymentPointer.

API should be:

sendPayment(
        _ amount: UInt64,
        to destinationPaymentPointer: String,
        from senderAccountID: String,
        withAuthorization bearerToken: String
) throws -> Org_Interledger_Stream_Proto_SendPaymentResponse

Send Escrow Transaction?

Just overviewing the sdk, I wasn't sure how to create an escrow transaction? Can I also use smart contracts with this sdk

Failed to install pod

Hello!
First, there was a problem with the submodules. I had to add ssh keys to make cocoapods clone submodules. Now, I can't install pod due to compilation issues. Maybe you can add the precompiled binaries to facilitate pod installation? A lot of time needs to be spent just to install the pod. In the future, we will have many problems with our CI-machine. Thank you

Analyzing dependencies
Downloading dependencies
Installing BoringSSL-GRPC (0.0.3)
Installing SwiftGRPC (0.10.0)
Installing XpringKit (1.1.3)
[!] /bin/bash -c 
set -e
git submodule update --init --recursive && ./scripts/bundle_js.sh && ./scripts/regenerate_protos.sh

Submodule path 'xpring-common-js': checked out '344737a1652c55120c2b1659315d8c760171f111'
Submodule path 'xpring-common-js/xpring-common-protocol-buffers': checked out '6f983e508bee6d358156776561e884719275d9f0'
Submodule path 'xpring-common-protocol-buffers': checked out '5a345fd40b468f824d6ad1bdb88e8db3f41354b4'
Bundling JS
>> Installing Node Dependencies

> [email protected] install /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/fsevents
> node install

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/fsevents/lib/binding/Release/node-v79-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

> [email protected] install /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/tiny-secp256k1
> npm run build || echo "secp256k1 bindings compilation fail. Pure JS implementation will be used."


> [email protected] build /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/tiny-secp256k1
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/native/addon.o
secp256k1 bindings compilation fail. Pure JS implementation will be used.

> [email protected] install /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node" is installed via remote

> [email protected] postinstall /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/ripple-binary-codec/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 961 packages from 1267 contributors and audited 7904 packages in 19.674s
found 13 vulnerabilities (4 moderate, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details
>> Done Installing Node Dependencies
>> Running Webpack.

> [email protected] webpack /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js
> npm run clean && ./scripts/regenerate_protos.sh && tsc && npx webpack


> [email protected] clean /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js
> rm -rf ./generated ./dist ./build

Regenerating Protocol Buffers
Submodule 'xpring-common-js' ([email protected]:xpring-eng/xpring-common-js) registered for path 'xpring-common-js'
Submodule 'xpring-common-protocol-buffers' ([email protected]:xpring-eng/xpring-common-protocol-buffers) registered for path 'xpring-common-protocol-buffers'
Cloning into '/Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js'...
Cloning into '/Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-protocol-buffers'...
Submodule 'xpring-common-protocol-buffers' (http://github.com/xpring-eng/xpring-common-protocol-buffers) registered for path 'xpring-common-js/xpring-common-protocol-buffers'
Cloning into '/Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/xpring-common-protocol-buffers'...
warning: redirecting to https://github.com/xpring-eng/xpring-common-protocol-buffers/
node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.9/fse-v1.2.9-node-v79-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v79 ABI, unknown) (falling back to source compile with node-gyp) 
../native/addon.cpp:240:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
        secp256k1_ec_privkey_negate(context, tweak_negated); // returns 1 always
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:320:34: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                strict = info[3]->BooleanValue(Nan::GetCurrentContext()).FromJust();
                                               ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/.../Library/Caches/node-gyp/13.8.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:142:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<2, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested here
        const auto flags = assumeCompression<2>(info, pA);
                           ^
/Users/.../Library/Caches/node-gyp/13.8.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:174:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested here
        const auto flags = assumeCompression<1>(info, p);
                           ^
/Users/.../Library/Caches/node-gyp/13.8.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:89:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:189:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value> >' requested here
        const auto flags = assumeCompression<1>(info);
                           ^
/Users/.../Library/Caches/node-gyp/13.8.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:87:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return SECP256K1_EC_COMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
4 warnings and 4 errors generated.
make: *** [Release/obj.target/secp256k1/native/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/.../Library/Caches/CocoaPods/Pods/Release/XpringKit/1.1.3-42df3/xpring-common-js/node_modules/tiny-secp256k1
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.../.npm/_logs/2020-02-10T20_05_52_869Z-debug.log
node-pre-gyp WARN Using needle for node-pre-gyp https download 
./scripts/regenerate_protos.sh: line 16: grpc_tools_node_protoc: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] webpack: `npm run clean && ./scripts/regenerate_protos.sh && tsc && npx webpack`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.../.npm/_logs/2020-02-10T20_05_55_617Z-debug.log

Better Error Handling

If you call getBalance on a new address is returns

The operation couldn’t be completed. (XSwiftGRPC.RPCError error 0.)

If you review the error the status message is:

Account not found

This made me go crazy. Apparently it's the error you receive when the balance is 0.

I'm just putting this here so someone else searches for it.

Prepend "Bearer " to auth token

This won't change anything functionally, but in order to abide by correct standards, the ILP SDK should add Bearer to the beginning of all auth tokens, if they do not already have them.

Similarly, we should wrap bearerToken in a class called IlpCallCredentials, which will do this for us and make the bearer token more strongly typed.

Same as xpring-eng/Xpring-JS#228

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.