From bc3d85bad1a412f1dc50772ee3952d6ad6bc4cf7 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 14 Dec 2021 10:22:28 +0100 Subject: [PATCH] refactor: add saved address to new backend --- status/statusgo_backend_new/saved_addresses.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 status/statusgo_backend_new/saved_addresses.nim diff --git a/status/statusgo_backend_new/saved_addresses.nim b/status/statusgo_backend_new/saved_addresses.nim new file mode 100644 index 0000000..e130331 --- /dev/null +++ b/status/statusgo_backend_new/saved_addresses.nim @@ -0,0 +1,16 @@ +import json +import ./core, ./response_type + +export response_type + +proc addSavedAddress*(name, address: string): RpcResponse[JsonNode] {.raises: [Exception].} = + let payload = %* [{"name": name, "address": address}] + return callPrivateRPC("wallet_addSavedAddress", payload) + +proc deleteSavedAddress*(address: string): RpcResponse[JsonNode] {.raises: [Exception].} = + let payload = %* [address] + return callPrivateRPC("wallet_deleteSavedAddress", payload) + +proc getSavedAddresses*(): RpcResponse[JsonNode] {.raises: [Exception].} = + let payload = %* [] + return callPrivateRPC("wallet_getSavedAddresses", payload)