fix: send collectible token-id hex conversion (#21094)

This commit is contained in:
Lungu Cristian 2024-08-22 18:15:44 +03:00 committed by GitHub
parent 449b2808e6
commit 2cb50fcbf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -731,8 +731,8 @@
:route route
:token-address token-address
:token-id (if collectible
(money/to-hex
(js/parseInt token-id))
(utils.hex/number-to-hex
token-id)
token-id)
:data data
:eth-transfer? eth-transfer?})]

View File

@ -1,6 +1,7 @@
(ns utils.hex
(:require
[clojure.string :as string]
[native-module.core :as native-module]
[schema.core :as schema]))
(defn normalize-hex
@ -25,3 +26,14 @@
[:=>
[:cat :string]
:string])
(defn number-to-hex
[value]
(->> value
native-module/number-to-hex
prefix-hex))
(schema/=> number-to-hex
[:=>
[:cat [:or :string :int]]
:string])