Skip to content

Commit

Permalink
add balance section on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
devton committed Jun 27, 2024
1 parent a4e6f24 commit b63da05
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
# Blnk
# This gem is under development, don't use in production

TODO: Delete this and the text below, and describe your gem
# Blnk

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/blnk`. To experiment with that code, run `bin/console` for an interactive prompt.
Easy way to use the blnkfinance.com API in ruby

## Installation

TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.

Install the gem and add to the application's Gemfile by executing:

$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
$ bundle add blnk

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
$ gem install blnk

## Usage

TODO:
- [x] Create Ledger
- [x] Find Ledger
- [ ] Create Balances
- [ ] Find Balances
- [ ] Create Transactions
- [ ] Find Transactions
- [ ] Do Search
- [x] List Ledgers
- [ ] Search Ledgers
- [x] Create Balances
- [x] Find Balance
- [ ] Search Balances
- [ ] Create Transaction
- [ ] Find Transaction
- [ ] Search Transactions

## Client connection
## Usage

```
```ruby
require 'blnk'

# client config

Blnk.address = '192.168.2.7:5001'
Blnk.secret_token = 'your_strong_secret_key'
Blnk.search_api_key = Blnk.secret_token
```

# ledgers integration

## Ledger usage

```
ledger = Blnk::Ledger.new(name: 'foo bar').save
ledger = Blnk::Ledger.create(name: 'foobar')
ledger = Blnk::Ledger.find 'ledger_id'
ledgers = Blnk::Ledger.all

# search not implemented yet
ledgers = Blnk::Ledger.search(
q: 'USD',
filter_by: 'balances > 1400',
sort_by: 'created_at:desc',
page: 1,
per_page: 50
)
```

## Creating a transaction

```
```
# Balance integrations
balance = Blnk::Balance.find 'balance_id'
balance = Blnk::Balance.create(ledger_id: 'ledger_id', currency: 'USD')

```


## Development
Expand All @@ -71,7 +70,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/blnk.
Bug reports and pull requests are welcome on GitHub at https://github.com/devton/blnk-ruby

## License

Expand Down

0 comments on commit b63da05

Please sign in to comment.