mirror of
https://github.com/aljazceru/ark.git
synced 2026-02-23 03:44:20 +01:00
pkg/client-sdk: expose IsLocked (#247)
* expose IsLocked * add test for IsLocked
This commit is contained in:
@@ -25,6 +25,7 @@ func init() {
|
||||
js.Global().Set("init", InitWrapper())
|
||||
js.Global().Set("unlock", UnlockWrapper())
|
||||
js.Global().Set("lock", LockWrapper())
|
||||
js.Global().Set("locked", IsLockedWrapper())
|
||||
js.Global().Set("balance", BalanceWrapper())
|
||||
js.Global().Set("onboard", OnboardWrapper())
|
||||
js.Global().Set("receive", ReceiveWrapper())
|
||||
|
||||
@@ -76,6 +76,12 @@ func InitWrapper() js.Func {
|
||||
})
|
||||
}
|
||||
|
||||
func IsLockedWrapper() js.Func {
|
||||
return js.FuncOf(func(this js.Value, p []js.Value) interface{} {
|
||||
return js.ValueOf(arkSdkClient.IsLocked(context.Background()))
|
||||
})
|
||||
}
|
||||
|
||||
func UnlockWrapper() js.Func {
|
||||
return JSPromise(func(args []js.Value) (interface{}, error) {
|
||||
if len(args) != 1 {
|
||||
|
||||
Reference in New Issue
Block a user