2021-10-27 16:09:36 -04:00
|
|
|
import json
|
2021-12-20 11:51:41 +01:00
|
|
|
import ./core, ./response_type
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-20 11:51:41 +01:00
|
|
|
export response_type
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-22 14:41:13 +01:00
|
|
|
proc resolver*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-20 11:51:41 +01:00
|
|
|
return core.callPrivateRPC("ens_resolver", payload)
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-22 14:41:13 +01:00
|
|
|
proc ownerOf*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
|
|
|
|
|
|
|
return core.callPrivateRPC("ens_ownerOf", payload)
|
|
|
|
|
|
|
|
proc contentHash*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-20 11:51:41 +01:00
|
|
|
return core.callPrivateRPC("ens_contentHash", payload)
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-22 14:41:13 +01:00
|
|
|
proc publicKeyOf*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
|
|
|
|
|
|
|
return core.callPrivateRPC("ens_publicKeyOf", payload)
|
|
|
|
|
|
|
|
proc addressOf*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
|
|
|
|
|
|
|
return core.callPrivateRPC("ens_addressOf", payload)
|
|
|
|
|
|
|
|
proc expireAt*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
|
|
|
|
|
|
|
return core.callPrivateRPC("ens_expireAt", payload)
|
|
|
|
|
|
|
|
proc price*(chainId: int): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId]
|
|
|
|
return core.callPrivateRPC("ens_price", payload)
|
2021-10-27 16:09:36 -04:00
|
|
|
|
2021-12-22 14:41:13 +01:00
|
|
|
proc resourceURL*(chainId: int, username: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [chainId, username]
|
|
|
|
return core.callPrivateRPC("ens_resourceURL", payload)
|