Last active
December 5, 2019 06:23
-
-
Save hewigovens/ad1169e4b51fb8cc2f76aa0937c28d66 to your computer and use it in GitHub Desktop.
call wallet core from go on macOS
This file contains hidden or 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
package main | |
// #cgo CFLAGS: -I${SRCDIR}/wallet-core/include | |
// #cgo LDFLAGS: -L${SRCDIR}/wallet-core/build/ios -lTrezorCrypto -lTrustWalletCore -lprotobuf -lc++ | |
// #include <TrustWalletCore/TWHDWallet.h> | |
// #include <TrustWalletCore/TWString.h> | |
import "C" | |
import "fmt" | |
func main() { | |
fmt.Println("==> calling wallet core from go") | |
str := C.TWStringCreateWithUTF8Bytes(C.CString("confirm bleak useless tail chalk destroy horn step bulb genuine attract split")) | |
defer C.TWStringDelete(str) | |
valid := C.TWHDWalletIsValid(str) | |
fmt.Println("<== mnemonic is valid: ", valid) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.trustwallet.com/wallet-core/server-side