Skip to content

Commit

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

# v0.1.4
Use CSPRNG to generate nonce.

# v0.1.3
Add two functions for test mode.
- CreateTestModeInvoice for creating an test invoice.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Lightspark Go SDK - v0.1.3
# Lightspark Go SDK - v0.1.4

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

***WARNING: This SDK is in version 0.1.3 (active development). It means that its APIs may not be fully stable. Please expect that changes to the APIs may happen until we move to v1.0.0.***
***WARNING: This SDK is in version 0.1.4 (active development). It means that its APIs may not be fully stable. Please expect that changes to the APIs may happen until we move to v1.0.0.***

## Documentation

Expand Down
10 changes: 7 additions & 3 deletions requester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package requester

import (
"bytes"
"crypto/rand"
"encoding/json"
"errors"
"io/ioutil"
"math/rand"
"math/big"
"net/http"
"regexp"
"runtime"
Expand Down Expand Up @@ -39,8 +40,11 @@ func (r *Requester) ExecuteGraphql(query string, variables map[string]interface{

var nonce uint32
if signingKey != nil {
rand.Seed(time.Now().UnixNano())
nonce = rand.Uint32()
randomBigInt, err := rand.Int(rand.Reader, big.NewInt(0xFFFFFFFF))
if err != nil {
return nil, err
}
nonce = uint32(randomBigInt.Uint64())
}

var expiresAt string
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 = "0.1.3"
const VERSION = "0.1.4"

0 comments on commit da27488

Please sign in to comment.