diff --git a/Cargo.lock b/Cargo.lock index 4de4c7b9e..bed0047c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1189,7 +1189,7 @@ checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "clients-info" version = "0.1.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "frame-system", @@ -2060,7 +2060,7 @@ dependencies = [ [[package]] name = "currency" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "frame-system", @@ -2848,7 +2848,7 @@ dependencies = [ [[package]] name = "fee" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "frame-benchmarking", @@ -4145,7 +4145,7 @@ dependencies = [ [[package]] name = "issue" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "base64 0.13.1", "currency", @@ -5423,7 +5423,7 @@ dependencies = [ [[package]] name = "module-issue-rpc" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "jsonrpsee", "module-issue-rpc-runtime-api", @@ -5436,7 +5436,7 @@ dependencies = [ [[package]] name = "module-issue-rpc-runtime-api" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "parity-scale-codec", @@ -5447,7 +5447,7 @@ dependencies = [ [[package]] name = "module-oracle-rpc" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "jsonrpsee", "module-oracle-rpc-runtime-api", @@ -5455,24 +5455,26 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", + "spacewalk-primitives", ] [[package]] name = "module-oracle-rpc-runtime-api" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "parity-scale-codec", "serde", "sp-api", "sp-std", + "spacewalk-primitives", ] [[package]] name = "module-redeem-rpc" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "jsonrpsee", "module-redeem-rpc-runtime-api", @@ -5485,7 +5487,7 @@ dependencies = [ [[package]] name = "module-redeem-rpc-runtime-api" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "parity-scale-codec", @@ -5496,7 +5498,7 @@ dependencies = [ [[package]] name = "module-replace-rpc" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "jsonrpsee", "module-replace-rpc-runtime-api", @@ -5509,7 +5511,7 @@ dependencies = [ [[package]] name = "module-replace-rpc-runtime-api" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "parity-scale-codec", @@ -5520,7 +5522,7 @@ dependencies = [ [[package]] name = "module-vault-registry-rpc" version = "0.3.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "jsonrpsee", "module-oracle-rpc-runtime-api", @@ -5534,7 +5536,7 @@ dependencies = [ [[package]] name = "module-vault-registry-rpc-runtime-api" version = "0.3.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "module-oracle-rpc-runtime-api", @@ -5809,7 +5811,7 @@ dependencies = [ [[package]] name = "nomination" version = "0.5.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "fee", @@ -5980,7 +5982,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "oracle" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "dia-oracle", @@ -7615,6 +7617,7 @@ dependencies = [ "cumulus-relay-chain-minimal-node", "cumulus-relay-chain-rpc-interface", "development-runtime", + "dia-oracle-runtime-api", "foucoco-runtime", "frame-benchmarking", "frame-benchmarking-cli", @@ -9501,7 +9504,7 @@ dependencies = [ [[package]] name = "redeem" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "fee", @@ -9663,7 +9666,7 @@ dependencies = [ [[package]] name = "replace" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "fee", @@ -9706,7 +9709,7 @@ dependencies = [ [[package]] name = "reward" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-benchmarking", "frame-support", @@ -11452,7 +11455,7 @@ dependencies = [ [[package]] name = "security" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-support", "frame-system", @@ -12494,7 +12497,7 @@ dependencies = [ [[package]] name = "spacewalk-primitives" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "base58", "bstringify", @@ -12555,7 +12558,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staking" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "frame-benchmarking", "frame-support", @@ -12761,7 +12764,7 @@ dependencies = [ [[package]] name = "stellar-relay" version = "1.0.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "base64 0.13.1", "currency", @@ -13741,7 +13744,7 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vault-registry" version = "1.2.0" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=31df1832483199b978ae07f6ed4e018a11ff4dba#31df1832483199b978ae07f6ed4e018a11ff4dba" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=6a3b14a33da0a97f391a5a7e689ee658da52da84#6a3b14a33da0a97f391a5a7e689ee658da52da84" dependencies = [ "currency", "fee", diff --git a/node/Cargo.toml b/node/Cargo.toml index 089ade756..dd69f2db3 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -15,13 +15,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0" } serde = { version = "1.0.145", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } -module-issue-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-oracle-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-redeem-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-replace-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-vault-registry-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} +module-issue-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-oracle-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-redeem-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-replace-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-vault-registry-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} -spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} +spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +dia-oracle-runtime-api = { git = "https://github.com/pendulum-chain/oracle-pallet", default-features = false, branch = "polkadot-v0.9.40" } # Local amplitude-runtime = {path = "../runtime/amplitude"} diff --git a/runtime/amplitude/Cargo.toml b/runtime/amplitude/Cargo.toml index 5b1b7b7f8..29c8d6e56 100644 --- a/runtime/amplitude/Cargo.toml +++ b/runtime/amplitude/Cargo.toml @@ -26,25 +26,25 @@ smallvec = "1.9.0" runtime-common = { path = "../common", default-features = false } # Custom libraries for Spacewalk -clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -reward = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } -module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } +clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +reward = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } +module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } # Substrate frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.40" } diff --git a/runtime/amplitude/src/lib.rs b/runtime/amplitude/src/lib.rs index 5e8aac93f..5f59b69ff 100644 --- a/runtime/amplitude/src/lib.rs +++ b/runtime/amplitude/src/lib.rs @@ -1771,6 +1771,11 @@ impl_runtime_apis! { let result = Oracle::usd_to_currency(amount.amount, currency_id)?; Ok(BalanceWrapper{amount:result}) } + + fn get_exchange_rate(currency_id: CurrencyId) -> Result { + let result = Oracle::get_exchange_rate(currency_id)?; + Ok(result) + } } } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 7023c6c53..1a91e032c 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -30,7 +30,7 @@ orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-m dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", default-features = false, branch = "polkadot-v0.9.40" } zenlink-protocol = { git = "https://github.com/pendulum-chain/Zenlink-DEX-Module", default-features = false, branch = "polkadot-v0.9.40-protocol" } -spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba" } +spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84" } [features] default = [ diff --git a/runtime/foucoco/Cargo.toml b/runtime/foucoco/Cargo.toml index 4c281a323..50b796bfd 100644 --- a/runtime/foucoco/Cargo.toml +++ b/runtime/foucoco/Cargo.toml @@ -26,26 +26,26 @@ smallvec = "1.9.0" runtime-common = { path = "../common", default-features = false } # custom libraries from spacewalk -clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -reward = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} +clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +reward = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} -module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} -module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} +module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} +module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} # Substrate frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.40" } diff --git a/runtime/foucoco/src/lib.rs b/runtime/foucoco/src/lib.rs index 19d02a293..375668f3d 100644 --- a/runtime/foucoco/src/lib.rs +++ b/runtime/foucoco/src/lib.rs @@ -2090,6 +2090,11 @@ impl_runtime_apis! { let result = Oracle::usd_to_currency(amount.amount, currency_id)?; Ok(BalanceWrapper{amount:result}) } + + fn get_exchange_rate(currency_id: CurrencyId) -> Result { + let result = Oracle::get_exchange_rate(currency_id)?; + Ok(result) + } } } diff --git a/runtime/pendulum/Cargo.toml b/runtime/pendulum/Cargo.toml index d5d5bf672..7b73ee77e 100644 --- a/runtime/pendulum/Cargo.toml +++ b/runtime/pendulum/Cargo.toml @@ -26,7 +26,7 @@ smallvec = "1.9.0" runtime-common = {path = "../common", default-features = false} # Spacewalk libraries -spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "31df1832483199b978ae07f6ed4e018a11ff4dba"} +spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "6a3b14a33da0a97f391a5a7e689ee658da52da84"} # Substrate frame-benchmarking = {git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.40"}