Skip to content

Commit

Permalink
V0.0.9 (#98)
Browse files Browse the repository at this point in the history
### What changed? Why?

* External Address Support
* Enumerator support for paginated APIs
* Staking and Reward support for external addresses
* Listing and fetching wallet helpers

PRs:
#86
#93
#95
#89
#78
#91
#96
#97
#99
#100


#### Qualified Impact
<!-- Please evaluate what components could be affected and what the
impact would be if there was an
error. How would this error be resolved, e.g. rollback a deploy, push a
new fix, disable a feature
flag, etc... -->

---------

Co-authored-by: Dean Galvin <[email protected]>
Co-authored-by: deangalvin-cb <[email protected]>
  • Loading branch information
3 people authored Jun 26, 2024
1 parent 1dd6a59 commit a806864
Show file tree
Hide file tree
Showing 162 changed files with 29,715 additions and 7,013 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.0.9] - 2024-06-26

### Added

- Support external addresses for balance fetching and requesting faucet funds.
- Support for building staking operations and transactions
- Support for retrieving staking rewards information
- Add support for listing address trades via `address.trades`

### Changed

- Migrate to enumerator pattern for listing address transfers via `address.transfers`

## [0.0.8] - 2024-06-18

### Added
Expand Down
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ puts "Faucet transaction successfully completed: #{faucet_tx}"

## Transferring Funds

See [Transfers](https://docs.cdp.coinbase.com/wallets/docs/transfers) for more information.

Now that your faucet transaction has successfully completed, you can send the funds in your wallet to another wallet.
The code below creates another wallet, and uses the `transfer` function to send testnet ETH from the first wallet to
the second:
Expand All @@ -210,10 +212,25 @@ t = w1.transfer(0.00001, :eth, w2).wait!
puts "Transfer successfully completed: #{t}"
```

See [Transfers](https://docs.cdp.coinbase.com/wallets/docs/transfers) for more information.
## Listing Transfers

```
# Get the first transfer from the address.
address.transfers.first
# Iterate over all transfers in the address. This will lazily fetch transfers from the server.
address.transfers.each do |transfer|
puts transfer
end
# Return array of all transfers. This will paginate and fetch all transfers for the address.
address.transfers.to_a
```

## Trading Funds

See [Trades](https://docs.cdp.coinbase.com/wallets/docs/trades) for more information.

```ruby

wallet = Coinbase::Wallet.create(network_id: "base-mainnet")
Expand All @@ -226,7 +243,20 @@ trade = wallet.trade(0.00001, :eth, :usdc).wait!
puts "Trade successfully completed: #{trade}"
```

See [Trades](https://docs.cdp.coinbase.com/wallets/docs/trades) for more information.
## Listing Trades

```
# Get the first trade from the address.
address.trades.first
# Iterate over all trades in the address. This will lazily fetch trades from the server.
address.trades.each do |trade|
puts trade
end
# Return array of all trades. This will paginate and fetch all trades for the address.
address.trades.to_a
```

## Persisting a Wallet

Expand Down Expand Up @@ -286,6 +316,15 @@ w4 = u.wallet(w1.id)
w4.load_seed(file_path)
```

## External Addresses

Addresses that do not belong CDP wallets can still be interacted with via the Platform SDK.

You can fetch balances, request faucet funds, and eventually construct unsigned transactions that
can be signed by the owner of the address (e.g. your user's self-custodied wallet).

See [External Addresses docs](./docs/external-addresses.md) for more information.

## Development

### Ruby Version
Expand Down
3 changes: 1 addition & 2 deletions coinbase.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = 'coinbase-sdk'
spec.version = '0.0.8'
spec.version = '0.0.9'
spec.authors = ['Yuga Cohler']
spec.files = Dir['lib/**/*.rb']
spec.summary = 'Coinbase Ruby SDK'
Expand All @@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'eth'
spec.add_runtime_dependency 'faraday'
spec.add_runtime_dependency 'faraday-multipart'
spec.add_runtime_dependency 'jimson'
spec.add_runtime_dependency 'jwt'
spec.add_runtime_dependency 'marcel'
spec.add_runtime_dependency 'money-tree'
Expand Down
315 changes: 174 additions & 141 deletions docs/Coinbase.html

Large diffs are not rendered by default.

293 changes: 124 additions & 169 deletions docs/Coinbase/APIError.html

Large diffs are not rendered by default.

Loading

0 comments on commit a806864

Please sign in to comment.