Documentation ¶
Index ¶
- func AddJWT(requestPayload interface{}, privKey *btcec.PrivateKey) (_jwtPayload interface{}, _err error)
- func BurnNFT(burnerPubKey *btcec.PublicKey, burnerPrivKey *btcec.PrivateKey, ...) error
- func BuyCreator(buyerPubKey *btcec.PublicKey, buyerPrivKey *btcec.PrivateKey, ...) error
- func GenerateJWTToken(privKey *btcec.PrivateKey) (_JWT string, _err error)
- func GenerateMnemonicPublicPrivate(params *lib.DeSoParams) (mnemonic string, pubKey *btcec.PublicKey, privKey *btcec.PrivateKey)
- func GetBestChainFromBadger(syncedDBHandle *badger.DB) ([]*lib.BlockNode, error)
- func OpenDataDir(dataDir string) (*badger.DB, error)
- func SendDeSo(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, ...) error
- func SendDiamonds(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, ...) error
- func SendMessage(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, ...) error
- func SubmitTransactionToNode(txn *lib.MsgDeSoTxn, node string) error
- func TransferDAOCoin(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, ...) error
- func UpdateBitcoinUSDExchangeRate(updaterPubKey *btcec.PublicKey, updaterPrivKey *btcec.PrivateKey, ...) error
- func UpdateNFT(updaterPubKey *btcec.PublicKey, updaterPrivKey *btcec.PrivateKey, ...) error
- func UpdateProfile(updaterPubKey *btcec.PublicKey, updaterPrivKey *btcec.PrivateKey, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJWT ¶
func AddJWT(requestPayload interface{}, privKey *btcec.PrivateKey) (_jwtPayload interface{}, _err error)
Add a JWT token to the specified request payload interface using a provided private key.
Here's an example on how this can be used to execute a request as an admin: payload := routes.AdminUpdateUserGlobalMetadataRequest{ ... } mPayload, _ := toolslib.AddJWT(payload, adminPrivKey) postBody, _ := json.Marshal(mPayload) postBuffer := bytes.NewBuffer(postBody) resp, _ := http.Post(endpoint, "application/json", postBuffer)
func BurnNFT ¶
func BurnNFT(burnerPubKey *btcec.PublicKey, burnerPrivKey *btcec.PrivateKey, nftPostHashHex string, serialNumber int, params *lib.DeSoParams, node string) error
func BuyCreator ¶
func BuyCreator(buyerPubKey *btcec.PublicKey, buyerPrivKey *btcec.PrivateKey, creatorPubKey *btcec.PublicKey, amountNanos uint64, params *lib.DeSoParams, node string) error
BuyCreator...
func GenerateJWTToken ¶
func GenerateJWTToken(privKey *btcec.PrivateKey) (_JWT string, _err error)
Generate a JWT Token for the provided private key. This can be added to the payload for requests that require JWT token authentication.
func GenerateMnemonicPublicPrivate ¶
func GenerateMnemonicPublicPrivate(params *lib.DeSoParams) (mnemonic string, pubKey *btcec.PublicKey, privKey *btcec.PrivateKey)
GenerateMnemonicPublicPrivate,,,
func GetBestChainFromBadger ¶
Returns the best chain associated with a badgerDB handle.
func OpenDataDir ¶
Returns the badgerDB handler associated with a dataDir path.
func SendDeSo ¶
func SendDeSo(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, recipientPubKey *btcec.PublicKey, amountNanos int64, params *lib.DeSoParams, node string) error
SendDeSo...
func SendDiamonds ¶
func SendDiamonds(senderPubKey *btcec.PublicKey, senderPrivKey *btcec.PrivateKey, postHashHex string, receiverPublicKeyBase58Check string, diamondLevel int64, params *lib.DeSoParams, node string) error
SendDiamonds
func SendMessage ¶
func SubmitTransactionToNode ¶
func SubmitTransactionToNode(txn *lib.MsgDeSoTxn, node string) error
SubmitTransactionToNode...
func TransferDAOCoin ¶
func UpdateBitcoinUSDExchangeRate ¶
func UpdateBitcoinUSDExchangeRate(updaterPubKey *btcec.PublicKey, updaterPrivKey *btcec.PrivateKey, newUSDCentsPerBitcoin uint64, params *lib.DeSoParams, node string) error
UpdateBitcoinUSDExchangeRate...
func UpdateProfile ¶
func UpdateProfile(updaterPubKey *btcec.PublicKey, updaterPrivKey *btcec.PrivateKey, newUsername string, newDescription string, newProfilePic string, newCreatorBasisPoints uint64, params *lib.DeSoParams, node string) error
UpdateProfile...
Types ¶
This section is empty.