Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions wasm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,17 @@ func main() {
if err != nil {
return wrapErr(err)
}
orderIndex := int64(args[1].Int())

var orderIndex int64
if args[1].Type() == js.TypeString {
orderIndex, err = strconv.ParseInt(args[1].String(), 10, 64)
if err != nil {
return wrapErr(err)
}
} else {
orderIndex = int64(args[1].Int())
}

skipNonce := uint8(args[2].Int())
nonce := int64(args[3].Int())

Expand Down Expand Up @@ -672,7 +682,17 @@ func main() {
if err != nil {
return wrapErr(err)
}
index := int64(args[1].Int())

var index int64
if args[1].Type() == js.TypeString {
index, err = strconv.ParseInt(args[1].String(), 10, 64)
if err != nil {
return wrapErr(err)
}
} else {
index = int64(args[1].Int())
}

baseAmount := int64(args[2].Int())
price := uint32(args[3].Int())
triggerPrice := uint32(args[4].Int())
Expand Down