Update README.md

This commit is contained in:
bumi 2019-02-12 06:21:55 +00:00 committed by GitHub
parent 80e3fae21d
commit b5d900492f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -97,9 +97,9 @@ lnd.grpc_client
The client wrapper passes any supported RPC method call to the gRPC client applying the following conventions:
If the first parameter is a hash or blank a new request instance of `Lnrpc::[capitalized method name]Request` will be used as request paramter.
If the first parameter is a hash or blank the corresponding gRPC request object will be instantiated
If the second paramter is blank the macaroon will be passed as metadata. (`{ metadata: { macaroon: self.macaroon } }`)
If the second paramter is blank the macaroon will be passed as metadata: `{ metadata: { macaroon: self.macaroon } }`
Example:
@ -110,8 +110,13 @@ client.grpc_client.get_info(Lnrpc::GetInfoRequest.new, { metadata: { macaroon: m
client.list_channels(inactive_only: true)
# is the same as:
request = Lnrpc::ListChannelsRequest(inactive_only: true)
client.grpc_client.list_channesl(request, { metadata: { macaroon: macaroon } })
request = Lnrpc::ListChannelsRequest.new(inactive_only: true)
client.grpc_client.list_channels(request, { metadata: { macaroon: macaroon } })
client.wallet_balance.total_balance
# is the same as:
request = Lnrpc::WalletBalanceRequest.new()
client.grpc_client.wallet_balance(request, { metadata: { macaroon: macaroon } }).total_balance
```