generated from mrz1836/go-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d77c56
commit 2580745
Showing
17 changed files
with
201 additions
and
127 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
version: '3' | ||
|
||
tasks: | ||
admin_add_user: | ||
desc: "running admin_add_user..." | ||
cmds: | ||
- echo "running admin_add_user..." | ||
- go run ./admin_add_user/admin_add_user.go | ||
|
||
admin_remove_user: | ||
desc: "running admin_remove_user..." | ||
cmds: | ||
- echo "running admin_remove_user..." | ||
- go run ./admin_remove_user/admin_remove_user.go | ||
|
||
create_transaction: | ||
desc: "running create_transaction..." | ||
cmds: | ||
- echo "running create_transaction..." | ||
- go run ./create_transaction/create_transaction.go | ||
|
||
generate_keys: | ||
desc: "running generate_keys..." | ||
cmds: | ||
- echo "running generate_keys..." | ||
- go run ./generate_keys/generate_keys.go | ||
|
||
get_balance: | ||
desc: "running get_balance..." | ||
cmds: | ||
- echo "running get_balance..." | ||
- go run ./get_balance/get_balance.go | ||
|
||
handle_exceptions: | ||
desc: "running handle_exceptions..." | ||
cmds: | ||
- echo "running handle_exceptions..." | ||
- go run ./handle_exceptions/handle_exceptions.go | ||
|
||
list_transactions: | ||
desc: "running list_transactions..." | ||
cmds: | ||
- echo "running list_transactions..." | ||
- go run ./list_transactions/list_transactions.go | ||
|
||
send_op_return: | ||
desc: "running send_op_return..." | ||
cmds: | ||
- echo "running send_op_return..." | ||
- go run ./send_op_return/send_op_return.go | ||
|
||
xpriv_from_mnemonic: | ||
desc: "running xpriv_from_mnemonic..." | ||
cmds: | ||
- echo "running xpriv_from_mnemonic..." | ||
- go run ./xpriv_from_mnemonic/xpriv_from_mnemonic.go | ||
|
||
xpub_from_xpriv: | ||
desc: "running xpub_from_xpriv..." | ||
cmds: | ||
- echo "running xpub_from_xpriv..." | ||
- go run ./xpub_from_xpriv/xpub_from_xpriv.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
/* | ||
Package main - admin_remove_user example | ||
*/ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"examples" | ||
"fmt" | ||
"os" | ||
|
||
"examples" | ||
walletclient "github.com/bitcoin-sv/spv-wallet-go-client" | ||
) | ||
|
||
func main() { | ||
defer examples.HandlePanic() | ||
|
||
const server = "http://localhost:3003/v1" | ||
examples.CheckIfAdminKeyExists() | ||
|
||
if examples.ExampleAdminKey == "" { | ||
fmt.Println(examples.ErrMessage("adminKey")) | ||
os.Exit(1) | ||
} | ||
const server = "http://localhost:3003/v1" | ||
|
||
adminClient := walletclient.NewWithAdminKey(server, examples.ExampleAdminKey) | ||
ctx := context.Background() | ||
|
||
adminClient.AdminDeletePaymail(ctx, examples.ExamplePaymail) | ||
err := adminClient.AdminDeletePaymail(ctx, examples.ExamplePaymail) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
/* | ||
Package examples - key constants to be used in the examples and utility function for generating keys | ||
*/ | ||
package examples | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/bitcoin-sv/spv-wallet-go-client/xpriv" | ||
) | ||
|
||
const ( | ||
// ExampleAdminKey - example admin key | ||
ExampleAdminKey string = "xprv9s21ZrQH143K3CbJXirfrtpLvhT3Vgusdo8coBritQ3rcS7Jy7sxWhatuxG5h2y1Cqj8FKmPp69536gmjYRpfga2MJdsGyBsnB12E19CESK" | ||
|
||
// you can generate new keys using `yarn generate-keys` | ||
// you can generate new keys using `task generate-keys` | ||
|
||
// ExampleXPriv - example private key | ||
ExampleXPriv string = "" | ||
ExampleXPub string = "" | ||
// ExampleXPub - example public key | ||
ExampleXPub string = "" | ||
|
||
// ExamplePaymail - example Paymail address | ||
ExamplePaymail string = "" | ||
) | ||
|
||
/* | ||
GenerateKeys - function for generating keys (private and public) | ||
*/ | ||
func GenerateKeys() xpriv.KeyWithMnemonic { | ||
keys, err := xpriv.Generate() | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
return keys | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
/* | ||
Package main - generate_keys example | ||
*/ | ||
package main | ||
|
||
import ( | ||
"examples" | ||
"fmt" | ||
|
||
"examples" | ||
) | ||
|
||
func main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.