feat: create an account from private key

This commit is contained in:
Sale Djenic 2023-03-17 22:18:15 +01:00
parent 73fe79616c
commit 0520107e5d
2 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,11 @@ proc createAccountFromMnemonicAndDeriveAccountsForPaths*(paramsJSON: string): st
defer: go_shim.free(funcOut) defer: go_shim.free(funcOut)
return $funcOut return $funcOut
proc createAccountFromPrivateKey*(paramsJSON: string): string =
var funcOut = go_shim.createAccountFromPrivateKey(paramsJSON.cstring)
defer: go_shim.free(funcOut)
return $funcOut
proc multiAccountImportPrivateKey*(paramsJSON: string): string = proc multiAccountImportPrivateKey*(paramsJSON: string): string =
var funcOut = go_shim.multiAccountImportPrivateKey(paramsJSON.cstring) var funcOut = go_shim.multiAccountImportPrivateKey(paramsJSON.cstring)
defer: go_shim.free(funcOut) defer: go_shim.free(funcOut)

View File

@ -17,6 +17,8 @@ proc multiAccountImportMnemonic*(paramsJSON: cstring): cstring {.importc: "Multi
proc createAccountFromMnemonicAndDeriveAccountsForPaths*(paramsJSON: cstring): cstring {.importc: "CreateAccountFromMnemonicAndDeriveAccountsForPaths".} proc createAccountFromMnemonicAndDeriveAccountsForPaths*(paramsJSON: cstring): cstring {.importc: "CreateAccountFromMnemonicAndDeriveAccountsForPaths".}
proc createAccountFromPrivateKey*(paramsJSON: cstring): cstring {.importc: "CreateAccountFromPrivateKey".}
proc multiAccountImportPrivateKey*(paramsJSON: cstring): cstring {.importc: "MultiAccountImportPrivateKey".} proc multiAccountImportPrivateKey*(paramsJSON: cstring): cstring {.importc: "MultiAccountImportPrivateKey".}
proc multiAccountDeriveAddresses*(paramsJSON: cstring): cstring {.importc: "MultiAccountDeriveAddresses".} proc multiAccountDeriveAddresses*(paramsJSON: cstring): cstring {.importc: "MultiAccountDeriveAddresses".}