Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: a3b28e0c87f59d646a0a24cc6c214d1c5e70acd0
  • Loading branch information
Lightspark Eng authored and zhenlu committed May 16, 2023
1 parent c466b32 commit 9fee6e9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# v0.1.1

Fix payment related bugs.

# v0.1.0

First draft of the SDK.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lightspark Go SDK - v0.1.0
# Lightspark Go SDK - v0.1.1

The Lightspark Go SDK provides a convenient way to interact with the Lightspark services from applications written in the Go.

Expand Down
3 changes: 2 additions & 1 deletion requester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ func (r *Requester) ExecuteGraphql(query string, variables map[string]interface{

var nonce uint32
if signingKey != nil {
rand.Seed(time.Now().UnixNano())
nonce = rand.Uint32()
}

var expiresAt string
if signingKey != nil {
expiresAt = time.Now().UTC().Add(time.Hour).Format("UnixDate")
expiresAt = time.Now().UTC().Add(time.Hour).Format(time.RFC3339)
}

payload := map[string]interface{}{
Expand Down
5 changes: 4 additions & 1 deletion services/lightspark_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ func (client *LightsparkClient) PayInvoice(nodeId string, encodedInvoice string,
"encoded_invoice": encodedInvoice,
"timeout_secs": timeoutSecs,
"maximum_fees_msats": maximumFeesMsats,
"amount_msats": amountMsats,
}

if amountMsats != nil {
variables["amount_msats"] = amountMsats
}

signingKey, err := client.getNodeSigningKey(nodeId)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package lightspark

const VERSION = "1.0.0"
const VERSION = "0.1.1"

0 comments on commit 9fee6e9

Please sign in to comment.