diff --git a/CHANGELOG.md b/CHANGELOG.md index 06da88b..8af78df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# v0.1.1 + +Fix payment related bugs. + # v0.1.0 First draft of the SDK. diff --git a/README.md b/README.md index 74a20ab..f98c7b7 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/requester/requester.go b/requester/requester.go index 935eb27..fe10a48 100644 --- a/requester/requester.go +++ b/requester/requester.go @@ -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{}{ diff --git a/services/lightspark_client.go b/services/lightspark_client.go index 20b6af0..22aa00e 100644 --- a/services/lightspark_client.go +++ b/services/lightspark_client.go @@ -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) diff --git a/version.go b/version.go index 74014c9..168601d 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package lightspark -const VERSION = "1.0.0" \ No newline at end of file +const VERSION = "0.1.1"