Skip to content

Commit

Permalink
first commit for transfers; hourly recalc of JWT token
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudmode committed Apr 24, 2020
1 parent 8a79cea commit 0e12798
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions primetrust.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"time"

"github.com/fatih/color"
)
Expand Down Expand Up @@ -72,4 +73,15 @@ func Init(sandbox bool, login string, password string) {
color.Blue("%s", _authHeader)
_jwt = getJWT()
color.Blue("%s", _jwt)

// periodically update JWT
go func() {
jwtTicker := time.NewTicker(1 * time.Hour)
for {
select {
case <-jwtTicker.C:
_jwt = getJWT()
}
}
}()
}
5 changes: 5 additions & 0 deletions transfers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package primetrust

func AccountCashTransfer(from, to, amount string) error {
return nil
}

0 comments on commit 0e12798

Please sign in to comment.