Skip to content

Commit

Permalink
Add new login/create/restore endpoints (#29)
Browse files Browse the repository at this point in the history
* feat: add loginAccount endpoint

* feat: add createAccountAndLogin endpoint

* feat: restore account endpoint

* chore: remove unused methods
  • Loading branch information
igor-sirotin committed Mar 25, 2024
1 parent 294ee4b commit d38b114
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
32 changes: 16 additions & 16 deletions status_go.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ proc multiAccountGenerateAndDeriveAddresses*(paramsJSON: string): string =
defer: go_shim.free(funcOut)
return $funcOut

proc multiAccountStoreDerivedAccounts*(paramsJSON: string): string =
var funcOut = go_shim.multiAccountStoreDerivedAccounts(paramsJSON.cstring)
defer: go_shim.free(funcOut)
return $funcOut

proc multiAccountImportMnemonic*(paramsJSON: string): string =
var funcOut = go_shim.multiAccountImportMnemonic(paramsJSON.cstring)
defer: go_shim.free(funcOut)
Expand All @@ -61,11 +56,6 @@ proc multiAccountDeriveAddresses*(paramsJSON: string): string =
defer: go_shim.free(funcOut)
return $funcOut

proc saveAccountAndLogin*(accountData: string, password: string, settingsJSON: string, configJSON: string, subaccountData: string): string =
var funcOut = go_shim.saveAccountAndLogin(accountData.cstring, password.cstring, settingsJSON.cstring, configJSON.cstring, subaccountData.cstring)
defer: go_shim.free(funcOut)
return $funcOut

proc deleteMultiAccount*(keyUID: string, keyStoreDir: string): string =
var funcOut = go_shim.deleteMultiAccount(keyUID.cstring, keyStoreDir.cstring)
defer: go_shim.free(funcOut)
Expand Down Expand Up @@ -134,11 +124,6 @@ proc login*(accountData: string, password: string): string =
defer: go_shim.free(funcOut)
return $funcOut

proc loginWithConfig*(accountData: string, password: string, nodeCfg: string): string =
var funcOut = go_shim.loginWithConfig(accountData.cstring, password.cstring, nodeCfg.cstring)
defer: go_shim.free(funcOut)
return $funcOut

proc logout*(): string =
var funcOut = go_shim.logout()
defer: go_shim.free(funcOut)
Expand Down Expand Up @@ -398,4 +383,19 @@ proc getConnectionStringForExportingKeypairsKeystores*(configJSON: string): stri
proc inputConnectionStringForImportingKeypairsKeystores*(connectionString: string, configJSON: string): string =
var funcOut = go_shim.inputConnectionStringForImportingKeypairsKeystores(connectionString.cstring, configJSON.cstring)
defer: go_shim.free(funcOut)
return $funcOut
return $funcOut

proc loginAccount*(requestJson: string): string =
var funcOut = go_shim.loginAccount(requestJson.cstring)
defer: go_shim.free(funcOut)
return $funcOut

proc createAccountAndLogin*(requestJSON: string): string =
var funcOut = go_shim.createAccountAndLogin(requestJSON.cstring)
defer: go_shim.free(funcOut)
return $funcOut

proc restoreAccountAndLogin*(requestJSON: string): string =
var funcOut = go_shim.restoreAccountAndLogin(requestJSON.cstring)
defer: go_shim.free(funcOut)
return $funcOut
14 changes: 7 additions & 7 deletions status_go/impl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ proc openAccounts*(datadir: cstring): cstring {.importc: "OpenAccounts".}

proc multiAccountGenerateAndDeriveAddresses*(paramsJSON: cstring): cstring {.importc: "MultiAccountGenerateAndDeriveAddresses".}

proc multiAccountStoreDerivedAccounts*(paramsJSON: cstring): cstring {.importc: "MultiAccountStoreDerivedAccounts".}

proc multiAccountImportMnemonic*(paramsJSON: cstring): cstring {.importc: "MultiAccountImportMnemonic".}

proc createAccountFromMnemonicAndDeriveAccountsForPaths*(paramsJSON: cstring): cstring {.importc: "CreateAccountFromMnemonicAndDeriveAccountsForPaths".}
Expand All @@ -26,8 +24,6 @@ proc multiAccountImportPrivateKey*(paramsJSON: cstring): cstring {.importc: "Mul

proc multiAccountDeriveAddresses*(paramsJSON: cstring): cstring {.importc: "MultiAccountDeriveAddresses".}

proc saveAccountAndLogin*(accountData: cstring, password: cstring, settingsJSON: cstring, configJSON: cstring, subaccountData: cstring): cstring {.importc: "SaveAccountAndLogin".}

proc deleteMultiAccount*(keyUID: cstring, keyStoreDir: cstring): cstring {.importc: "DeleteMultiaccount".}

proc callRPC*(inputJSON: cstring): cstring {.importc: "CallRPC".}
Expand Down Expand Up @@ -56,8 +52,6 @@ proc colorID*(pk: cstring): cstring {.importc: "ColorID".}

proc login*(accountData: cstring, password: cstring): cstring {.importc: "Login".}

proc loginWithConfig*(accountData: cstring, password: cstring, configJSON: cstring): cstring {.importc: "LoginWithConfig".}

proc logout*(): cstring {.importc: "Logout".}

proc verifyAccountPassword*(keyStoreDir: cstring, address: cstring, password: cstring): cstring {.importc: "VerifyAccountPassword".}
Expand Down Expand Up @@ -164,4 +158,10 @@ proc validateConnectionString*(connectionString: cstring) : cstring {.importc: "

proc getConnectionStringForExportingKeypairsKeystores*(configJSON: cstring) : cstring {.importc: "GetConnectionStringForExportingKeypairsKeystores".}

proc inputConnectionStringForImportingKeypairsKeystores*(connectionString: cstring, configJSON: cstring) : cstring {.importc: "InputConnectionStringForImportingKeypairsKeystores".}
proc inputConnectionStringForImportingKeypairsKeystores*(connectionString: cstring, configJSON: cstring) : cstring {.importc: "InputConnectionStringForImportingKeypairsKeystores".}

proc loginAccount*(requestJSON: cstring): cstring {.importc: "LoginAccount".}

proc createAccountAndLogin*(requestJSON: cstring): cstring {.importc: "CreateAccountAndLogin".}

proc restoreAccountAndLogin*(requestJSON: cstring): cstring {.importc: "RestoreAccountAndLogin".}

0 comments on commit d38b114

Please sign in to comment.